From: Stephan Beyer Date: Mon, 8 Jun 2020 22:29:42 +0000 (+0200) Subject: Replace prefixing of paths with file:// by QUrl::fromLocalFile() X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~222^2^2~169^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=0f620acc1f9d77dfb906e8f906a89912e3e822a9;p=nextcloud-desktop.git Replace prefixing of paths with file:// by QUrl::fromLocalFile() Signed-off-by: Stephan Beyer --- diff --git a/src/gui/tray/ActivityListModel.cpp b/src/gui/tray/ActivityListModel.cpp index 1aea5ee1c..f6c9a1778 100644 --- a/src/gui/tray/ActivityListModel.cpp +++ b/src/gui/tray/ActivityListModel.cpp @@ -96,8 +96,7 @@ QVariant ActivityListModel::data(const QModelIndex &index, int role) const relPath.prepend(folder->remotePath()); list = FolderMan::instance()->findFileInLocalFolders(relPath, ast->account()); if (list.count() > 0) { - QString path = "file:///" + QString(list.at(0)); - return QUrl(path); + return QUrl::fromLocalFile(list.at(0)); } // File does not exist anymore? Let's try to open its path if (QFileInfo(relPath).exists()) { diff --git a/src/gui/tray/UserModel.cpp b/src/gui/tray/UserModel.cpp index 106fb36b4..7eb07ec51 100644 --- a/src/gui/tray/UserModel.cpp +++ b/src/gui/tray/UserModel.cpp @@ -420,12 +420,7 @@ void User::openLocalFolder() const auto folder = getFolder(); if (folder != nullptr) { -#ifdef Q_OS_WIN - QString path = "file:///" + folder->path(); -#else - QString path = "file://" + folder->path(); -#endif - QDesktopServices::openUrl(path); + QDesktopServices::openUrl(QUrl::fromLocalFile(folder->path())); } }