diff options
author | Panagiotis Papadopoulos <pano_90@gmx.net> | 2010-04-21 13:34:20 +0200 |
---|---|---|
committer | Panagiotis Papadopoulos <pano_90@gmx.net> | 2010-04-21 13:34:20 +0200 |
commit | f9153663cb8210ac4d6e7055838344839b4e19b6 (patch) | |
tree | b70233b32eadfbebff062c0000f007ca2f99d732 /src/sessionmanager.cpp | |
parent | Merge branch 'master' of git://gitorious.org/rekonq/mainline into i18n (diff) | |
parent | Nebulon's patch. (diff) | |
download | rekonq-f9153663cb8210ac4d6e7055838344839b4e19b6.tar.xz |
Merge branch 'master' of git://gitorious.org/rekonq/mainline into i18n
Diffstat (limited to 'src/sessionmanager.cpp')
-rw-r--r-- | src/sessionmanager.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/sessionmanager.cpp b/src/sessionmanager.cpp index f4e7cd3e..9e1f7baf 100644 --- a/src/sessionmanager.cpp +++ b/src/sessionmanager.cpp @@ -2,9 +2,9 @@ * * This file is a part of the rekonq project * -* Copyright (C) 2009 by Andrea Diamantini <adjam7 at gmail dot com> +* Copyright (C) 2009-2010 by Andrea Diamantini <adjam7 at gmail dot com> * Copyright (C) 2009 by Yoram Bar-Haim <<yoram.b at zend dot com> -* Copyright (C) 2009 by Lionel Chauvin <megabigbug@yahoo.fr> +* Copyright (C) 2009-2010 by Lionel Chauvin <megabigbug@yahoo.fr> * * * This program is free software; you can redistribute it and/or @@ -66,15 +66,15 @@ void SessionManager::saveSession() QFile sessionFile(m_sessionFilePath); if (!sessionFile.open(QFile::WriteOnly | QFile::Truncate)) { - kWarning() << "Unable to open session file" << sessionFile.fileName(); + kDebug() << "Unable to open session file" << sessionFile.fileName(); return; } QTextStream out(&sessionFile); MainWindowList wl = Application::instance()->mainWindowList(); - Q_FOREACH(QPointer<MainWindow> w, wl) + Q_FOREACH(QWeakPointer<MainWindow> w, wl) { out << "window\n"; - MainView *mv = w->mainView(); + MainView *mv = w.data()->mainView(); for (int i = 0 ; i < mv->count() ; i++) { out << mv->webTab(i)->url().toEncoded() << "\n"; @@ -93,7 +93,7 @@ bool SessionManager::restoreSession() return false; if (!sessionFile.open(QFile::ReadOnly)) { - kWarning() << "Unable to open session file" << sessionFile.fileName(); + kDebug() << "Unable to open session file" << sessionFile.fileName(); return false; } @@ -104,16 +104,17 @@ bool SessionManager::restoreSession() line = in.readLine(); if(line == QString("window")) { - Application::instance()->newMainWindow(); line = in.readLine(); - Application::instance()->loadUrl(line); + kDebug() << "New Window line: " << line; + Application::instance()->loadUrl(line, Rekonq::NewWindow); } else { + kDebug() << "New Current Tab line: " << line; Application::instance()->loadUrl(line, Rekonq::NewCurrentTab); } } - while(!line.isNull()); + while(!line.isEmpty()); return true; } |