summaryrefslogtreecommitdiff
path: root/src/application.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-10-22 16:43:56 +0200
committerAndrea Diamantini <adjam7@gmail.com>2009-10-22 16:43:56 +0200
commitf02f8f72b459a30169d3016463147f662dca7491 (patch)
tree36adcfc14fdf2e69bd72be9440bd91f666182ebd /src/application.cpp
parentchanged title. (diff)
downloadrekonq-f02f8f72b459a30169d3016463147f662dca7491.tar.xz
(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..
Diffstat (limited to 'src/application.cpp')
-rw-r--r--src/application.cpp45
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;
-}