Merge pull request #16820 from Chocobo1/comparisons

Move comparison operator out of class
This commit is contained in:
Chocobo1
2022-04-06 13:35:34 +08:00
committed by GitHub
6 changed files with 71 additions and 64 deletions

View File

@@ -142,10 +142,10 @@ QPoint Utils::Gui::screenCenter(const QWidget *w)
void Utils::Gui::openPath(const Path &path)
{
// Hack to access samba shares with QDesktopServices::openUrl
if (path.data().startsWith(u"//"))
QDesktopServices::openUrl(QUrl(u"file:" + path.toString()));
else
QDesktopServices::openUrl(QUrl::fromLocalFile(path.data()));
const QUrl url = path.data().startsWith(u"//")
? QUrl(u"file:" + path.data())
: QUrl::fromLocalFile(path.data());
QDesktopServices::openUrl(url);
}
// Open the parent directory of the given path with a file manager and select