Fix selecting file always opening new instance

Instead try to attach to all existing instances and quit after succeeding.

BUG: 440663
This commit is contained in:
Alexander Lohnau 2021-08-14 13:07:24 +02:00
parent 6964140699
commit 542e2a214a
No known key found for this signature in database
GPG key ID: 1F58708D54A003E7

View file

@ -91,16 +91,14 @@ bool Dolphin::attachToExistingInstance(const QList<QUrl>& inputUrls, bool openFi
newUrls.append(url);
}
}
dolphinInterfaces.front().second << newUrls;
for (const auto& interface: qAsConst(dolphinInterfaces)) {
if (!interface.second.isEmpty()) {
auto reply = openFiles ? interface.first->openFiles(interface.second, splitView) : interface.first->openDirectories(interface.second, splitView);
reply.waitForFinished();
if (!reply.isError()) {
interface.first->activateWindow();
attached = true;
}
auto reply = openFiles ? interface.first->openFiles(newUrls, splitView) : interface.first->openDirectories(newUrls, splitView);
reply.waitForFinished();
if (!reply.isError()) {
interface.first->activateWindow();
attached = true;
break;
}
}
return attached;