From 4141eedc2fd5c014896c6196bf998b93c520a97f Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Tue, 8 Mar 2011 19:48:51 +0100 Subject: 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 --- src/application.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/application.cpp') 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(QApplication::activeWindow()); if (!active) { + if(m_mainWindows.isEmpty()) + return 0; + return m_mainWindows.at(0).data(); } return active; -- cgit v1.2.1