mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-19 08:21:22 +00:00
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
This commit is contained in:
parent
78dd4c9ce9
commit
d430a1c3b3
|
@ -38,6 +38,16 @@ DolphinApplication::DolphinApplication() :
|
||||||
|
|
||||||
KCmdLineArgs* args = KCmdLineArgs::parsedArgs();
|
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;
|
bool resetSplitSettings = false;
|
||||||
if (args->isSet("split") && !GeneralSettings::splitView()) {
|
if (args->isSet("split") && !GeneralSettings::splitView()) {
|
||||||
// Dolphin should be opened with a split view although this is not
|
// Dolphin should be opened with a split view although this is not
|
||||||
|
@ -45,31 +55,29 @@ DolphinApplication::DolphinApplication() :
|
||||||
// all passed URLs have been opened.
|
// all passed URLs have been opened.
|
||||||
GeneralSettings::setSplitView(true);
|
GeneralSettings::setSplitView(true);
|
||||||
resetSplitSettings = true;
|
resetSplitSettings = true;
|
||||||
}
|
|
||||||
|
|
||||||
const int argsCount = args->count();
|
// We need 2 URLs to open Dolphin in split view mode
|
||||||
if (argsCount > 0) {
|
if (urls.isEmpty()) { // No URL given - Open home URL in all two views
|
||||||
QList<KUrl> urls;
|
urls.append(GeneralSettings::homeUrl());
|
||||||
for (int i = 0; i < argsCount; ++i) {
|
urls.append(GeneralSettings::homeUrl());
|
||||||
const KUrl url = args->url(i);
|
} else if (urls.length() == 1) { // Only 1 URL given - Open given URL in all two views
|
||||||
if (url.isValid()) {
|
urls.append(urls.at(0));
|
||||||
urls.append(url);
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
if (!urls.isEmpty()) {
|
||||||
if (!urls.isEmpty()) {
|
if (args->isSet("select")) {
|
||||||
if (args->isSet("select")) {
|
m_mainWindow->openFiles(urls);
|
||||||
m_mainWindow->openFiles(urls);
|
} else {
|
||||||
} else {
|
m_mainWindow->openDirectories(urls);
|
||||||
m_mainWindow->openDirectories(urls);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
args->clear();
|
|
||||||
|
|
||||||
if (resetSplitSettings) {
|
if (resetSplitSettings) {
|
||||||
GeneralSettings::setSplitView(false);
|
GeneralSettings::setSplitView(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
args->clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
DolphinApplication::~DolphinApplication()
|
DolphinApplication::~DolphinApplication()
|
||||||
|
|
Loading…
Reference in a new issue