GNOME Bugzilla – Bug 691800
Sort pictures by date
Last modified: 2013-03-01 11:32:14 UTC
It would be good if when selecting the Pictures folder for the wallpaper chooser it was sorted by date instead of alphabetical. Most of my pictures have pretty useless file names. If this is agreed I can write a patch for this.
Created attachment 234383 [details] [review] Sort background pictures by most recent bug confirmed by jimmac. Patch attached.
Review of attachment 234383 [details] [review]: Looks good otherwise. ::: panels/background/cc-background-item.c @@ +51,3 @@ gboolean needs_download; CcBackgroundItemFlags flags; + guint modified; Why store a uint64 in a guint?
Created attachment 234606 [details] [review] background-Sort-Pictures-in-order-of-most-recently fixup Thanks for the review.
Review of attachment 234606 [details] [review]: Looks good, though I would have sorted by date and then by name, but the likelihood of having 2 files with the same mtime is pretty small.
Created attachment 235093 [details] [review] background: Offload the sorting of the initial list of files We can offload some of the work of the initial sorting by sorting the list of files before they're added to the icon view
Additional patch to improve performance
(In reply to comment #6) > Additional patch to improve performance You could have created a new bug about this. You'll need to check whether it conflicts with the patch from bug 693506 which removes the use of a GtkIconView.
The patches in #693506 applied cleanly, apologise for not opening a new bug, I can do so if that would still be useful.
Review of attachment 235093 [details] [review]: Looks good otherwise. ::: panels/background/bg-pictures-source.c @@ +291,3 @@ /* create a new CcBackgroundItem */ uri = g_file_get_uri (file); + mtime = same line, I have a wide monitor. @@ +384,3 @@ + guint64 modified_a, modified_b; + + modified_a = Ditto. @@ +388,3 @@ + G_FILE_ATTRIBUTE_TIME_MODIFIED); + + modified_b = Ditto. @@ +536,3 @@ + + gtk_tree_model_get (model, a, + 1, &item_a, Need to use symbolic names for the column numbers. @@ +539,3 @@ + -1); + gtk_tree_model_get (model, b, + 1, &item_b, Ditto. @@ +594,3 @@ + + gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (store), + 1, Ditto.
Created attachment 236770 [details] [review] background: Offload the sorting of the initial list of files Updated style changes
Review of attachment 236770 [details] [review]: Looks fine.
Attachment 236770 [details] pushed as 09baf81 - background: Offload the sorting of the initial list of files