[Xfce4-commits] [apps/xfdashboard] 02/04: Set new theme object instance in "theme-changing" signal parameter instead of current theme instance. Also set new theme name in application property only if loading new theme succeeded.

noreply at xfce.org noreply at xfce.org
Thu Jun 30 10:03:30 CEST 2016


This is an automated email from the git hooks/post-receive script.

nomad pushed a commit to branch master
in repository apps/xfdashboard.

commit aa39a749cf653b10ac06f39ea72607c6508412cb
Author: Stephan Haller <nomad at froevel.de>
Date:   Thu Jun 30 08:14:44 2016 +0200

    Set new theme object instance in "theme-changing" signal parameter instead of current theme instance. Also set new theme name in application property only if loading new theme succeeded.
---
 libxfdashboard/application.c | 26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/libxfdashboard/application.c b/libxfdashboard/application.c
index 738ef3b..839ce9b 100644
--- a/libxfdashboard/application.c
+++ b/libxfdashboard/application.c
@@ -284,30 +284,25 @@ static void _xfdashboard_application_set_theme_name(XfdashboardApplication *self
 	/* Set value if changed */
 	if(g_strcmp0(priv->themeName, inThemeName)!=0)
 	{
-		/* Set value */
-		if(priv->themeName) g_free(priv->themeName);
-		priv->themeName=g_strdup(inThemeName);
-
-		/* Notify about property change */
-		g_object_notify_by_pspec(G_OBJECT(self), XfdashboardApplicationProperties[PROP_THEME_NAME]);
+		/* Create new theme instance */
+		theme=xfdashboard_theme_new();
 
 		/* Emit signal that theme is going to be loaded and changed */
-		g_signal_emit(self, XfdashboardApplicationSignals[SIGNAL_THEME_CHANGING], 0, priv->theme);
+		g_signal_emit(self, XfdashboardApplicationSignals[SIGNAL_THEME_CHANGING], 0, theme);
 
-		/* Create new theme instance and load theme */
-		theme=xfdashboard_theme_new();
-		if(!xfdashboard_theme_load(theme, priv->themeName, &error))
+		/* Load theme */
+		if(!xfdashboard_theme_load(theme, inThemeName, &error))
 		{
 			/* Show critical warning at console */
 			g_critical(_("Could not load theme '%s': %s"),
-						priv->themeName,
+						inThemeName,
 						(error && error->message) ? error->message : _("unknown error"));
 
 			/* Show warning as notification */
 			xfdashboard_notify(NULL,
 								"dialog-error",
 								_("Could not load theme '%s': %s"),
-								priv->themeName,
+								inThemeName,
 								(error && error->message) ? error->message : _("unknown error"));
 
 			/* Release allocated resources */
@@ -317,6 +312,13 @@ static void _xfdashboard_application_set_theme_name(XfdashboardApplication *self
 			return;
 		}
 
+		/* Set value */
+		if(priv->themeName) g_free(priv->themeName);
+		priv->themeName=g_strdup(inThemeName);
+
+		/* Notify about property change */
+		g_object_notify_by_pspec(G_OBJECT(self), XfdashboardApplicationProperties[PROP_THEME_NAME]);
+
 		/* Release current theme and store new one */
 		if(priv->theme) g_object_unref(priv->theme);
 		priv->theme=theme;

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list