Summary: | open folder - files shown in reverse order | ||
---|---|---|---|
Product: | [Applications] digikam | Reporter: | Steve <sodonald22> |
Component: | Showfoto-Directory | Assignee: | Digikam Developers <digikam-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | caulier.gilles |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 0.9.4 | |
Sentry Crash Report: | |||
Attachments: |
Patch to make the sort order configurable
Patch to make the sort order configurable, English improvements patch? |
Description
Steve
2007-07-06 10:34:01 UTC
Steve, Open Folder sorting file is harcoded in showfoto. Sorting is based on file date (more recent in first). It's can be trivial to add a new option in settings dialog. Beginner developpers, this task is for you (:=))) The code to patch in showfoto.cpp is in "void ShowFoto::openFolder(const KUrl& url)" where you have these lines : // Directory items sorting. Perhaps we need to add any settings in config dialog. dir.setFilter ( QDir::Files | QDir::NoSymLinks ); dir.setSorting ( QDir::Time ); Gilles > dir.setSorting ( QDir::Time );
Why not just use
dir.setSorting ( QDir::Time| QDir::Reversed );
?
Making this configurable seems not necessary to me.
Arnd
I agree Arnd, I don't think it really needs to be a settings option. I'd have a crack at it, but my C skills are only at the very beginning of their developing life... Hope someone out there could have a go at it, otherwise I'll give it a go once I've got a bit more experience under my belt. Personnaly, i always use current date order of file loaded in shwofoto. This is why i have implemented like this in source code. I vote to add a new option in config dialog to load files in Thummbbar using and order based on multiple options as file date, file name, and reverse. Gilles Created attachment 21079 [details]
Patch to make the sort order configurable
The attached patch implements new configuration options
in showfoto's settings to select between ordering according to
name/date/size and to reverse the ordering.
The default is to sort by increasing date.
Created attachment 21233 [details]
Patch to make the sort order configurable, English improvements
Compared to the previous patch, only the English corrections
by Clytie Siddall (Thanks!) are incorporated.
Further discussion in private mail with Giles (so that it
does not get lost):
Gilles: Currently, the patch fixes Open/Folder feature to order files in
thumbbar. This is not the only one issue : Open/File must be fixed in
this way, because more than one file can be loaded at the same time by
this option...
Arnd: One approach might be to introduce
in the Routine slotOpenFile() the usage of
QDir dir(url.path(), patterns),
where patterns is set to the full names of the file.
Afterwards, using the routines to sort via QDir's mechanisms
is possible.
Does this make sense, and sound like a good solution?
Gilles:
The standard way used is to use the void ShowFoto::applySettings() to
read settings from setup dialog (this method is called when you valid
setup dialog to update editor settings).
Store the setting in a common place to d private class like all others
settings are stored (for ex. d->deleteItem2Trash), and use these settings
where you want (slotOpenFile() or slotOpenFolder()). You can make a
common method to parse folder content accordinly with these settings.
Call this method at the right place...
Arnd, So, i can't said more (:=))). If your future patch respect these rules, well commit it on svn and close this file only when somebody has tested. Also, prepare your patch to be backported into KDE4 (trunk). The change will be minor normally... Gilles any chance to have it included in 0.7? SVN commit 787439 by cgilles: digiKam from KDE3 branch: Showfoto: apply patch from Arnd to a added 2 new options to set ordering of images when File/Open Folder action is used. BUG: 147600 M +45 -15 setup/setupeditor.cpp M +28 -3 showfoto.cpp SVN commit 787451 by cgilles: backport commit #787439 from KDE3 branch CCBUGS: 147600 M +36 -0 setup/setupeditor.cpp M +37 -12 showfoto.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=787451 Hmm actually this one doesn't seem to be fixed? When I uncheck "reverse order", images are sorted in a descend way. When I check "reverse", it is correct. Can anyone confirm? If so, I will re-open the bug. Created attachment 34827 [details]
patch?
Shouldn't the if statement be more like this?
If it work, fine for me... Gilles Ok I'm confused now :-) What is the correct sorting for Date? Right now we have: Name: Z->A (normal), A->Z (reverse).... WRONG! Size: large->small (normal, small->large (reverse).... WRONG? Date: old->new (normal), new->old (reverse)... RIGHT! I guess we want name and size sorting in a different way, right? Andi yes andi, in different way, if possible, but i think it's enough that current implementation must use date to display items in reverse order, not name. Gilles Caulier |