[Xfce4-commits] [xfce/xfce4-settings] 29/37: color: Sort the device list

noreply at xfce.org noreply at xfce.org
Fri Feb 15 00:27:58 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       o   c   h   o   s   i   /   c   o   l   o   r   d   
   in repository xfce/xfce4-settings.

commit f5c0ad4b36a5369e764ade2b0aee82ca608aad71
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