Summary: | Sorting of albums other than alphabetically | ||
---|---|---|---|
Product: | [Applications] digikam | Reporter: | Chris Green <chris> |
Component: | Albums-Sort | Assignee: | Digikam Developers <digikam-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | CC: | caulier.gilles, EMuede, krienke, languitar |
Priority: | NOR | Flags: | languitar:
Junior_Jobs+
|
Version: | 0.9.2 | ||
Target Milestone: | --- | ||
Platform: | Fedora RPMs | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 4.3.0 | |
Sentry Crash Report: | |||
Attachments: | patch as in #c2 |
Description
Chris Green
2008-01-19 18:40:39 UTC
My ideal would be to sort albums by the album properties date in the folder view of albums. This would allow albums given month names (for example) to be shown in chronological order rather than alphabetical order as at present. As requested my patch to do this is as follows:- In albumfolderview.cpp, method AlbumFolderViewItem::compare(QListViewItem *i, int col, bool ascending):- Lines 215-218 were:- if (!m_groupItem || m_year == 0 || m_month == 0) { return QListViewItem::compare(i, col, ascending); } Change them to:- if (!m_groupItem || m_year == 0 || m_month == 0) { PAlbum * myalbum = album(); if (!myalbum) return 0; QDate myDate = myalbum->date(); AlbumFolderViewItem* thatItem = dynamic_cast<AlbumFolderViewItem*>(i); if (!thatItem) return 0; PAlbum * thatAlbum = thatItem->album(); if (!thatAlbum) return 0; QDate thatDate = thatAlbum->date(); if (myDate == thatDate) return 0; else if (myDate > thatDate) return 1; else return -1; } Obviously to make this switchable from original (alphabetical) sort to my new chrinological sort it needs a menu option and an if/else block to choose the new or old code. Created attachment 26034 [details]
patch as in #c2
The patch works fine for me (and: I really like that behaviour!!).
There is one additional thing: if the dates are equal, I would propose
to use the usual alphabetical sorting.
(The dates can be excatly equal, when one uses the GUI...)
Yes, that's a good point, and it would be very easy to do it. Looks like this would also be solved with porting to Qt4 model concept, or am I wrong? You are quite right. You have seen the ImageSortSettings class, same can be done for albums. With model/view, everything is nicely separated and can be more clearly implemented and shared. Sorting albums seems to be gone from the menu... have we removed this feature on purpose? Johannes, Marcel, What's new about album sorting and qt4 model/view ? Gilles Caulier *** Bug 189555 has been marked as a duplicate of this bug. *** I would like to have a different sort-order based upon the album-properties. Reason: I've many films digitized from 'analog' sources (dias, film-rolls), where i ordered an extra cd when the film was developed. Since i used a nikon (analog) the pictures (with exactly the same timestamp) are always numbered descending (imm_036 ... imm_001): so that import should be shown in descending order. Now there are many albums in the collection taken from digital sources with EXIF-data, which should be sorted ascending (by exif-time-field). Is it posibble to implement a default order (ascending) for each new created album while the existing albums remain -as they were- descending ? This property could be shown as a small icon in the folder-view Thanks for your time Ewald "View/Sort Albums/By Folder | By Categories | By Date" options have been re-implemented with 4.x series Gilles Caulier |