]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Fix how --select treats files
authorJordan Bucklin <jordan.bucklin@gmail.com>
Sat, 31 Jul 2021 19:31:49 +0000 (12:31 -0700)
committerJordan Bucklin <jordan.bucklin@gmail.com>
Sun, 1 Aug 2021 22:54:08 +0000 (15:54 -0700)
Previously, when passing file URLs with the --select option,
Dolphin would open the file in its corresponding application, as
well as opening an empty tab in Dolphin as if the file were a
directory. This happens specifically when trying to restore a
session.

This commit prevents Dolphin from opening a file in an application
and from opening an empty tab while passing the --select option,
and selects the URLs instead.

BUG: 436584

src/main.cpp

index 76b482688a411b63b7008d12e4847194b03bc039..6e9ef0b2a6dce729aecb29f5a641618aa7f950c5 100644 (file)
@@ -202,7 +202,11 @@ int main(int argc, char **argv)
                 // If the user passed any URLs to Dolphin, open those in the
                 // window after session-restoring it
                 if (startedWithURLs) {
-                    mainWindow->openDirectories(urls, splitView);
+                    if (openFiles) {
+                        mainWindow->openFiles(urls, splitView);
+                    } else {
+                        mainWindow->openDirectories(urls, splitView);
+                    }
                 }
             } else {
                 qCWarning(DolphinDebug) << "Unknown class " << className << " in session saved data!";