[gtk] filechooserwidget: Fold function into only caller



commit 39350278805ede7e9158d299f750d28487fea73c
Author: Timm Bäder <mail baedert org>
Date:   Fri Jul 19 10:14:54 2019 +0200

    filechooserwidget: Fold function into only caller

 gtk/gtkfilechooserwidget.c | 24 ++++++++++--------------
 1 file changed, 10 insertions(+), 14 deletions(-)
---
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c
index e70ef67750..db338115ce 100644
--- a/gtk/gtkfilechooserwidget.c
+++ b/gtk/gtkfilechooserwidget.c
@@ -2460,19 +2460,6 @@ location_changed_timeout_cb (gpointer user_data)
   return G_SOURCE_REMOVE;
 }
 
-static void
-reset_location_timeout (GtkFileChooserWidget *impl)
-{
-  GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl);
-
-  if (priv->location_changed_id > 0)
-    g_source_remove (priv->location_changed_id);
-  priv->location_changed_id = g_timeout_add (LOCATION_CHANGED_TIMEOUT,
-                                            location_changed_timeout_cb,
-                                            impl);
-  g_source_set_name_by_id (priv->location_changed_id, "[gtk] location_changed_timeout_cb");
-}
-
 static void
 location_entry_changed_cb (GtkEditable          *editable,
                            GtkFileChooserWidget *impl)
@@ -2489,7 +2476,16 @@ location_entry_changed_cb (GtkEditable          *editable,
     }
 
   if (priv->action != GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER)
-    reset_location_timeout (impl);
+    {
+      /* Reset location timeout */
+      if (priv->location_changed_id > 0)
+        g_source_remove (priv->location_changed_id);
+
+      priv->location_changed_id = g_timeout_add (LOCATION_CHANGED_TIMEOUT,
+                                                location_changed_timeout_cb,
+                                                impl);
+      g_source_set_name_by_id (priv->location_changed_id, "[gtk] location_changed_timeout_cb");
+    }
 }
 
 static void


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