Version: (using KDE KDE 3.3.2) Installed from: Compiled From Sources Compiler: gcc 3.4.3 OS: Linux Currently it is impossible to rename folders via the kontact plugin as changes are not saved - restarting Kontact and adding a feed will undo the changes made.
Weird, most of the time it works here, but not always. The function which saves the list is called in all cases though.
CVS commit by osterfeld: don't break in-place renaming BUG: 96669 M +12 -4 feedstree.cpp 1.44 M +1 -1 feedstree.h 1.22 --- kdepim/akregator/src/feedstree.h #1.21:1.22 @@ -148,5 +148,5 @@ namespace Akregator virtual void slotSelectionChanged(QListViewItem* item); virtual void slotContextMenu(KListView* list, QListViewItem* item, const QPoint& p); - virtual void slotItemRenamed(QListViewItem* item); + virtual void slotItemRenamed(QListViewItem* item, const QString&, int); virtual void slotFeedFetchStarted(Feed* feed); virtual void slotFeedFetchAborted(Feed* feed); --- kdepim/akregator/src/feedstree.cpp #1.43:1.44 @@ -51,5 +51,5 @@ FeedsTree::FeedsTree( QWidget *parent, c connect( this, SIGNAL(dropped(QDropEvent*,QListViewItem*)), this, SLOT(slotDropped(QDropEvent*,QListViewItem*)) ); connect( this, SIGNAL(selectionChanged(QListViewItem*)), this, SLOT(slotSelectionChanged(QListViewItem*)) ); - connect( this, SIGNAL(itemRenamed(QListViewItem*)), this, SLOT(slotItemRenamed(QListViewItem*)) ); + connect( this, SIGNAL(itemRenamed(QListViewItem*, const QString&, int)), this, SLOT(slotItemRenamed(QListViewItem*, const QString&, int)) ); connect( this, SIGNAL(contextMenu(KListView*, QListViewItem*, const QPoint&)), this, SLOT(slotContextMenu(KListView*, QListViewItem*, const QPoint&)) ); @@ -245,4 +245,8 @@ void FeedsTree::movableDropEvent(QListVi void FeedsTree::keyPressEvent(QKeyEvent* e) { + // handle return in in-place renaming, otherwise ignore events + if (isRenaming() && e->key() == Qt::Key_Enter) + KListView::keyPressEvent(e); + else e->ignore(); } @@ -509,9 +513,13 @@ void FeedsTree::slotSelectionChanged(QLi } -void FeedsTree::slotItemRenamed(QListViewItem* item) +void FeedsTree::slotItemRenamed(QListViewItem* item, const QString& text, int) { + kdDebug() << "FeedsTree::slotItemRenamed(): enter" << endl; TreeNodeItem* ni = static_cast<TreeNodeItem*> (item); if ( ni && ni->node() ) - ni->node()->setTitle( item->text(0) ); + { + kdDebug() << "renamed item to \"" << text << "\"" << endl; + ni->node()->setTitle(text); + } }
SVN commit 429576 by osterfeld: fix in-place renaming by connecting to both QListView::itemRenamed(QLI*, col, QString) and KListView::itemRenamed(QLI*, QString, col) signals The QListView version works for folders and feeds, the KListView version works for Tag nodes. super strange BUG: 102099 CCBUG: 96669, 93480 M +14 -27 feedlistview.cpp M +2 -1 feedlistview.h --- trunk/KDE/kdepim/akregator/src/feedlistview.cpp #429575:429576 @@ -267,6 +267,7 @@ connect( this, SIGNAL(dropped(QDropEvent*,QListViewItem*)), this, SLOT(slotDropped(QDropEvent*,QListViewItem*)) ); connect( this, SIGNAL(selectionChanged(QListViewItem*)), this, SLOT(slotSelectionChanged(QListViewItem*)) ); + connect( this, SIGNAL(itemRenamed(QListViewItem*, int, const QString&)), this, SLOT(slotItemRenamed(QListViewItem*, int, const QString&)) ); connect( this, SIGNAL(itemRenamed(QListViewItem*, const QString&, int)), this, SLOT(slotItemRenamed(QListViewItem*, const QString&, int)) ); connect( this, SIGNAL(contextMenu(KListView*, QListViewItem*, const QPoint&)), this, SLOT(slotContextMenu(KListView*, QListViewItem*, const QPoint&)) ); connect( &(d->autoopentimer), SIGNAL( timeout() ), this, SLOT( openFolder() ) ); @@ -558,28 +559,6 @@ KListView::contentsDragMoveEvent(event); } -/* -void FeedListView::keyPressEvent(QKeyEvent* e) -{ - switch(e->key()) - { - case Key_Alt+Key_Up: - case Key_Alt+Key_Down: - case Key_Alt+Key_Left: - case Key_Alt+Key_Right: - KListView::keyPressEvent(e); - break; - case Key_Left: - case Key_Right: - case Key_Up: - case Key_Down: - e->ignore(); - break; - default: - KListView::keyPressEvent(e); - } -}*/ - bool FeedListView::acceptDrag(QDropEvent *e) const { if (!acceptDrops() || !itemsMovable()) @@ -815,16 +794,24 @@ emit signalNodeSelected(ni->node()); } -void FeedListView::slotItemRenamed(QListViewItem* item, const QString& text, int) +void FeedListView::slotItemRenamed(QListViewItem* item, int col, const QString& text) { - kdDebug() << "FeedListView::slotItemRenamed(): enter" << endl; TreeNodeItem* ni = dynamic_cast<TreeNodeItem*> (item); - if ( ni && ni->node() ) + if ( !ni || !ni->node() ) + return; + if (col == 0) { - kdDebug() << "renamed item to \"" << text << "\"" << endl; - ni->node()->setTitle(text); + if (text != ni->node()->title()) + { + kdDebug() << "renamed item to \"" << text << "\"" << endl; + ni->node()->setTitle(text); + } } } +void FeedListView::slotItemRenamed(QListViewItem* item, const QString& text, int col) +{ + slotItemRenamed(item, col, text); +} void FeedListView::slotContextMenu(KListView* list, QListViewItem* item, const QPoint& p) { --- trunk/KDE/kdepim/akregator/src/feedlistview.h #429575:429576 @@ -164,7 +164,8 @@ virtual void slotSelectionChanged(QListViewItem* item); virtual void slotContextMenu(KListView* list, QListViewItem* item, const QPoint& p); - virtual void slotItemRenamed(QListViewItem* item, const QString&, int); + virtual void slotItemRenamed(QListViewItem* item, int col, const QString& text); + virtual void slotItemRenamed(QListViewItem* item, const QString& text, int col); virtual void slotFeedFetchStarted(Feed* feed); virtual void slotFeedFetchAborted(Feed* feed); virtual void slotFeedFetchError(Feed* feed);