]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/global.cpp
FoldersPanel: Fix inline renaming
[dolphin.git] / src / global.cpp
index 3d17a733bca243110621a75069adbd2c5c5ec146..92b1f7f56939ddfa64933465ff2559d065a67a99 100644 (file)
@@ -9,6 +9,7 @@
 #include "dolphin_generalsettings.h"
 #include "dolphindebug.h"
 #include "dolphinmainwindowinterface.h"
+#include "views/viewproperties.h"
 
 #include <KConfigWatcher>
 #include <KDialogJobUiDelegate>
@@ -90,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;
@@ -140,6 +139,12 @@ QVector<QPair<QSharedPointer<OrgKdeDolphinMainWindowInterface>, QStringList>> Do
     return dolphinInterfaces;
 }
 
+QPair<QString, Qt::SortOrder> Dolphin::sortOrderForUrl(QUrl &url)
+{
+    ViewProperties globalProps(url);
+    return QPair<QString, Qt::SortOrder>(globalProps.sortRole(), globalProps.sortOrder());
+}
+
 double GlobalConfig::animationDurationFactor()
 {
     if (s_animationDurationFactor >= 0.0) {