]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Use KApplication::sessionSaving() to determine if Dolphin is closed by
authorFrank Reininghaus <frank78ac@googlemail.com>
Thu, 20 Aug 2009 15:47:38 +0000 (15:47 +0000)
committerFrank Reininghaus <frank78ac@googlemail.com>
Thu, 20 Aug 2009 15:47:38 +0000 (15:47 +0000)
the session manager - there's no need to reinvent the wheel ;-)

Thanks to Lubos Lunak for the hint.

svn path=/trunk/KDE/kdebase/apps/; revision=1013726

src/dolphinapplication.cpp
src/dolphinapplication.h
src/dolphinmainwindow.cpp

index 988019de1bf9d7e16b01b9519d82e28ef5f833ec..f61bf795a1a5ebcde2609f3bb62478072ac0b43c 100644 (file)
@@ -28,7 +28,7 @@
 #include <QtDBus/QDBusConnection>
 
 DolphinApplication::DolphinApplication() :
-    m_lastId(0), m_closedBySessionManager(false)
+    m_lastId(0)
 {
     new ApplicationAdaptor(this);
     QDBusConnection::sessionBus().registerObject("/dolphin/Application", this);
@@ -100,17 +100,6 @@ int DolphinApplication::newInstance()
     return 0;
 }
 
-bool DolphinApplication::closedBySessionManager() const
-{
-    return m_closedBySessionManager;
-}
-
-void DolphinApplication::commitData(QSessionManager& sessionManager) {
-    m_closedBySessionManager = true;
-    KUniqueApplication::commitData(sessionManager);
-    m_closedBySessionManager = false;
-}
-
 int DolphinApplication::openWindow(const KUrl& url)
 {
     DolphinMainWindow* win = createMainWindow();
index 4c65443612b777643ee7e7b85c507f34cc76da09..af2006e7dc4a59c52874b0f2a3a0e4d2fb8922ed 100644 (file)
@@ -56,20 +56,6 @@ public:
     /** @see KUniqueApplication::newInstance(). */
     virtual int newInstance();
 
-    /**
-     * Find out if Dolphin is closed directly by the user or
-     * by the session manager because the session is closed
-     */
-    bool closedBySessionManager() const;
-
-    /**
-     * This virtual function is called by the session manager when
-     * it closes Dolphin. It is reimplemented to make the information
-     * if Dolphin is closed by the session manager or not accessible in
-     * DolphinMainWindow (via the function closedBySessionManager()).
-     */
-    virtual void commitData(QSessionManager& sessionManager);
-
 public slots:
     int openWindow(const KUrl& url);
     int openSplitWindow(const KUrl& leftUrl,const KUrl& rightUrl);
@@ -81,9 +67,6 @@ protected:
 private:
     QList<DolphinMainWindow*> m_mainWindows;
     int m_lastId;
-
-    /** Is true if Dolphin is closed by the session manager **/
-    bool m_closedBySessionManager;
 };
 
 #endif
index 6443494ef3c6fd0364e95a9927fbbd3479b998df..7e841cef396431a59381652a209d87915f722027 100644 (file)
@@ -430,7 +430,7 @@ void DolphinMainWindow::closeEvent(QCloseEvent* event)
     // by the session manager because the session is closed
     bool closedByUser = true;
     DolphinApplication *application = qobject_cast<DolphinApplication*>(qApp);
-    if (application && application->closedBySessionManager()) {
+    if (application && application->sessionSaving()) {
         closedByUser = false;
     }