From 64475d706faf1620cec8899da7165f4bc369d8a2 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sat, 26 Sep 2009 00:03:00 +0200 Subject: Fixing sessionmanager (at least I hope so): - moved from DataStream to TextStream (we use strings..) - implemented a semaphore (m_safe) - closing every time file --- src/application.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/application.cpp') diff --git a/src/application.cpp b/src/application.cpp index ffde7203..683a405f 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -89,12 +89,16 @@ int Application::newInstance() KCmdLineArgs* args = KCmdLineArgs::parsedArgs(); // is your app session restored? restore session... - if (isSessionRestored()) + // this mechanism also falls back to load usual plain rekonq + // if something goes wrong... + if (isSessionRestored() && sessionManager()->restoreSession()) { - sessionManager()->restoreSession(); + kDebug() << "session restored"; return 0; } - + +// -------------------------------------------------------------------------- + if (args->count() > 0) { // is there a window open on the current desktop ? use it! @@ -143,10 +147,6 @@ void Application::postLaunch() // set Icon Database Path to store "favicons" associated with web sites QString directory = KStandardDirs::locateLocal("cache" , "" , true); - if (directory.isEmpty()) - { - directory = QDir::homePath() + QLatin1String("/.") + QCoreApplication::applicationName(); - } QWebSettings::setIconDatabasePath(directory); Application::historyManager(); @@ -166,7 +166,6 @@ MainWindow *Application::mainWindow() { kDebug() << "No extant windows: creating one new..."; MainWindow *w = newMainWindow(); - QTimer::singleShot(0, this, SLOT(postLaunch())); return w; } @@ -401,7 +400,8 @@ MainWindow *Application::newMainWindow() m_mainWindows.prepend(w); w->show(); - + QTimer::singleShot(0, this, SLOT(postLaunch())); + return w; } -- cgit v1.2.1