┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuel Pescosta <[email protected]>2012-08-24 21:47:14 +0200
committerEmmanuel Pescosta <[email protected]>2012-08-24 23:57:51 +0200
commit23ce8df1c8163a94bbbf584cbe44a6ebd22b2c3a (patch)
tree294770f1371397b9b2eb9ce426f9b523ece0a880
parente7793132e8fc1549bb7781b43dbee840211224e6 (diff)
Fix wrong behaviour, when Dolphin is started with --split argument.
Actual Results: dolphin starts without split view Expected Results: dolphin starts with split view New behaviour: * no url given - use default url for all two views * one url given - use given url for all two views * two urls given - open the first url in the left view and the second url in the right view BUG: 305538 REVIEW: 106171 FIXED-IN: 4.9.1
-rw-r--r--src/dolphinapplication.cpp40
1 files changed, 24 insertions, 16 deletions
diff --git a/src/dolphinapplication.cpp b/src/dolphinapplication.cpp
index 0cd51a454..8e83a8592 100644
--- a/src/dolphinapplication.cpp
+++ b/src/dolphinapplication.cpp
@@ -38,6 +38,16 @@ DolphinApplication::DolphinApplication() :
KCmdLineArgs* args = KCmdLineArgs::parsedArgs();
+ const int argsCount = args->count();
+
+ QList<KUrl> urls;
+ for (int i = 0; i < argsCount; ++i) {
+ const KUrl url = args->url(i);
+ if (url.isValid()) {
+ urls.append(url);
+ }
+ }
+
bool resetSplitSettings = false;
if (args->isSet("split") && !GeneralSettings::splitView()) {
// Dolphin should be opened with a split view although this is not
@@ -45,31 +55,29 @@ DolphinApplication::DolphinApplication() :
// all passed URLs have been opened.
GeneralSettings::setSplitView(true);
resetSplitSettings = true;
- }
- const int argsCount = args->count();
- if (argsCount > 0) {
- QList<KUrl> urls;
- for (int i = 0; i < argsCount; ++i) {
- const KUrl url = args->url(i);
- if (url.isValid()) {
- urls.append(url);
- }
+ // We need 2 URLs to open Dolphin in split view mode
+ if (urls.isEmpty()) { // No URL given - Open home URL in all two views
+ urls.append(GeneralSettings::homeUrl());
+ urls.append(GeneralSettings::homeUrl());
+ } else if (urls.length() == 1) { // Only 1 URL given - Open given URL in all two views
+ urls.append(urls.at(0));
}
+ }
- if (!urls.isEmpty()) {
- if (args->isSet("select")) {
- m_mainWindow->openFiles(urls);
- } else {
- m_mainWindow->openDirectories(urls);
- }
+ if (!urls.isEmpty()) {
+ if (args->isSet("select")) {
+ m_mainWindow->openFiles(urls);
+ } else {
+ m_mainWindow->openDirectories(urls);
}
}
- args->clear();
if (resetSplitSettings) {
GeneralSettings::setSplitView(false);
}
+
+ args->clear();
}
DolphinApplication::~DolphinApplication()