[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/3.5/kdebase/kicker/libkicker
From:       Aaron J. Seigo <aseigo () kde ! org>
Date:       2005-12-29 19:11:55
Message-ID: 1135883515.124185.10600.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 492376 by aseigo:

since we may get deleted while the popup is showing, we must not do
anything after the exec() call. instead we connect to it's aboutToHide()
signal and do whatever cleanup is necessary in that slot
BUG:119192


 M  +17 -2     panelbutton.cpp  
 M  +3 -0      panelbutton.h  


--- branches/KDE/3.5/kdebase/kicker/libkicker/panelbutton.cpp #492375:492376
@@ -849,13 +849,15 @@
     if (m_popup)
     {
         m_popup->removeEventFilter(this);
+        disconnect(m_popup, SIGNAL(aboutToHide()), this, SLOT(menuAboutToHide()));
     }
 
     m_popup = popup;
 
-    if (popup)
+    if (m_popup)
     {
         m_popup->installEventFilter(this);
+        connect(m_popup, SIGNAL(aboutToHide()), this, SLOT(menuAboutToHide()));
     }
 }
 
@@ -906,7 +908,11 @@
 {
     if (isDown())
     {
-        m_popup->hide();
+        if (m_popup)
+        {
+            m_popup->hide();
+        }
+
         setDown(false);
         return;
     }
@@ -935,6 +941,15 @@
 
     m_popup->adjustSize();
     m_popup->exec(KickerLib::popupPosition(popupDirection(), m_popup, this));
+}
+
+void PanelPopupButton::menuAboutToHide()
+{
+    if (!m_popup)
+    {
+        return;
+    }
+
     setDown(false);
     KickerTip::enableTipping(true);
 }
--- branches/KDE/3.5/kdebase/kicker/libkicker/panelbutton.h #492375:492376
@@ -456,6 +456,9 @@
      */
     virtual void slotExecMenu();
 
+private slots:
+    void menuAboutToHide();
+
 private:
     QPopupMenu *m_popup;
     bool m_pressedDuringPopup;
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic