Bug 149685 - Go to next photo after current photo deletion (vs. to previous photo)
Summary: Go to next photo after current photo deletion (vs. to previous photo)
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Showfoto-Workflow (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-09 05:54 UTC by Michael Moore
Modified: 2022-02-05 05:22 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 0.9.3
Sentry Crash Report:


Attachments
after delete, make the following image the current one (982 bytes, patch)
2007-09-09 17:04 UTC, Arnd Baecker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Moore 2007-09-09 05:54:46 UTC
Version:           0.6.0 (using KDE Devel)
Installed from:    Compiled sources

When I delete a photo, the photo disappears from thumbnail view, and the photo before the deleted photo is loaded. I believe it would be a more user friendly experience if instead the next photo in the sequence were loaded. 

Use Case:

Michael (me!) is sorting 700+ images for a client. He needs to weed out the poor shots and loves to use Showfoto because it's fast, has good shortcut keys, and has good basic image manipulation tools available. As he deletes files, he is directed back up the list of thumbnails to pictures he has already decided to keep, instead of to the next photo which he wishes to view and make a decision about. 

Thanks for considering this minor enhancement. It'll really make my day if one day I run updates and notice I don't have to press the down arrow after every single delete. :-) 

PS. We love ShowFoto. We run a wedding photography business, and have found DigiKam + ShowFoto to be the best way to manage our photos under Linux. They hold up to 1000s of pictures way better than the equivalent Mac tools we were using (iPhoto + Preview).
Comment 1 Arnd Baecker 2007-09-09 17:04:26 UTC
Created attachment 21567 [details]
after delete, make the following image the current one

The attached patch ensures that after a delete the following image
is made the current one (and not the previous).

Please test and report any problems.

Arnd
Comment 2 caulier.gilles 2007-09-09 18:33:03 UTC
Arnd,

The sound fine for me. But take a care than digiKam LT for with it. This is the second part which it thumbbar widget.

Gilles
Comment 3 Michael Moore 2007-09-09 18:35:49 UTC
Arnd, 

Thanks for such a quick response! 

The patch works beautifully. I tested it in the following situations so far: 

1) Deleting the first picture -- no problems
2) Deleting the last picture -- no problems
3) Deleting middle pictures -- no problems
4) Deleting all the pictures so there are none left -- no problems

I only spent a couple of minutes with it, but couldn't find any problems. Tomorrow evening I will have another large batch of photos to sort through and can do more testing if you'd like.

Thanks, 
Michael
Comment 4 caulier.gilles 2007-09-09 18:46:52 UTC
Arnd,

If your tests with LT are fien using this patch, well let's go.... apply the patch to KDE3 branch, i will backport it to KDE4 branch. It's always the same : CCBUGS + KDE4PORT annotation in commit (:=)))

Thanks in advance

Gilles
Comment 5 Arnd Baecker 2007-09-09 19:50:53 UTC
SVN commit 710344 by abaecker:

Deleting an image in showfotos thumbbar, the following image 
is made the selected one (and not the previous).
CCBUGS: 149685
TODO:KDE4PORT



 M  +2 -1      NEWS  
 M  +8 -0      showfoto/showfoto.cpp  


--- branches/extragear/kde3/graphics/digikam/NEWS #710343:710344
@@ -46,5 +46,6 @@
 032 ==> 146083 : Bugs in drag and drop.
 033 ==> 147854 : Put images into an emptied light-table
 034 ==> 149578 : libjpeg JPEG subsampling setting is not user-controlable.
-035 ==> 
+035 ==> 149685 : Go to next photo after current photo deletion (vs. to previous photo) 
+036 ==>
 
--- branches/extragear/kde3/graphics/digikam/showfoto/showfoto.cpp #710343:710344
@@ -1112,11 +1112,14 @@
     // No error, remove item in thumbbar.
 
     Digikam::ThumbBarItem *item2remove = d->currentItem;
+    Digikam::ThumbBarItem *nextItem = false;
 
     for (Digikam::ThumbBarItem *item = d->thumbBar->firstItem(); item; item = item->next())
     {
         if (item->url().equals(item2remove->url()))
         {
+            // Find item next to the current item
+            nextItem = item->next();
             d->thumbBar->removeItem(item);
             break;
         }
@@ -1136,6 +1139,11 @@
     }
     else
     {
+        // If there is an image after the deleted one, make that selected.
+        if (nextItem) 
+        {
+            d->thumbBar->setSelected(nextItem);
+        }
         d->currentItem = d->thumbBar->currentItem();
         slotOpenURL(d->currentItem->url());
     }
Comment 6 Arnd Baecker 2007-09-09 20:03:29 UTC
Michael,

thanks a lot for the detailled testing - this is very important!

Just in case: the new light-table in digikam allows
to select easily between several images
(however, there are some issues wrt removal of items; their
solution is work in progress ;-)

Best, Arnd
Comment 7 caulier.gilles 2007-09-09 22:15:37 UTC
SVN commit 710382 by cgilles:

backport commits #710344 to trunk. 
BUG: 149685


 M  +7 -0      showfoto.cpp  


--- trunk/extragear/graphics/digikam/showfoto/showfoto.cpp #710381:710382
@@ -1139,11 +1139,14 @@
     // No error, remove item in thumbbar.
 
     Digikam::ThumbBarItem *item2remove = d->currentItem;
+    Digikam::ThumbBarItem *nextItem    = 0;
 
     for (Digikam::ThumbBarItem *item = d->thumbBar->firstItem(); item; item = item->next())
     {
         if (item->url().equals(item2remove->url()))
         {
+            // Find item next to the current item
+            nextItem = item->next();
             d->thumbBar->removeItem(item);
             break;
         }
@@ -1163,6 +1166,10 @@
     }
     else
     {
+        // If there is an image after the deleted one, make that selected.
+        if (nextItem)
+            d->thumbBar->setSelected(nextItem);
+
         d->currentItem = d->thumbBar->currentItem();
         slotOpenURL(d->currentItem->url());
     }
Comment 8 Mikolaj Machowski 2007-09-09 22:19:05 UTC
As I just wrote your latest patch Arnd solved it. I hope this change
will not disrupt your hard work.