MCPcopy Create free account
hub / github.com/KDE/kdiff3 / prettyAbsPath

Method prettyAbsPath

src/fileaccess.h:83–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81 //Workaround for QUrl::toDisplayString/QUrl::toString behavior that does not fit KDiff3's expectations
82 [[nodiscard]] QString absoluteFilePath() const;
83 [[nodiscard]] static QString prettyAbsPath(const QUrl& url)
84 {
85 if(!isLocal(url)) return url.toDisplayString();
86
87 //work around for bad path in windows drop event urls. (Qt 5.15.2 affected)
88 const QString path = url.toLocalFile();
89 if(!path.isEmpty() && !path.startsWith('/'))
90 return path;
91
92 return QFileInfo(url.path()).absoluteFilePath();
93 }
94
95 //Workaround for QUrl::isLocalFile behavior that does not fit KDiff3's expectations.
96 [[nodiscard]] bool isLocal() const;

Callers

nothing calls this directly

Calls 2

isEmptyMethod · 0.45
absoluteFilePathMethod · 0.45

Tested by

no test coverage detected