mirror of
https://invent.kde.org/system/dolphin
synced 2024-10-28 03:21:56 +00:00
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:
parent
6964140699
commit
542e2a214a
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue