Summary: | KHotKeys crashes after "ticking" it to manipulate a nonexistant target window | ||
---|---|---|---|
Product: | [Plasma] khotkeys | Reporter: | Marius <mariusst> |
Component: | general | Assignee: | Lubos Lunak <l.lunak> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | Vivien_Mallet |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Ubuntu | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
Marius
2005-10-26 12:50:19 UTC
The "ticking" in the title should be "tricking" and the "left" in "2. Click on that action to open it in the left view." should be "right" sry :) Still happends in kde 3.5.5 The crash happends because there is no checking when changing actions of whether these buttons should be enabled or not *** Bug 101680 has been marked as a duplicate of this bug. *** SVN commit 629444 by lunakl: Avoid various braindamage when deleting condition objects. BUG: 139962 BUG: 115109 M +11 -7 kcontrol/condition_list_widget.cpp M +10 -0 shared/conditions.cpp M +0 -6 shared/conditions.h M +1 -1 shared/khlistview.cpp --- branches/KDE/3.5/kdebase/khotkeys/kcontrol/condition_list_widget.cpp #629443:629444 @@ -84,8 +84,8 @@ void Condition_list_widget::clear_data() { comment_lineedit->clear(); + conditions.clear(); conditions_listview->clear(); - conditions.clear(); } void Condition_list_widget::set_data( const Condition_list* data_P ) @@ -96,8 +96,8 @@ return; } comment_lineedit->setText( data_P->comment()); + conditions.clear(); conditions_listview->clear(); - conditions.clear(); insert_listview_items( data_P, conditions_listview, NULL ); #ifdef KHOTKEYS_DEBUG kdDebug( 1217 ) << "Condition_list_widget::set_data():" << endl; @@ -278,12 +278,14 @@ if( parent1_P == NULL ) { parent2_P->setOpen( true ); - conditions.append( new_cond ); // we own it, not the listview + if( new_cond->parent() == NULL ) // own only toplevels, they own the rest + conditions.append( new_cond ); // we own it, not the listview return new Condition_list_item( parent2_P, after_P, new_cond ); } else { - conditions.append( new_cond ); // we own it, not the listview + if( new_cond->parent() == NULL ) + conditions.append( new_cond ); // we own it, not the listview return new Condition_list_item( parent1_P, after_P, new_cond ); } } @@ -312,9 +314,11 @@ Condition* old_cond = item_P->condition(); item_P->set_condition( new_condition ); int pos = conditions.find( old_cond ); - assert( pos >= 0 ); - conditions.remove( pos ); // we own it - conditions.insert( pos, new_condition ); + if( pos >= 0 ) + { + conditions.remove( pos ); // we own it + conditions.insert( pos, new_condition ); + } item_P->widthChanged( 0 ); conditions_listview->repaintItem( item_P ); } --- branches/KDE/3.5/kdebase/khotkeys/shared/conditions.cpp #629443:629444 @@ -133,6 +133,16 @@ cfg_P.setGroup( save_cfg_group ); } +Condition_list_base::~Condition_list_base() + { + while( !isEmpty()) + { + Condition* c = getFirst(); + remove( c ); + delete c; + } + } + void Condition_list_base::cfg_write( KConfig& cfg_P ) const { QString save_cfg_group = cfg_P.group(); --- branches/KDE/3.5/kdebase/khotkeys/shared/conditions.h #629443:629444 @@ -213,12 +213,6 @@ { } -inline -Condition_list_base::~Condition_list_base() - { - setAutoDelete( true ); - } - // Condition_list inline --- branches/KDE/3.5/kdebase/khotkeys/shared/khlistview.cpp #629443:629444 @@ -96,8 +96,8 @@ void KHListView::clearSelection() { - saved_current_item = NULL; KListView::clearSelection(); + slot_current_changed( currentItem()); } // items are often inserted using the QListViewItem constructor, |