[Digikam-users] More questions about sort order in folders

Chris G cl at isbd.net
Wed Jul 9 20:07:09 BST 2008

On Tue, Jul 08, 2008 at 07:38:32PM +0200, Arnd Baecker wrote:
> >
> > Where does the actual sorting take place?  I.e. when it's set to sort
> > "By Folder" who/what/where does the alphabetic sort take place?  I
> > want to dive in and change the sort for "View-Sort Albums-By Folder"
> > so that I can have the folder hierarchy with a different sort order.
> >
> > If I find I can change the code fairly easily to do what I want then I
> > might even get clever and add the required extra menu items.  It needs
> > really to be a sub-menu which appears when you select "View-Sort Albums-By
> > Folder" to allow changing to different sort orders within the original
> > albums/folders.
> After a second look at the code, it seems that I was a bit too fast
> with pointing my fingers at this bit of code...
> If I understand things correctly,
> the actual sorting is in the end done by QListView:
> Namely, AlbumFolderView inherits from FolderView
> which in turn inherits from QListView.
> To sort according to something else, one may either
> change the returned key for each item
> http://doc.trolltech.com/3.3/qlistviewitem.html#key
> or modify the compare function
> http://doc.trolltech.com/3.3/qlistviewitem.html#compare
> It seems that
> int AlbumFolderViewItem::compare(QListViewItem *i, int col, bool
> ascending)
> does already something like this.
> So maybe this, together with the corresponding QListViewItem
> needs to be extended?
OK, thanks, that looks more like the right[ish] place, I'll do some
digging around and see if I can understand it.

> Gilles, does this sound like the right approach?
> > (I am actually a C/C++ programmer, it's been my job since the early
> > 1980s)
> Oh, that's brilliant (then you do know C++ much better than me ;-)!

I work on Sun Solaris systems, mostly on legacy code written in C and
C++ but also some Java.  I'm only working part-time now as I approach
retirement (I'm 61).

> Help with the code is always very welcome and I am sure
> that your expertise will be valuable.
> Note that Gilles is always extremely helpful in explaining the
> whereabouts in the code (either via the mailing list or via IRC).
Thanks for the pointers, as I said I'll dig around a bit and probably
come back with more questions soon.

Chris Green

More information about the Digikam-users mailing list