From f02f8f72b459a30169d3016463147f662dca7491 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Thu, 22 Oct 2009 16:43:56 +0200 Subject: (LAST hopefully) BIG change (before 0.3) A strange bug on new window loading, calling from .desktop file (krunner & friends). So I had to change the homePage launch mechanism. Working on that I started playing with startup settings and implemented this. I hope Pano like this very much: 0.3 gift :D Waiting for someone comments and reviews to merge.. --- src/application.cpp | 45 ++++++++++++++++++++------------------------- 1 file changed, 20 insertions(+), 25 deletions(-) (limited to 'src/application.cpp') 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; -} -- cgit v1.2.1