[Konversation-devel] [Bug 100432] closing by CTRL+W crashes when no tabs are open

Peter Simonsson peter.simonsson at gmail.com
Thu Jul 1 15:59:58 CEST 2010


https://bugs.kde.org/show_bug.cgi?id=100432





--- Comment #2 from Peter Simonsson <peter simonsson gmail com>  2010-07-01 15:59:56 ---
commit ebbdf541276ff0855d5b1003c6c11bf04266dde9
Author: Peter Simonsson <peter.simonsson at gmail.com>
Date:   Mon Feb 28 13:17:34 2005 +0000

    Don't crash when trying to close tabs that doesn't exist
    BUG:100432

    svn path=/trunk/kdeextragear-2/konversation/; revision=393786

diff --git a/konversation/ledtabwidget.cpp b/konversation/ledtabwidget.cpp
index 755d0a9..507bcd4 100644
--- a/konversation/ledtabwidget.cpp
+++ b/konversation/ledtabwidget.cpp
@@ -152,11 +152,17 @@ void LedTabWidget::moveTabToIndex(int oldIndex,int
newIndex)
 void LedTabWidget::tabClosed(int id)
 {
   //  if id is -1 then get identifier for currently visible tab
-  if(id==-1) id=tabBar()->tab(tabBar()->currentTab())->identifier();
+  if(id == -1) {
+    id = tabBar()->currentTab();
+  }

-  LedTab* tab=tabBar()->tab(id);
-  if(tab==0) kdWarning() << "LedTabWidget::closeTab(): tab==0!" << endl;
-  else emit closeTab(tab->getWidget());
+  LedTab* tab = tabBar()->tab(id);
+
+  if(tab == 0) {
+    kdWarning() << "LedTabWidget::closeTab(): tab == 0!" << endl;
+  } else {
+    emit closeTab(tab->getWidget());
+  }
 }

 void LedTabWidget::tabClosed()

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Konversation-devel mailing list