[gnome-games/wip/exalm/platform-preferences: 38/65] platform: Add compare()
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/wip/exalm/platform-preferences: 38/65] platform: Add compare()
- Date: Mon, 11 Feb 2019 16:28:25 +0000 (UTC)
commit 21893dfcca9183cf1d86e066c54381dfee1ae168
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date: Tue Aug 7 21:00:11 2018 +0500
platform: Add compare()
Platforms will have to be sorted by name, hence add a compare() function.
src/core/platform.vala | 4 ++++
1 file changed, 4 insertions(+)
---
diff --git a/src/core/platform.vala b/src/core/platform.vala
index 1077f3be..9d907872 100644
--- a/src/core/platform.vala
+++ b/src/core/platform.vala
@@ -12,4 +12,8 @@ public interface Games.Platform : Object {
public static bool equal (Platform a, Platform b) {
return a == b || str_equal (a.get_id (), b.get_id ());
}
+
+ public static int compare (Platform a, Platform b) {
+ return a.get_name ().collate (b.get_name ());
+ }
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]