[gnome-boxes] media-manager: Invert release-date based sorting



commit 3469fe93098fc5f7a5bcbbf2884915888bb49976
Author: Visarion Alexandru <viorel visarion gmail com>
Date:   Tue Apr 19 20:20:39 2016 +0300

    media-manager: Invert release-date based sorting
    
    We were sorting media in chronological order rather than in (intended)
    reverse-chronological order.
    
    Co-author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=691790

 src/media-manager.vala |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/media-manager.vala b/src/media-manager.vala
index 0c7f419..52c94a7 100644
--- a/src/media-manager.vala
+++ b/src/media-manager.vala
@@ -198,9 +198,9 @@ private class Boxes.MediaManager : Object {
             if (media_b.os == null)
                 return 0;
             else
-                return 1;
+                return -1;
         } else if (media_b.os == null)
-            return -1;
+            return 1;
         else {
             var release_a = media_a.os.get_release_date ();
             var release_b = media_b.os.get_release_date ();
@@ -209,11 +209,11 @@ private class Boxes.MediaManager : Object {
                 if (release_b == null)
                     return 0;
                 else
-                    return 1;
+                    return -1;
             } else if (release_b == null)
-                return -1;
+                return 1;
             else
-                return release_a.compare (release_b);
+                return -release_a.compare (release_b);
         }
     }
 


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