[Digikam-users] Sort Album Tree by Album date (force/hack)?

Marcel Wiesweg marcel.wiesweg at gmx.de
Sun Mar 17 12:31:41 GMT 2013


> I've just started using digiKam on both my Ubuntu (2.8.0) and Windows
> (2.9.0) machines and find it great!
> 
> I would love have my folder tree sorted by date when using Album View, as
> mentioned possible here:
> http://docs.kde.org/development/en/extragear-graphics/digikam/using-kapp.htm
> l#using-myalbumsview
> 
> However, it seems the relevant menu item has been removed (
> https://bugs.kde.org/show_bug.cgi?id=227530).
> 
> Is there some way I get around that and hack something to get the folder
> tree under album view to be sorted by album date?

The task is not too difficult. Sorting is implemented in 
AlbumFilterModel::lessThan. This method does not need to be changed if the 
sort role is adjusted properly. For that, we'll need a special AlbumDateRole 
in AlbumModel, and a reimplementation of albumData for that class.
In the UI, DigikamView / leftsidebarwidgets need to set the sort role on the 
album model (from albummodelcollection) which is used for the left side bar.

Marcel



More information about the Digikam-users mailing list