[gnome-games] developer-list-item: Add compare function



commit 89170a85607c632f4ac0afb7409301729e44e850
Author: theawless <theawless gmail com>
Date:   Sun Aug 26 09:38:24 2018 +0530

    developer-list-item: Add compare function
    
    DevelopersView shouldn't know whether DeveloperListItem contains a label
    or something else.

 src/ui/developer-list-item.vala | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/src/ui/developer-list-item.vala b/src/ui/developer-list-item.vala
index 7a2ab72a..e5a20c4d 100644
--- a/src/ui/developer-list-item.vala
+++ b/src/ui/developer-list-item.vala
@@ -18,4 +18,8 @@ private class Games.DeveloperListItem: Gtk.Label {
                var val = developer.get_developer ();
                label = val == "" ? _("Unknown") : val;
        }
+
+       public static int compare (DeveloperListItem a, DeveloperListItem b) {
+               return a.developer.get_developer ().collate (b.developer.get_developer ());
+       }
 }


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