[nautilus/wip/apoos-maximus/gsoc2020: 12/17] properties-window: Set boolean object data correctly




commit 82e8545fc156dd0a353e868757aaa861e26546f0
Author: António Fernandes <antoniof gnome org>
Date:   Thu Dec 17 18:40:18 2020 +0000

    properties-window: Set boolean object data correctly
    
    It's wrong to set a pointer to an object as data without incrementing
    its refcount.
    
    But there is actually no need to pass a real pointer as data here, as
    we actually want a boolean.
    
    Use a pointer conversion macros instead.

 src/nautilus-properties-window.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/nautilus-properties-window.c b/src/nautilus-properties-window.c
index 05b00d67f..d9c980fa8 100644
--- a/src/nautilus-properties-window.c
+++ b/src/nautilus-properties-window.c
@@ -944,7 +944,7 @@ clear_extension_pages (NautilusPropertiesWindow *self)
         page = gtk_notebook_get_nth_page
                    (GTK_NOTEBOOK (self->notebook), i);
 
-        if (g_object_get_data (G_OBJECT (page), "is-extension-page"))
+        if (GPOINTER_TO_INT (g_object_get_data (G_OBJECT (page), "is-extension-page")))
         {
             gtk_notebook_remove_page
                 (GTK_NOTEBOOK (self->notebook), i);
@@ -4338,7 +4338,7 @@ append_extension_pages (NautilusPropertiesWindow *self)
 
             g_object_set_data (G_OBJECT (page_widget),
                                "is-extension-page",
-                               page);
+                               GINT_TO_POINTER (TRUE));
 
             g_object_unref (page_widget);
             g_object_unref (label);


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