From 542e2a214a48a0eba6938381f1e043a37909f200 Mon Sep 17 00:00:00 2001 From: Alexander Lohnau Date: Sat, 14 Aug 2021 13:07:24 +0200 Subject: [PATCH] Fix selecting file always opening new instance Instead try to attach to all existing instances and quit after succeeding. BUG: 440663 --- src/global.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/global.cpp b/src/global.cpp index 197d6ec28..92b1f7f56 100644 --- a/src/global.cpp +++ b/src/global.cpp @@ -91,16 +91,14 @@ bool Dolphin::attachToExistingInstance(const QList& 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; -- 2.47.3