┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphinapplication.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2010-02-05 13:17:31 +0000
committerPeter Penz <[email protected]>2010-02-05 13:17:31 +0000
commita3ae439be69a44a401de3e9288b020d41ff7e3e1 (patch)
tree18be4315de7cf745ec6e6141b39a8eaa75cbc560 /src/dolphinapplication.cpp
parent28e6a719d80dfb5124540bbc6913b2acb1b54dcf (diff)
Fixed regression that has been introduced by the --select option: don't create 2 Dolphin windows instead of one when restoring a session.
BUG: 223831 svn path=/trunk/KDE/kdebase/apps/; revision=1085555
Diffstat (limited to 'src/dolphinapplication.cpp')
-rw-r--r--src/dolphinapplication.cpp26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/dolphinapplication.cpp b/src/dolphinapplication.cpp
index c418f4540..8b6139d92 100644
--- a/src/dolphinapplication.cpp
+++ b/src/dolphinapplication.cpp
@@ -72,23 +72,27 @@ void DolphinApplication::refreshMainWindows()
int DolphinApplication::newInstance()
{
KCmdLineArgs* args = KCmdLineArgs::parsedArgs();
+ static bool first = true;
- QList<KUrl> urls;
const int argsCount = args->count();
- for (int i = 0; i < argsCount; ++i) {
- urls.append(args->url(i));
- }
+ if ((argsCount > 0) || !first || !isSessionRestored()) {
+ QList<KUrl> urls;
+ for (int i = 0; i < argsCount; ++i) {
+ urls.append(args->url(i));
+ }
- DolphinMainWindow* win = createMainWindow();
- if (urls.count() > 0) {
- if (args->isSet("select")) {
- win->openFiles(urls);
- } else {
- win->openDirectories(urls);
+ DolphinMainWindow* win = createMainWindow();
+ if (urls.count() > 0) {
+ if (args->isSet("select")) {
+ win->openFiles(urls);
+ } else {
+ win->openDirectories(urls);
+ }
}
+ win->show();
}
- win->show();
+ first = false;
args->clear();
return 0;
}