summaryrefslogtreecommitdiffstats
path: root/konqueror/konq_main.h
diff options
context:
space:
mode:
Diffstat (limited to 'konqueror/konq_main.h')
-rw-r--r--konqueror/konq_main.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/konqueror/konq_main.h b/konqueror/konq_main.h
new file mode 100644
index 000000000..ff72a5181
--- /dev/null
+++ b/konqueror/konq_main.h
@@ -0,0 +1,27 @@
+#ifndef __konq_main_h
+#define __konq_main_h
+
+#include <kapplication.h>
+
+// This is used to know if we are being closed by session management
+// or by the user. See KonqMainWindow::~KonqMainWindow.
+// Credits to Matthias Ettrich for the idea.
+class KonquerorApplication : public KApplication
+{
+public:
+ KonquerorApplication() : KApplication(),
+ closed_by_sm( false ) {}
+
+ bool closedByUser() const { return !closed_by_sm; }
+ void commitData(QSessionManager& sm) {
+ closed_by_sm = true;
+ KApplication::commitData( sm );
+ closed_by_sm = false;
+ }
+
+private:
+ bool closed_by_sm;
+
+};
+
+#endif