[gtk+/bgo593793-filechooser-recent-folders-master: 8/20] Turn a struct field into a local variable



commit e7196ee985961749dbeae166eae1a992b7685583
Author: Federico Mena Quintero <federico gnome org>
Date:   Tue Jun 28 18:55:37 2011 -0500

    Turn a struct field into a local variable
    
    Signed-off-by: Federico Mena Quintero <federico gnome org>

 gtk/gtkfilechooserdefault.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c
index ae78e53..59165cd 100644
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@ -9051,7 +9051,6 @@ typedef struct
 {
   GtkFileChooserDefault *impl;
   GList *items;
-  gint n_items;
   guint needs_sorting : 1;
 } RecentLoadData;
 
@@ -9130,13 +9129,14 @@ recent_idle_load (gpointer data)
   if (load_data->needs_sorting)
     {
       gint limit;
+      gint n_items;
 
       load_data->items = g_list_sort (load_data->items, recent_sort_mru);
-      load_data->n_items = g_list_length (load_data->items);
+      n_items = g_list_length (load_data->items);
 
       limit = get_recent_files_limit (GTK_WIDGET (impl));
       
-      if (limit != -1 && (load_data->n_items > limit))
+      if (limit != -1 && (n_items > limit))
         {
           GList *clamp, *l;
 
@@ -9148,8 +9148,6 @@ recent_idle_load (gpointer data)
 
               g_list_foreach (l, (GFunc) gtk_recent_info_unref, NULL);
               g_list_free (l);
-
-              load_data->n_items = limit;
             }
          }
 
@@ -9192,7 +9190,6 @@ recent_start_loading (GtkFileChooserDefault *impl)
   load_data = g_new (RecentLoadData, 1);
   load_data->impl = impl;
   load_data->items = NULL;
-  load_data->n_items = 0;
   load_data->needs_sorting = TRUE;
 
   /* begin lazy loading the recent files into the model */



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