Summary: | closing by CTRL+W crashes when no tabs are open | ||
---|---|---|---|
Product: | [Applications] konversation | Reporter: | Mike Massonnet <mike.massonnet> |
Component: | general | Assignee: | Konversation Developers <konversation-devel> |
Status: | RESOLVED FIXED | ||
Severity: | crash | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
Mike Massonnet
2005-02-28 12:53:46 UTC
CVS commit by psn: Don't crash when trying to close tabs that doesn't exist BUG:100432 M +10 -4 ledtabwidget.cpp 1.37 --- kdeextragear-2/konversation/konversation/ledtabwidget.cpp #1.36:1.37 @@ -153,9 +153,15 @@ 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()); + } } commit ebbdf541276ff0855d5b1003c6c11bf04266dde9 Author: Peter Simonsson <peter.simonsson@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() |