[nautilus] files-view: remove an unnecessary helper function



commit 3050a9c6e2131aa96faf3516e86711ad0dd4c0c1
Author: Daniel Boles <dboles src gnome org>
Date:   Tue Nov 29 20:20:24 2016 +0000

    files-view: remove an unnecessary helper function
    
    selection_not_empty_in_menu_callback was simply a verbose way to test
    whether the selection GList was NULL, which is tidier to just do inline.
    
    The call giving this function its name would be out-of-order if it were
    really needed, but it's not since can_set_wallpaper already checks this.

 src/nautilus-files-view.c |   17 ++---------------
 1 files changed, 2 insertions(+), 15 deletions(-)
---
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index 6f0c2d2..dffcc64 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -1067,18 +1067,6 @@ nautilus_files_view_confirm_multiple (GtkWindow *parent_window,
     return response == GTK_RESPONSE_YES;
 }
 
-static gboolean
-selection_not_empty_in_menu_callback (NautilusFilesView *view,
-                                      GList             *selection)
-{
-    if (selection != NULL)
-    {
-        return TRUE;
-    }
-
-    return FALSE;
-}
-
 static char *
 get_view_directory (NautilusFilesView *view)
 {
@@ -5919,7 +5907,7 @@ real_action_rename (NautilusFilesView *view)
 
     selection = nautilus_view_get_selection (NAUTILUS_VIEW (view));
 
-    if (selection_not_empty_in_menu_callback (view, selection))
+    if (selection != NULL)
     {
         /* If there is more than one file selected, invoke a batch renamer */
         if (selection->next != NULL)
@@ -6318,8 +6306,7 @@ action_set_as_wallpaper (GSimpleAction *action,
 
     selection = nautilus_view_get_selection (user_data);
 
-    if (can_set_wallpaper (selection)
-        && selection_not_empty_in_menu_callback (user_data, selection))
+    if (can_set_wallpaper (selection))
     {
         NautilusFile *file;
         char *target_uri;


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