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

List:       kde-commits
Subject:    branches/extragear/kde3/network/konversation/src
From:       Eike Hein <hein () kde ! org>
Date:       2008-07-12 14:49:53
Message-ID: 1215874193.513960.28114.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 831370 by hein:

* Fix a possible race condition on manual StatusPanel close. Might
  address Debian bug #490226.
* Rejiggle the way ViewContainer cleanup is done after tab closes
  in response.
* Also happens to fix potentially dead pointers to chats being left 
  in the list used for the "Show Next Active View" shortcut on Sta-
  tusPanel close.
* And the "Close All Open Queries" action not being updated correct-
  ly when Query tabs are closed by way of closing a StatusPanel tab.


 M  +1 -1      commit.h  
 M  +1 -1      statuspanel.cpp  
 M  +27 -22    viewcontainer.cpp  
 M  +1 -0      viewcontainer.h  


--- branches/extragear/kde3/network/konversation/src/commit.h #831369:831370
@@ -1,4 +1,4 @@
 // This COMMIT number is added to version string to be used as "patch level"
 #ifndef COMMIT
-#define COMMIT 3236
+#define COMMIT 3237
 #endif
--- branches/extragear/kde3/network/konversation/src/statuspanel.cpp #831369:831370
@@ -288,7 +288,7 @@
         if (m_server->getServerGroup()) \
m_server->getServerGroup()->setNotificationsEnabled(notificationsEnabled());  \
m_server->quitServer();  // This will delete the status view as well.
-        delete m_server;
+        m_server->deleteLater();
         m_server = 0;
         return true;
     }
--- branches/extragear/kde3/network/konversation/src/viewcontainer.cpp #831369:831370
@@ -1175,6 +1175,7 @@
     connect(view, SIGNAL(setStatusBarTempText(const QString&)), this, \
                SIGNAL(setStatusBarTempText(const QString&)));
     connect(view, SIGNAL(clearStatusBarTempText()), this, \
                SIGNAL(clearStatusBarTempText()));
     connect(view, SIGNAL(closing(ChatWindow*)), this, \
SIGNAL(removeView(ChatWindow*))); +    connect(view, SIGNAL(closing(ChatWindow*)), \
this, SLOT(cleanupAfterClose(ChatWindow*)));  
     // Please be careful about changing any of the grouping behavior in here,
     // because it needs to match up with the sorting behavior of the tree list,
@@ -1520,10 +1521,8 @@
 {
     if (view)
     {
-        ChatWindow::WindowType viewType=view->getType();
+        ChatWindow::WindowType viewType = view->getType();
 
-        // the views should know by themselves how to close
-
         bool closeConfirmed = true;
 
         switch (viewType)
@@ -1541,36 +1540,43 @@
                 closeConfirmed = view->closeYourself();
                 break;
         }
+    }
+}
 
-        // We haven't done anything yet, so safe to return
-        if (!closeConfirmed) return;
+void ViewContainer::cleanupAfterClose(ChatWindow* view)
+{
+    if (view == m_frontView) m_frontView = 0;
 
-        if (view == m_frontView) m_frontView = 0;
-
-        // Remove the view from the active view list if it's still on it
-        QValueList<ChatWindow*>::iterator it = m_activeViewOrderList.find(view);
-
-        if (it != m_activeViewOrderList.end())
-            m_activeViewOrderList.remove(it);
-
+    if (m_tabWidget)
+    {
         m_tabWidget->removePage(view);
+        emit removeView(view);
 
-        if (viewType==ChatWindow::Query)
-            --m_queryViewCount;
-
-        if (m_queryViewCount == 0)
-            actionCollection()->action("close_queries")->setEnabled(false);
-
         if (m_tabWidget->count() <= 0)
         {
             m_saveSplitterSizesLock = true;
-            m_vbox->hide();//m_tabWidget->hide();
+            m_vbox->hide();
             emit resetStatusBar();
             emit setWindowCaption(QString::null);
         }
+
+        updateViewActions(m_tabWidget->currentPageIndex());
     }
 
-    updateViewActions(m_tabWidget->currentPageIndex());
+    // Remove the view from the active view list if it's still on it
+    QValueList<ChatWindow*>::iterator it = m_activeViewOrderList.find(view);
+
+    if (it != m_activeViewOrderList.end())
+        m_activeViewOrderList.remove(it);
+
+    if (view->getType() == ChatWindow::Query)
+        --m_queryViewCount;
+
+    if (m_queryViewCount == 0 && actionCollection())
+    {
+        KAction* action = actionCollection()->action("close_queries");
+        if (action) action->setEnabled(false);
+    }
 }
 
 void ViewContainer::closeViewMiddleClick(QWidget* view)
@@ -2031,7 +2037,6 @@
         m_dccPanelOpen=true;
         (dynamic_cast<KToggleAction*>(actionCollection()->action("open_dccstatus_window")))->setChecked(true);
  }
-    // FIXME newText(dccPanel,QString::null,true);
 }
 
 void ViewContainer::closeDccPanel()
--- branches/extragear/kde3/network/konversation/src/viewcontainer.h #831369:831370
@@ -94,6 +94,7 @@
         void closeView(ChatWindow* view);
         void closeViewMiddleClick(QWidget* view);
         void closeCurrentView();
+        void cleanupAfterClose(ChatWindow* view);
 
         void changeViewCharset(int index);
         void updateViewEncoding(ChatWindow* view);


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

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