[Xfce4-commits] <xfdesktop:master> Apply single click option on startup (Bug #8615)

Eric Koegel noreply at xfce.org
Wed Apr 4 19:18:01 CEST 2012


Updating branch refs/heads/master
         to 127ff8a2ed9531b510e5e1bbff64690691e6ccc3 (commit)
       from 9560aa7d120262b2c6060277af3e27904007e1ee (commit)

commit 127ff8a2ed9531b510e5e1bbff64690691e6ccc3
Author: Eric Koegel <eric.koegel at gmail.com>
Date:   Wed Apr 4 20:07:10 2012 +0300

    Apply single click option on startup (Bug #8615)
    
    Moved the property bind function to xfdesktop_icon_view_new rather
    than the init function which will allow it to work correctly when
    xfdesktop starts up.
    Additionally switched to using xfconf_channel_get rather than new.

 src/main.c                |    2 +-
 src/xfdesktop-icon-view.c |   22 ++++++++++------------
 2 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/src/main.c b/src/main.c
index 54dbaee..76b275b 100644
--- a/src/main.c
+++ b/src/main.c
@@ -357,7 +357,7 @@ main(int argc, char **argv)
         g_error_free(error);
         error = NULL;
     } else
-        channel = xfconf_channel_new(XFDESKTOP_CHANNEL);
+        channel = xfconf_channel_get(XFDESKTOP_CHANNEL);
 
     nscreens = gdk_display_get_n_screens(gdpy);
     desktops = g_new0(GtkWidget *, nscreens);
diff --git a/src/xfdesktop-icon-view.c b/src/xfdesktop-icon-view.c
index cf2e977..ef5e869 100644
--- a/src/xfdesktop-icon-view.c
+++ b/src/xfdesktop-icon-view.c
@@ -672,14 +672,6 @@ xfdesktop_icon_view_init(XfdesktopIconView *icon_view)
     g_object_set(G_OBJECT(icon_view), "has-tooltip", TRUE, NULL);
     g_signal_connect(G_OBJECT(icon_view), "query-tooltip",
                      G_CALLBACK(xfdesktop_icon_view_show_tooltip), NULL);
-
-    icon_view->priv->channel = xfconf_channel_new (XFDESKTOP_CHANNEL);
-
-    xfconf_g_property_bind(icon_view->priv->channel,
-                           "/desktop-icons/single-click",
-                           G_TYPE_BOOLEAN,
-                           G_OBJECT(icon_view),
-                           "single_click");
     
     GTK_WIDGET_SET_FLAGS(GTK_WIDGET(icon_view), GTK_NO_WINDOW);
 }
@@ -702,11 +694,9 @@ xfdesktop_icon_view_finalize(GObject *obj)
     g_list_free(icon_view->priv->pending_icons);
     /* icon_view->priv->icons should be cleared in _unrealize() */
 
-    if (icon_view->priv->channel) {
-        g_object_unref (icon_view->priv->channel);
+    if (icon_view->priv->channel)
         icon_view->priv->channel = NULL;
-    }
-    
+
     G_OBJECT_CLASS(xfdesktop_icon_view_parent_class)->finalize(obj);
 }
 
@@ -3387,6 +3377,14 @@ xfdesktop_icon_view_new(XfdesktopIconViewManager *manager)
     
     icon_view = g_object_new(XFDESKTOP_TYPE_ICON_VIEW, NULL);
     icon_view->priv->manager = manager;
+
+    icon_view->priv->channel = xfconf_channel_get(XFDESKTOP_CHANNEL);
+
+    xfconf_g_property_bind(icon_view->priv->channel,
+                           "/desktop-icons/single-click",
+                           G_TYPE_BOOLEAN,
+                           G_OBJECT(icon_view),
+                           "single_click");
     
     return GTK_WIDGET(icon_view);
 }


More information about the Xfce4-commits mailing list