[Xfce4-commits] [xfce/xfce4-settings] 28/57: color: Sort the device list
noreply at xfce.org
noreply at xfce.org
Thu Mar 21 22:14:16 CET 2019
This is an automated email from the git hooks/post-receive script.
o c h o s i p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository xfce/xfce4-settings.
commit 83c4ab25aba5235b9777f014ecfe844e1e78033d
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date: Wed Feb 13 00:54:49 2019 +0100
color: Sort the device list
---
dialogs/color-settings/main.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/dialogs/color-settings/main.c b/dialogs/color-settings/main.c
index 8f69dfe..266d608 100644
--- a/dialogs/color-settings/main.c
+++ b/dialogs/color-settings/main.c
@@ -926,6 +926,22 @@ color_settings_device_removed_cb (CdClient *client,
+static gint
+color_settings_sort_func (GtkListBoxRow *a,
+ GtkListBoxRow *b,
+ gpointer user_data)
+{
+ const gchar *sort_a = NULL;
+ const gchar *sort_b = NULL;
+
+ sort_a = color_device_get_sortable (CC_COLOR_DEVICE (a));
+ sort_b = color_device_get_sortable (CC_COLOR_DEVICE (b));
+
+ return g_strcmp0 (sort_b, sort_a);
+}
+
+
+
static void
color_settings_get_devices_cb (GObject *object,
GAsyncResult *res,
@@ -1010,6 +1026,10 @@ color_settings_dialog_init (GtkBuilder *builder)
/* Devices ListBox */
settings->frame_devices = gtk_builder_get_object (builder, "frame-devices");
settings->list_box = GTK_LIST_BOX (gtk_list_box_new ());
+ gtk_list_box_set_sort_func (settings->list_box,
+ color_settings_sort_func,
+ settings,
+ NULL);
gtk_list_box_set_header_func (settings->list_box,
list_box_update_header_func,
settings, NULL);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list