summaryrefslogtreecommitdiff
path: root/src/application.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-10-23 00:13:54 +0200
committerAndrea Diamantini <adjam7@gmail.com>2009-10-23 00:13:54 +0200
commit0cd8eaf723eaaa4b6aa3ad7125f1d8ce0569d55e (patch)
tree24fce08448f43744d5ad4a3864be7b82567315fc /src/application.cpp
parentMerge commit 'refs/merge-requests/1884' of git://gitorious.org/rekonq/mainlin... (diff)
parent(LAST hopefully) BIG change (before 0.3) (diff)
downloadrekonq-0cd8eaf723eaaa4b6aa3ad7125f1d8ce0569d55e.tar.xz
Merge branch 'StartRekonq'
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;
-}