Bug 102322 - wrong focus after renaming of image
Summary: wrong focus after renaming of image
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: AdvancedRename-dialog (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-23 23:15 UTC by Mikolaj Machowski
Modified: 2022-02-01 06:31 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 7.5.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mikolaj Machowski 2005-03-23 23:15:03 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
Compiler:          gcc3.4.3 
OS:                Linux

After renaming of image focus returns to first image in album making efficient keyboard navigation impossible.
Comment 1 Renchi Raju 2005-03-29 02:26:31 UTC
CVS commit by pahlibar: 



reselect the renamed item to make user life simpler
BUGS: 102322


  M +17 -3     albumiconview.cpp   1.111


--- kdeextragear-3/digikam/digikam/albumiconview.cpp  #1.110:1.111
@@ -163,4 +163,5 @@ public:
 
     bool                 inFocus;
+    QString              nextItemToSelect;
 };
 
@@ -407,4 +408,12 @@ void AlbumIconView::slotImageListerNewIt
     }
 
+    if (!d->nextItemToSelect.isEmpty())
+    {
+        ThumbItem* item = findItem(d->nextItemToSelect);
+        if (item)
+            item->setSelected(true);
+        d->nextItemToSelect = QString();
+    }
+    
     emit signalItemsAdded();
 }
@@ -748,6 +757,11 @@ void AlbumIconView::slotRename(AlbumIcon
         return;
 
-    AlbumFileCopyMove::rename(album, item->fileItem()->url().fileName(),
-                              newName);
+    if (!AlbumFileCopyMove::rename(album, item->fileItem()->url().fileName(),
+                                   newName))
+        return;
+
+    KURL newURL = item->fileItem()->url().upURL();
+    newURL.addPath(newName);
+    d->nextItemToSelect = newURL.url();
 
     if (d->currentAlbum && d->currentAlbum->type() == Album::TAG)