Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions src/dbus/applicationservice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,6 @@ QDBusObjectPath ApplicationService::Launch(const QString &action, const QStringL
formattedRes.append(value.value<QString>());
}

auto newLoc = task.argNum;
if (task.local) {
for (auto it = formattedRes.begin(); it != formattedRes.end();) {
const QUrl url{*it};
Expand All @@ -571,8 +570,10 @@ QDBusObjectPath ApplicationService::Launch(const QString &action, const QStringL
shouldErase = true;
} else {
const auto scheme = url.scheme();
if (scheme == "file" || scheme.isEmpty()) {
if (scheme == "file") {
*it = url.toLocalFile();
} else if (scheme.isEmpty()) {
// nothing to do
} else {
// TODO: Remote file handling logic
qWarning() << "Remote file not supported yet, skipping:" << *it;
Expand All @@ -582,17 +583,15 @@ QDBusObjectPath ApplicationService::Launch(const QString &action, const QStringL

if (shouldErase) {
auto curLoc = std::distance(formattedRes.begin(), it);
if (curLoc < newLoc) {
--newLoc;
if (curLoc < task.argNum) {
--task.argNum;
}
it = formattedRes.erase(it);
} else {
++it;
}
}
}

task.argNum = newLoc;
}

int originalIndex{0};
Expand Down
Loading