[gtk+/gtk-3-20] app: use g_set_object()
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-20] app: use g_set_object()
- Date: Tue, 19 Apr 2016 14:57:00 +0000 (UTC)
commit 69c902a14673baae49adcae3e8d4e5b94c0dbc2a
Author: Sébastien Wilmet <swilmet gnome org>
Date: Sun Apr 10 14:15:35 2016 +0200
app: use g_set_object()
https://bugzilla.gnome.org/show_bug.cgi?id=764846
gtk/gtkapplication.c | 20 ++------------------
1 files changed, 2 insertions(+), 18 deletions(-)
---
diff --git a/gtk/gtkapplication.c b/gtk/gtkapplication.c
index d8a9685..8da35b6 100644
--- a/gtk/gtkapplication.c
+++ b/gtk/gtkapplication.c
@@ -1383,16 +1383,8 @@ gtk_application_set_app_menu (GtkApplication *application,
g_return_if_fail (g_application_get_is_registered (G_APPLICATION (application)));
g_return_if_fail (!g_application_get_is_remote (G_APPLICATION (application)));
- if (app_menu != application->priv->app_menu)
+ if (g_set_object (&application->priv->app_menu, app_menu))
{
- if (application->priv->app_menu != NULL)
- g_object_unref (application->priv->app_menu);
-
- application->priv->app_menu = app_menu;
-
- if (application->priv->app_menu != NULL)
- g_object_ref (application->priv->app_menu);
-
if (app_menu)
extract_accels_from_menu (app_menu, application);
@@ -1455,16 +1447,8 @@ gtk_application_set_menubar (GtkApplication *application,
g_return_if_fail (g_application_get_is_registered (G_APPLICATION (application)));
g_return_if_fail (!g_application_get_is_remote (G_APPLICATION (application)));
- if (menubar != application->priv->menubar)
+ if (g_set_object (&application->priv->menubar, menubar))
{
- if (application->priv->menubar != NULL)
- g_object_unref (application->priv->menubar);
-
- application->priv->menubar = menubar;
-
- if (application->priv->menubar != NULL)
- g_object_ref (application->priv->menubar);
-
if (menubar)
extract_accels_from_menu (menubar, application);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]