diff options
Diffstat (limited to 'src/application.cpp')
-rw-r--r-- | src/application.cpp | 45 |
1 files changed, 20 insertions, 25 deletions
diff --git a/src/application.cpp b/src/application.cpp index 41fcd515..0b9666a1 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -137,10 +137,25 @@ int Application::newInstance() return 3; } - // creating new window - MainWindow *w = newMainWindow(); - w->slotHome(); - + 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; } @@ -330,7 +345,7 @@ void Application::loadUrl(const KUrl& url, const Rekonq::OpenType& type) } // loading home pages - if (homePage(url)) + if (mainWindow()->homePage(url)) return; if (url.scheme() == QLatin1String("mailto")) @@ -445,23 +460,3 @@ MainWindowList Application::mainWindowList() { return m_mainWindows; } - - -bool Application::homePage(const KUrl &url) -{ - if ( url == KUrl("rekonq:closedTabs") - || url == KUrl("rekonq:history") - || url == KUrl("rekonq:bookmarks") - || url == KUrl("rekonq:favorites") - || url == KUrl("rekonq:home") - ) - { - kDebug() << "loading home: " << url; - MainView *view = mainWindow()->mainView(); - WebView *w = view->currentWebView(); - HomePage p(w); - w->setHtml( p.rekonqHomePage(url), url); - return true; - } - return false; -} |