Bug 93480 - When an existing feeds directory is renamed, change does not save
Summary: When an existing feeds directory is renamed, change does not save
Status: RESOLVED FIXED
Alias: None
Product: akregator
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-18 00:34 UTC by Matej Pivoluska
Modified: 2005-06-28 08:32 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matej Pivoluska 2004-11-18 00:34:34 UTC
Version:           1.0-beta7 "Lippel" (using KDE 3.3.1,  (3.1))
Compiler:          gcc version 3.3.5 (Debian 1:3.3.5-2)
OS:                Linux (i686) release 2.6.8-1-k7

When I rename an existing directory, this change is not saved and after Quit and/or reboot of KDE I see the old name of this directory.
Comment 1 Teemu Rytilahti 2004-11-18 14:43:32 UTC
At least I can't confirm this. The new name is saved fine when I close my aKregator just after the change...
Comment 2 Frank Osterfeld 2004-11-18 15:08:24 UTC
I can confirm this for beta7, it's fixed in CVS.
Comment 3 Frank Osterfeld 2005-06-28 08:32:41 UTC
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);