summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/application.cpp7
-rw-r--r--src/rekonq.kcfg4
-rw-r--r--src/sessionmanager.cpp11
3 files changed, 12 insertions, 10 deletions
diff --git a/src/application.cpp b/src/application.cpp
index 31f0ab2e..efa7bc22 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -81,7 +81,7 @@ Application::~Application()
{
// ok, we are closing well.
// Don't recover on next load..
- ReKonfig::setRecoverOnCrash(false);
+ ReKonfig::setRecoverOnCrash(0);
saveConfiguration();
foreach( QWeakPointer<MainWindow> window, m_mainWindows)
@@ -147,7 +147,7 @@ int Application::newInstance()
// is your app session restored? restore session...
// this mechanism also falls back to load usual plain rekonq
// if something goes wrong...
- if (ReKonfig::recoverOnCrash() && sessionManager()->restoreSession())
+ if (ReKonfig::recoverOnCrash() == 1 && sessionManager()->restoreSession())
{
kDebug() << "session restored";
return 1;
@@ -205,7 +205,8 @@ void Application::postLaunch()
Application::instance(), SLOT(loadUrl(const KUrl&, const Rekonq::OpenType&)));
// crash recovering
- ReKonfig::setRecoverOnCrash(true);
+ int n = ReKonfig::recoverOnCrash();
+ ReKonfig::setRecoverOnCrash(++n);
saveConfiguration();
}
diff --git a/src/rekonq.kcfg b/src/rekonq.kcfg
index f68dc7e8..bbf20ac1 100644
--- a/src/rekonq.kcfg
+++ b/src/rekonq.kcfg
@@ -25,8 +25,8 @@
<entry name="walletBlackList" type="StringList">
<default></default>
</entry>
- <entry name="recoverOnCrash" type="bool">
- <default>false</default>
+ <entry name="recoverOnCrash" type="Int">
+ <default>0</default>
</entry>
</group>
diff --git a/src/sessionmanager.cpp b/src/sessionmanager.cpp
index 72e1cc77..9e1f7baf 100644
--- a/src/sessionmanager.cpp
+++ b/src/sessionmanager.cpp
@@ -66,7 +66,7 @@ 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);
@@ -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;
}