[gnome-boxes/gnome-3-8] Fix sorting of boxes that were never accessed



commit 88255db226879a253d6591a8a2892235ad115911
Author: Christophe Fergeau <cfergeau redhat com>
Date:   Tue May 14 13:42:06 2013 +0200

    Fix sorting of boxes that were never accessed
    
    Currently, the comparison function only takes into account
    access_last_time if it's set for both boxes. If one of them has it
    unset, it falls back to using name comparison to sort the boxes.
    
    This means if the user has a box called 'A' and one called 'B', A
    having never been used and B being regularly used, A will always
    be sorted before B regardless of their access_last_time fields.
    
    This commit ensures that boxes which have their access_last_time field
    set are always sorted before the boxes which don't have it set.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=700284

 src/box-config.vala |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/box-config.vala b/src/box-config.vala
index a8194c6..edb9aee 100644
--- a/src/box-config.vala
+++ b/src/box-config.vala
@@ -192,7 +192,7 @@ public class Boxes.BoxConfig: GLib.Object, Boxes.IConfig {
             return 1;
 
         // then by last time used
-        if (access_last_time > 0 && other.access_last_time > 0) {
+        if (access_last_time > 0 || other.access_last_time > 0) {
             if (access_last_time > other.access_last_time)
                 return -1;
             else if (access_last_time < other.access_last_time)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]