diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2012-07-30 17:33:34 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2012-12-10 02:48:04 +0100 |
commit | e4ff5514f1fad63fc03ba3e1046eb4a350ca3562 (patch) | |
tree | 22aedf3169f9a6d8e4e63d5d60da4c7146e8dc7b /src/application.cpp | |
parent | Insert back HistoryManager (diff) | |
download | rekonq-e4ff5514f1fad63fc03ba3e1046eb4a350ca3562.tar.xz |
Session Manager
- Moved to new rekonq API
- Use autosaver to save up disk writes
Diffstat (limited to 'src/application.cpp')
-rw-r--r-- | src/application.cpp | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/src/application.cpp b/src/application.cpp index 2434eeaa..286f113f 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -32,12 +32,14 @@ #include "rekonq.h" // Local Includes +#include "searchengine.h" #include "tabwindow.h" #include "webwindow.h" #include "urlresolver.h" // Local Manager(s) Includes #include "historymanager.h" +#include "sessionmanager.h" // // KDE Includes #include <KCmdLineArgs> @@ -120,10 +122,10 @@ int Application::newInstance() } } -// if (isFirstLoad && (ReKonfig::startupBehaviour() == 2)) // && sessionManager()->restoreSessionFromScratch()) -// { -// isFirstLoad = false; -// } + if (isFirstLoad && (ReKonfig::startupBehaviour() == 2) && SessionManager::self()->restoreSessionFromScratch()) + { + isFirstLoad = false; + } // first argument: 99% of the time we have just that... if (isFirstLoad) @@ -178,11 +180,11 @@ int Application::newInstance() case 1: // open new tab page loadUrl(KUrl("about:home"), Rekonq::NewWindow); break; - case 2: // restore session FIXME -// if (sessionManager()->restoreSessionFromScratch()) -// { -// break; -// } + case 2: // restore session + if (SessionManager::self()->restoreSessionFromScratch()) + { + break; + } default: newTabWindow()->newCleanTab(); break; @@ -208,20 +210,19 @@ int Application::newInstance() } } // !isSessionRestored() -// if (isFirstLoad) -// { -// FIXME -// if (hasToBeRecovered) -// { -// QTimer::singleShot(1000, tabWindow()->currentTab(), SLOT(showMessageBar())); -// } -// else -// { -// sessionManager()->setSessionManagementEnabled(true); -// } -// -// if (ReKonfig::checkDefaultSearchEngine() && !hasToBeRecovered && SearchEngine::defaultEngine().isNull()) -// QTimer::singleShot(2000, tabWindow()->currentTab(), SLOT(showSearchEngineBar())); + if (isFirstLoad) + { + if (hasToBeRecovered) + { + QTimer::singleShot(1000, tabWindow()->currentWebWindow(), SLOT(showMessageBar())); + } + else + { + SessionManager::self()->setSessionManagementEnabled(true); + } + + if (ReKonfig::checkDefaultSearchEngine() && !hasToBeRecovered && SearchEngine::defaultEngine().isNull()) + QTimer::singleShot(2000, tabWindow()->currentWebWindow(), SLOT(showSearchEngineBar())); // updating rekonq configuration updateConfiguration(); @@ -233,7 +234,7 @@ int Application::newInstance() ReKonfig::setRecoverOnCrash(ReKonfig::recoverOnCrash() + 1); saveConfiguration(); -// } + } KStartupInfo::appStarted(); isFirstLoad = false; |