diff --git a/src/index.cpp b/src/index.cpp index 8af07c302c4f828fbf2d22fc270d68ae592dc392..b1b086104cf3e5b01130eec61dca241bf7adcd0e 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; + })); }