Commit de7f64c8 authored by camilo higuita's avatar camilo higuita

make sure index can open external urls rights, for supported schemes like...

make sure index can open external urls rights, for supported schemes like file, apps, fish, mtp, remote, tags etc
parent 37640067
Pipeline #6582 failed with stage
in 23 minutes and 19 seconds
...@@ -11,13 +11,16 @@ void Index::openPaths(const QStringList &paths) ...@@ -11,13 +11,16 @@ void Index::openPaths(const QStringList &paths)
{ {
emit this->openPath(std::accumulate(paths.constBegin(), paths.constEnd(), QStringList(), [](QStringList &list, const QString &path) -> QStringList emit this->openPath(std::accumulate(paths.constBegin(), paths.constEnd(), QStringList(), [](QStringList &list, const QString &path) -> QStringList
{ {
const auto url = QUrl::fromLocalFile(path); const auto url = QUrl::fromUserInput(path);
if(url.isLocalFile())
const QFileInfo file(url.toLocalFile()); {
if(file.isDir()) const QFileInfo file(url.toLocalFile());
list << url.toString(); if(file.isDir())
else list << url.toString();
list << QUrl::fromLocalFile(file.dir().absolutePath()).toString(); else
list << QUrl::fromLocalFile(file.dir().absolutePath()).toString();
}else
list << url.toString();
return list; return list;
})); }));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment