From: Alexander Lohnau Date: Sat, 14 Aug 2021 11:07:24 +0000 (+0200) Subject: Fix selecting file always opening new instance X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/542e2a214a48a0eba6938381f1e043a37909f200 Fix selecting file always opening new instance Instead try to attach to all existing instances and quit after succeeding. BUG: 440663 --- 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;