From 37640067e0587ded3652987d0830390e9558fd75 Mon Sep 17 00:00:00 2001 From: Camilo Higuita Date: Tue, 13 Aug 2019 10:02:34 -0500 Subject: [PATCH] when opneing external urls check local file path --- src/index.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/index.cpp b/src/index.cpp index 8af07c3..b1b0861 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -2,6 +2,7 @@ #include #include #include +#include Index::Index(QObject *parent) : QObject(parent) {} @@ -10,12 +11,14 @@ void Index::openPaths(const QStringList &paths) { emit this->openPath(std::accumulate(paths.constBegin(), paths.constEnd(), QStringList(), [](QStringList &list, const QString &path) -> QStringList { - const QFileInfo file(path); - if(file.isDir()) - list << path; - else - list << file.dir().absolutePath(); + const auto url = QUrl::fromLocalFile(path); - return list; - })); + const QFileInfo file(url.toLocalFile()); + if(file.isDir()) + list << url.toString(); + else + list << QUrl::fromLocalFile(file.dir().absolutePath()).toString(); + + return list; + })); } -- 2.24.1