diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2011-03-08 19:48:51 +0100 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2011-03-08 19:48:51 +0100 |
commit | 4141eedc2fd5c014896c6196bf998b93c520a97f (patch) | |
tree | 2cb395c337f5ba7555bc50b7ac920ce8ae545047 /src/application.cpp | |
parent | Checking for the empty string causing Rohan & Pano's bug... (diff) | |
download | rekonq-4141eedc2fd5c014896c6196bf998b93c520a97f.tar.xz |
This commit fix bug 266837 about the (in)ability to close rekonq,
but IT CHANGES Application::mainWindow() behavior to an unsafe mode.
It is now basically allowed to return a null pointer, leading to other possible crashes.
Some days of testing since now, for this.
BUG:266837
Diffstat (limited to 'src/application.cpp')
-rw-r--r-- | src/application.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/application.cpp b/src/application.cpp index 97d9a571..5867211f 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -174,17 +174,17 @@ int Application::newInstance() switch (ReKonfig::startupBehaviour()) { case 0: // open home page - mainWindow()->homePage(); + newMainWindow()->homePage(); break; case 1: // open new tab page - loadUrl(KUrl("about:home")); + loadUrl(KUrl("about:home"), Rekonq::NewWindow); break; case 2: // restore session sessionManager()->restoreSession(); kDebug() << "session restored following settings"; break; default: - mainWindow()->homePage(); + newMainWindow()->homePage(); break; } } @@ -253,13 +253,13 @@ void Application::saveConfiguration() const MainWindow *Application::mainWindow() { - if (m_mainWindows.isEmpty()) - return newMainWindow(); - MainWindow *active = qobject_cast<MainWindow*>(QApplication::activeWindow()); if (!active) { + if(m_mainWindows.isEmpty()) + return 0; + return m_mainWindows.at(0).data(); } return active; |