[gtk+] filechooserentry: Fold function into other



commit f0cf1117e17834b5e1ee9cfae401eceac158e987
Author: Benjamin Otte <otte redhat com>
Date:   Fri Oct 28 13:19:15 2011 -0700

    filechooserentry: Fold function into other
    
    There's no need to discard the current folder's file without also
    discarding the folder object.

 gtk/gtkfilechooserentry.c |   12 +-----------
 1 files changed, 1 insertions(+), 11 deletions(-)
---
diff --git a/gtk/gtkfilechooserentry.c b/gtk/gtkfilechooserentry.c
index d365d71..cfa6529 100644
--- a/gtk/gtkfilechooserentry.c
+++ b/gtk/gtkfilechooserentry.c
@@ -259,7 +259,7 @@ gtk_file_chooser_entry_finalize (GObject *object)
 }
 
 static void
-discard_current_folder (GtkFileChooserEntry *chooser_entry)
+discard_loading_and_current_folder_file (GtkFileChooserEntry *chooser_entry)
 {
   if (chooser_entry->current_folder)
     {
@@ -268,11 +268,6 @@ discard_current_folder (GtkFileChooserEntry *chooser_entry)
       g_object_unref (chooser_entry->current_folder);
       chooser_entry->current_folder = NULL;
     }
-}
-
-static void
-discard_loading_and_current_folder_file (GtkFileChooserEntry *chooser_entry)
-{
   if (chooser_entry->load_folder_cancellable)
     {
       g_cancellable_cancel (chooser_entry->load_folder_cancellable);
@@ -292,7 +287,6 @@ gtk_file_chooser_entry_dispose (GObject *object)
   GtkFileChooserEntry *chooser_entry = GTK_FILE_CHOOSER_ENTRY (object);
 
   remove_completion_feedback (chooser_entry);
-  discard_current_folder (chooser_entry);
   discard_loading_and_current_folder_file (chooser_entry);
 
   if (chooser_entry->start_autocompletion_idle_id != 0)
@@ -1441,8 +1435,6 @@ load_directory_get_folder_callback (GCancellable  *cancellable,
 	  beep (chooser_entry);
 	  pop_up_completion_feedback (chooser_entry, error->message);
 	}
-
-      discard_current_folder (chooser_entry);
     }
 
   if (cancelled || error)
@@ -1507,7 +1499,6 @@ reload_current_folder (GtkFileChooserEntry *chooser_entry,
 
   if (chooser_entry->current_folder_file)
     {
-      discard_current_folder (chooser_entry);
       discard_loading_and_current_folder_file (chooser_entry);
     }
   
@@ -1603,7 +1594,6 @@ refresh_current_folder_and_file_part (GtkFileChooserEntry *chooser_entry,
     }
   else
     {
-      discard_current_folder (chooser_entry);
       discard_loading_and_current_folder_file (chooser_entry);
     }
 



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