From 964277b19b2d1ea9809581c8346e4a30594b643f Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sun, 25 Oct 2009 15:39:57 +0100 Subject: should fix bug 211782 BUG: 211782 --- src/application.cpp | 54 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 22 deletions(-) (limited to 'src') 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; } -- cgit v1.2.1