diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/application.cpp | 54 | ||||
-rw-r--r-- | src/tabbar.cpp | 4 |
2 files changed, 32 insertions, 26 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; } diff --git a/src/tabbar.cpp b/src/tabbar.cpp index ac050191..b43bf4d0 100644 --- a/src/tabbar.cpp +++ b/src/tabbar.cpp @@ -272,11 +272,7 @@ void TabBar::mousePressEvent(QMouseEvent *event) { // just close tab on middle mouse click if (event->button() == Qt::MidButton) - { - int index = tabAt(event->pos()); - emit closeTab(index); return; - } KTabBar::mousePressEvent(event); } |