┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphinmainwindow.cpp
diff options
context:
space:
mode:
authorFrank Reininghaus <[email protected]>2009-08-13 18:54:16 +0000
committerFrank Reininghaus <[email protected]>2009-08-13 18:54:16 +0000
commitc0922a81d88affaded8b8ff22b8671eedecf900c (patch)
tree9430d9fd42d864ce911dfdfa26ede63f1c6e1969 /src/dolphinmainwindow.cpp
parentbcc439dd661a709f8ffed4a9420dbd0bcfd79899 (diff)
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
Diffstat (limited to 'src/dolphinmainwindow.cpp')
-rw-r--r--src/dolphinmainwindow.cpp10
1 files changed, 9 insertions, 1 deletions
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<DolphinApplication*>(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