mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-25 22:46:04 +03:00
Replace prefixing of paths with file:// by QUrl::fromLocalFile()
Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
This commit is contained in:
parent
749070a29c
commit
0f620acc1f
2 changed files with 2 additions and 8 deletions
|
@ -96,8 +96,7 @@ QVariant ActivityListModel::data(const QModelIndex &index, int role) const
|
||||||
relPath.prepend(folder->remotePath());
|
relPath.prepend(folder->remotePath());
|
||||||
list = FolderMan::instance()->findFileInLocalFolders(relPath, ast->account());
|
list = FolderMan::instance()->findFileInLocalFolders(relPath, ast->account());
|
||||||
if (list.count() > 0) {
|
if (list.count() > 0) {
|
||||||
QString path = "file:///" + QString(list.at(0));
|
return QUrl::fromLocalFile(list.at(0));
|
||||||
return QUrl(path);
|
|
||||||
}
|
}
|
||||||
// File does not exist anymore? Let's try to open its path
|
// File does not exist anymore? Let's try to open its path
|
||||||
if (QFileInfo(relPath).exists()) {
|
if (QFileInfo(relPath).exists()) {
|
||||||
|
|
|
@ -420,12 +420,7 @@ void User::openLocalFolder()
|
||||||
const auto folder = getFolder();
|
const auto folder = getFolder();
|
||||||
|
|
||||||
if (folder != nullptr) {
|
if (folder != nullptr) {
|
||||||
#ifdef Q_OS_WIN
|
QDesktopServices::openUrl(QUrl::fromLocalFile(folder->path()));
|
||||||
QString path = "file:///" + folder->path();
|
|
||||||
#else
|
|
||||||
QString path = "file://" + folder->path();
|
|
||||||
#endif
|
|
||||||
QDesktopServices::openUrl(path);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue