[Digikam-devel] [Bug 307223] group selected by time not grouping one pair per album

Marcel Wiesweg marcel.wiesweg at gmx.de
Sun Nov 4 11:00:58 GMT 2012


https://bugs.kde.org/show_bug.cgi?id=307223

--- Comment #12 from Marcel Wiesweg <marcel.wiesweg at gmx.de> ---
Marek, thanks for your precise analysis.
Smit, look at DigikamImageView::createGroupByTimeFromSelection(), first line:
    QList<ImageInfo> selectedInfos = selectedImageInfosCurrentFirst();

"CurrentFirst" -> current info is prepended in the list, thus out of order. Can
be replaced by the more simple selectedImageInfos().
Why is that a problem at all? The algorithm is simple, but seems to imply that
the infos are sorted by date, which is often the case, but in no way
guaranteed. Easiest way to fix is to qSort() the list with a custom lessThan
method which sorts by date/time.
When it comes to nit-picking optimization, an algorithm which only iterates (by
incrementing index or iterator) without editing the list (takeFirst) will be
slightly more efficient.

-- 
You are receiving this mail because:
You are the assignee for the bug.



More information about the Digikam-devel mailing list