[nautilus/antoniof/current-location-menu-actions-fixes: 4/4] files-view: Fix clearance of the wrong property



commit c1a833fdfd269057ad80c4c38c6cededc13539b4
Author: António Fernandes <antoniof gnome org>
Date:   Tue Jul 31 12:05:43 2018 +0100

    files-view: Fix clearance of the wrong property
    
    We are clearing &priv->extensions_background_menu when we actually
    want to set priv->templates_menu. This looks like an edition overight
    from 544c1cca5692c5dc81a14ce8176b197f671c966c
    
    Fix it. Also, remove != NULL guards because g_clear_object
    already handles that case (doing nothing, as per documentation).

 src/nautilus-files-view.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
---
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index 6a247cafe..ad326333a 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -763,10 +763,7 @@ real_set_extensions_background_menu (NautilusView *view,
 
     priv = nautilus_files_view_get_instance_private (NAUTILUS_FILES_VIEW (view));
 
-    if (priv->extensions_background_menu != NULL)
-    {
-        g_clear_object (&priv->extensions_background_menu);
-    }
+    g_clear_object (&priv->extensions_background_menu);
     priv->extensions_background_menu = menu;
 }
 
@@ -780,10 +777,7 @@ real_set_templates_menu (NautilusView *view,
 
     priv = nautilus_files_view_get_instance_private (NAUTILUS_FILES_VIEW (view));
 
-    if (priv->templates_menu != NULL)
-    {
-        g_clear_object (&priv->extensions_background_menu);
-    }
+    g_clear_object (&priv->templates_menu);
     priv->templates_menu = menu;
 }
 


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