[gedit] Inline a function



commit 1b840093852af4e02b4a725390a3737ccca1014e
Author: Paolo Borelli <pborelli gnome org>
Date:   Sun Mar 16 09:56:26 2014 +0100

    Inline a function

 gedit/gedit-window.c |   34 ++++++++++++++--------------------
 1 files changed, 14 insertions(+), 20 deletions(-)
---
diff --git a/gedit/gedit-window.c b/gedit/gedit-window.c
index f7294c8..1eb92ea 100644
--- a/gedit/gedit-window.c
+++ b/gedit/gedit-window.c
@@ -749,25 +749,6 @@ _gedit_recent_remove (GeditWindow *window,
 }
 
 static void
-open_recent_file (GFile       *location,
-                 GeditWindow *window)
-{
-       GSList *locations = NULL;
-       GSList *loaded = NULL;
-
-       locations = g_slist_prepend (locations, (gpointer) location);
-       loaded = gedit_commands_load_locations (window, locations, NULL, 0, 0);
-
-       if (!loaded || loaded->next) /* if it doesn't contain just 1 element */
-       {
-               _gedit_recent_remove (window, location);
-       }
-
-       g_slist_free (locations);
-       g_slist_free (loaded);
-}
-
-static void
 recent_chooser_item_activated (GtkRecentChooser *chooser,
                               GeditWindow      *window)
 {
@@ -780,7 +761,20 @@ recent_chooser_item_activated (GtkRecentChooser *chooser,
 
        if (location)
        {
-               open_recent_file (location, window);
+               GSList *locations = NULL;
+               GSList *loaded = NULL;
+
+               locations = g_slist_prepend (locations, (gpointer) location);
+               loaded = gedit_commands_load_locations (window, locations, NULL, 0, 0);
+
+               if (!loaded || loaded->next) /* if it doesn't contain just 1 element */
+               {
+                       _gedit_recent_remove (window, location);
+               }
+
+               g_slist_free (locations);
+               g_slist_free (loaded);
+
                g_object_unref (location);
        }
 


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