Summary: | Go to next photo after current photo deletion (vs. to previous photo) | ||
---|---|---|---|
Product: | [Applications] digikam | Reporter: | Michael Moore <Michael> |
Component: | Showfoto-Workflow | Assignee: | Digikam Developers <digikam-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | CC: | caulier.gilles |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 0.9.3 | |
Sentry Crash Report: | |||
Attachments: | after delete, make the following image the current one |
Description
Michael Moore
2007-09-09 05:54:46 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
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 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 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 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()); } 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 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()); } As I just wrote your latest patch Arnd solved it. I hope this change will not disrupt your hard work. |