CVS commit by danimo: In-place renaming for groups, too. Can't really test since my icq plugin crashes on exit (seems unrelated to my changes) M +22 -0 kopetegroupviewitem.cpp 1.5 M +10 -0 kopetegroupviewitem.h 1.3 --- kdenonbeta/kopete/libkopete/ui/kopetegroupviewitem.cpp #1.4:1.5 @@ -67,4 +67,5 @@ void KopeteGroupViewItem::refreshDisplay } + m_renameText = text; // text= QStyleSheet::escape(text)+ " ("+QString::number(onl)+"/"+QString::number(tot)+")"; text= text +" ("+QString::number(onl)+"/"+QString::number(tot)+")"; @@ -79,4 +80,25 @@ QString KopeteGroupViewItem::key( int, b return "M"+text(0); } + +void KopeteGroupViewItem::startRename( int col ) +{ + setText(0, group()->displayName()); + QListViewItem::startRename(col); +} + +void KopeteGroupViewItem::okRename( int col ) +{ + QListViewItem::okRename(col); + if ( col == 0 ) + group()->setDisplayName(text(0)); + refreshDisplayName(); +} + +void KopeteGroupViewItem::cancelRename( int col ) +{ + QListViewItem::cancelRename(col); + refreshDisplayName(); +} + --- kdenonbeta/kopete/libkopete/ui/kopetegroupviewitem.h #1.2:1.3 @@ -39,4 +39,10 @@ public: {return m_group;}; + virtual void startRename(int col); + +protected: + virtual void okRename(int col); + virtual void cancelRename(int col); + private: @@ -42,5 +48,9 @@ private: KopeteGroup *m_group; + QString key( int column, bool ascending ) const; + + QString m_renameText; + public slots: void refreshDisplayName();