[devhelp/wip/swilmet/misc-improvements: 9/15] sidebar: better variable and function names for idles



commit 2b0f6fa8df500f948fd0e571555b4f0828ca7dc4
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Sun May 24 17:17:21 2015 +0200

    sidebar: better variable and function names for idles
    
    Add _id and _cb suffixes.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=749797

 src/dh-sidebar.c |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/src/dh-sidebar.c b/src/dh-sidebar.c
index f42ced3..5ad1a7e 100644
--- a/src/dh-sidebar.c
+++ b/src/dh-sidebar.c
@@ -43,8 +43,8 @@ typedef struct {
         GtkWidget      *sw_book_tree;
 
         GCompletion    *completion;
-        guint           idle_complete;
-        guint           idle_filter;
+        guint           idle_complete_id;
+        guint           idle_filter_id;
 } DhSidebarPrivate;
 
 enum {
@@ -64,7 +64,7 @@ G_DEFINE_TYPE_WITH_PRIVATE (DhSidebar, dh_sidebar, GTK_TYPE_BOX)
 /******************************************************************************/
 
 static gboolean
-sidebar_filter_idle (DhSidebar *sidebar)
+sidebar_filter_idle_cb (DhSidebar *sidebar)
 {
         DhSidebarPrivate *priv;
         const gchar *str;
@@ -73,7 +73,7 @@ sidebar_filter_idle (DhSidebar *sidebar)
 
         priv = dh_sidebar_get_instance_private (sidebar);
 
-        priv->idle_filter = 0;
+        priv->idle_filter_id = 0;
 
         str = gtk_entry_get_text (GTK_ENTRY (priv->entry));
 
@@ -95,9 +95,9 @@ sidebar_search_run_idle (DhSidebar *sidebar)
 {
         DhSidebarPrivate *priv = dh_sidebar_get_instance_private (sidebar);
 
-        if (!priv->idle_filter)
-                priv->idle_filter =
-                        g_idle_add ((GSourceFunc) sidebar_filter_idle, sidebar);
+        if (priv->idle_filter_id == 0)
+                priv->idle_filter_id =
+                        g_idle_add ((GSourceFunc) sidebar_filter_idle_cb, sidebar);
 }
 
 /******************************************************************************/
@@ -289,7 +289,7 @@ sidebar_entry_changed_cb (GtkEntry  *entry,
 }
 
 static gboolean
-sidebar_complete_idle (DhSidebar *sidebar)
+sidebar_complete_idle_cb (DhSidebar *sidebar)
 {
         DhSidebarPrivate *priv = dh_sidebar_get_instance_private (sidebar);
         const gchar  *str;
@@ -309,7 +309,7 @@ sidebar_complete_idle (DhSidebar *sidebar)
                 g_free (completed);
         }
 
-        priv->idle_complete = 0;
+        priv->idle_complete_id = 0;
 
         return G_SOURCE_REMOVE;
 }
@@ -323,9 +323,9 @@ sidebar_entry_text_inserted_cb (GtkEntry    *entry,
 {
         DhSidebarPrivate *priv = dh_sidebar_get_instance_private (sidebar);
 
-        if (!priv->idle_complete)
-                priv->idle_complete =
-                        g_idle_add ((GSourceFunc) sidebar_complete_idle, sidebar);
+        if (priv->idle_complete_id == 0)
+                priv->idle_complete_id =
+                        g_idle_add ((GSourceFunc) sidebar_complete_idle_cb, sidebar);
 }
 
 /******************************************************************************/


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