Version: 0.8.922 (CVS >= 20040717) (using KDE 3.2.92 (3.3 beta2), compiled sources) Compiler: gcc version 3.3.4 (Debian 1:3.3.4-3) OS: Linux (i686) release 2.6.5 If you rename a contact, it stays at the same position in the contact list even though it should move to another when the contact list is alphabetically sorted. It's handy from a usability point of view (the contact doesn't suddenly pop up at a different spot), Konqueror for example doesn't resort the list of files as well after having renamed an entry. Still, it might have to be changed.
CVS commit by lilachaze: Fixed a bug where renaming a metacontact would not resort the contact list. Rearranged code to ensure names in the contact list and in the contact list view stay in sync. Matt: can you please backport this too? CCMAIL: 86783@bugs.kde.org CCMAIL: matt@matt.rogers.name M +2 -5 kopetegroupviewitem.cpp 1.30 M +7 -6 kopetemetacontactlvi.cpp 1.90 --- kdenetwork/kopete/kopete/contactlist/kopetegroupviewitem.cpp #1.29:1.30 @@ -167,5 +167,5 @@ void KopeteGroupViewItem::refreshDisplay // the sorting itself is rather slow. Therefore we call delayedSort, which tries // to group multiple sort requests into one. - if ( KopeteContactListView *lv = dynamic_cast<KopeteContactListView *>( listView() ) ) + if ( ListView::ListView *lv = dynamic_cast<ListView::ListView *>( listView() ) ) lv->delayedSort(); else @@ -192,8 +192,5 @@ void KopeteGroupViewItem::okRename( int //kdDebug(14000) << k_funcinfo << endl; KListViewItem::okRename(col); - if ( col == 0 ) - group()->setDisplayName(text(0)); setRenameEnabled( 0, false ); - refreshDisplayName(); } @@ -267,5 +264,5 @@ void KopeteGroupViewItem::setText( int c { if ( column == 0 ) - d->name->setText( text ); + group()->setDisplayName( text ); else KListViewItem::setText( column, text ); --- kdenetwork/kopete/kopete/contactlist/kopetemetacontactlvi.cpp #1.89:1.90 @@ -435,4 +435,10 @@ void KopeteMetaContactLVI::slotDisplayNa { d->nameText->setText( m_metaContact->displayName() ); + + // delay the sort if we can + if ( ListView::ListView *lv = dynamic_cast<ListView::ListView *>( listView() ) ) + lv->delayedSort(); + else + listView()->sort(); } @@ -469,5 +475,4 @@ void KopeteMetaContactLVI::okRename( int { KListViewItem::okRename( col ); - rename( text( 0 ) ); setRenameEnabled( 0, false ); } @@ -894,5 +899,5 @@ void KopeteMetaContactLVI::setText( int { if ( column == 0 ) - d->nameText->setText( text ); + rename( text ); else KListViewItem::setText( column, text );
CVS commit by mattr: Backport the fix for 86783. Should be in KDE 3.3.1 CCMAIL: 86783-done@bugs.kde.org M +2 -5 kopetegroupviewitem.cpp 1.29.2.1 M +7 -6 kopetemetacontactlvi.cpp 1.89.2.1 --- kdenetwork/kopete/kopete/contactlist/kopetegroupviewitem.cpp #1.29:1.29.2.1 @@ -167,5 +167,5 @@ void KopeteGroupViewItem::refreshDisplay // the sorting itself is rather slow. Therefore we call delayedSort, which tries // to group multiple sort requests into one. - if ( KopeteContactListView *lv = dynamic_cast<KopeteContactListView *>( listView() ) ) + if ( ListView::ListView *lv = dynamic_cast<ListView::ListView *>( listView() ) ) lv->delayedSort(); else @@ -192,8 +192,5 @@ void KopeteGroupViewItem::okRename( int //kdDebug(14000) << k_funcinfo << endl; KListViewItem::okRename(col); - if ( col == 0 ) - group()->setDisplayName(text(0)); setRenameEnabled( 0, false ); - refreshDisplayName(); } @@ -267,5 +264,5 @@ void KopeteGroupViewItem::setText( int c { if ( column == 0 ) - d->name->setText( text ); + group()->setDisplayName( text ); else KListViewItem::setText( column, text ); --- kdenetwork/kopete/kopete/contactlist/kopetemetacontactlvi.cpp #1.89:1.89.2.1 @@ -435,4 +435,10 @@ void KopeteMetaContactLVI::slotDisplayNa { d->nameText->setText( m_metaContact->displayName() ); + + // delay the sort if we can + if ( ListView::ListView *lv = dynamic_cast<ListView::ListView *>( listView() ) ) + lv->delayedSort(); + else + listView()->sort(); } @@ -469,5 +475,4 @@ void KopeteMetaContactLVI::okRename( int { KListViewItem::okRename( col ); - rename( text( 0 ) ); setRenameEnabled( 0, false ); } @@ -894,5 +899,5 @@ void KopeteMetaContactLVI::setText( int { if ( column == 0 ) - d->nameText->setText( text ); + rename( text ); else KListViewItem::setText( column, text );