diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2009-10-25 15:39:57 +0100 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2009-10-25 15:39:57 +0100 |
commit | 964277b19b2d1ea9809581c8346e4a30594b643f (patch) | |
tree | a70b718d6cfb345eaf53b826b1d1ad7aacb98f7d | |
parent | Ronny's close tab solution was better :) (diff) | |
download | rekonq-964277b19b2d1ea9809581c8346e4a30594b643f.tar.xz |
should fix bug 211782
BUG: 211782
-rw-r--r-- | src/application.cpp | 54 |
1 files changed, 32 insertions, 22 deletions
diff --git a/src/application.cpp b/src/application.cpp index 9c4507f0..84aab713 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -92,6 +92,36 @@ int Application::newInstance() // so initialize only once static bool first = true; + if(args->count() == 0) + { + MainWindow *w = 0; + if(first) // we are starting rekonq, for the first time with no args: use startup behaviour + { + switch(ReKonfig::startupBehaviour()) + { + case 0: // open home page + w = newMainWindow(); + w->slotHome(); + break; + case 1: // open new tab page + w = newMainWindow(); + w->homePage(); + break; + case 2: // restore session + if(sessionManager()->restoreSession()) + break; + default: + w = newMainWindow(); + w->slotHome(); + break; + } + } + else // rekonq has just been started. Just open a new window + { + w = newMainWindow(); + } + } + if (first) { QTimer::singleShot(0, this, SLOT(postLaunch())); @@ -106,9 +136,8 @@ int Application::newInstance() kDebug() << "session restored"; return 1; } - -// -------------------------------------------------------------------------- - + + // are there args? load them.. if (args->count() > 0) { // is there a window open on the current desktop ? use it! @@ -137,25 +166,6 @@ int Application::newInstance() return 3; } - MainWindow *w = 0; - switch(ReKonfig::startupBehaviour()) - { - case 0: // open home page - w = newMainWindow(); - w->slotHome(); - break; - case 1: // open new tab page - w = newMainWindow(); - w->homePage(); - break; - case 2: // restore session - if(sessionManager()->restoreSession()) - break; - default: - w = newMainWindow(); - w->slotHome(); - break; - } return 0; } |