]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Fix selecting file always opening new instance
authorAlexander Lohnau <alexander.lohnau@gmx.de>
Sat, 14 Aug 2021 11:07:24 +0000 (13:07 +0200)
committerAlexander Lohnau <alexander.lohnau@gmx.de>
Tue, 24 Aug 2021 14:21:40 +0000 (16:21 +0200)
Instead try to attach to all existing instances and quit after succeeding.

BUG: 440663

src/global.cpp

index 197d6ec288f5e1b88ca0a9b3d129154293d4fbb3..92b1f7f56939ddfa64933465ff2559d065a67a99 100644 (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;