From c0922a81d88affaded8b8ff22b8671eedecf900c Mon Sep 17 00:00:00 2001 From: Frank Reininghaus Date: Thu, 13 Aug 2009 18:54:16 +0000 Subject: Do not warn the user about closing Dolphin windows with multiple tabs if Dolphin is closed by the session manager, i.e., if the user logs out. The fix is inspired by the way this issue is handled in Konqueror. BUG: 201803 svn path=/trunk/KDE/kdebase/apps/; revision=1011002 --- src/dolphinmainwindow.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/dolphinmainwindow.cpp') diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index bf39db15d..6443494ef 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -426,7 +426,15 @@ void DolphinMainWindow::closeEvent(QCloseEvent* event) DolphinSettings& settings = DolphinSettings::instance(); GeneralSettings* generalSettings = settings.generalSettings(); - if ((m_viewTab.count() > 1) && generalSettings->confirmClosingMultipleTabs()) { + // Find out if Dolphin is closed directly by the user or + // by the session manager because the session is closed + bool closedByUser = true; + DolphinApplication *application = qobject_cast(qApp); + if (application && application->closedBySessionManager()) { + closedByUser = false; + } + + if ((m_viewTab.count() > 1) && generalSettings->confirmClosingMultipleTabs() && closedByUser) { // Ask the user if he really wants to quit and close all tabs. // Open a confirmation dialog with 3 buttons: // KDialog::Yes -> Quit -- cgit v1.3