[Xfce4-commits] [apps/xfdashboard] 01/01: Missed to also prefix IDs used at settings application at 'switch-to-view-when-resumed' with 'builtin.' as it was introduced with commit 8539ae3b7172e9f1ff8ff20396d3906b7a06da06

noreply at xfce.org noreply at xfce.org
Fri May 5 07:25:48 CEST 2017


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

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

commit 00f81bbc91f2c396c9c68a5f7064ef4bb189db8d
Author: Stephan Haller <nomad at froevel.de>
Date:   Fri May 5 07:22:04 2017 +0200

    Missed to also prefix IDs used at settings application at 'switch-to-view-when-resumed' with 'builtin.' as it was introduced with commit 8539ae3b7172e9f1ff8ff20396d3906b7a06da06
    
    This commit fixes issue GH #147
---
 settings/general.c | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/settings/general.c b/settings/general.c
index b366289..313a54e 100644
--- a/settings/general.c
+++ b/settings/general.c
@@ -117,9 +117,9 @@ struct _XfdashboardSettingsGeneralNameValuePair
 
 static XfdashboardSettingsGeneralNameValuePair				_xfdashboard_settings_general_resumable_views_values[]=
 {
-	{ N_("Do nothing"), "" },
-	{ N_("Windows view"), "windows" },
-	{ N_("Applications view"), "applications" },
+	{ N_("Do nothing"), NULL },
+	{ N_("Windows view"), "builtin.windows" },
+	{ N_("Applications view"), "builtin.applications" },
 	{ NULL, NULL }
 };
 
@@ -153,7 +153,14 @@ static void _xfdashboard_settings_general_switch_to_view_on_resume_changed_by_wi
 	gtk_tree_model_get(model, &iter, 1, &value, -1);
 
 	/* Set value at xfconf property */
-	xfconf_channel_set_string(priv->xfconfChannel, SWITCH_TO_VIEW_ON_RESUME_XFCONF_PROP, value);
+	if(value)
+	{
+		xfconf_channel_set_string(priv->xfconfChannel, SWITCH_TO_VIEW_ON_RESUME_XFCONF_PROP, value);
+	}
+		else
+		{
+			xfconf_channel_reset_property(priv->xfconfChannel, SWITCH_TO_VIEW_ON_RESUME_XFCONF_PROP, FALSE);
+		}
 
 	/* Release allocated resources */
 	if(value) g_free(value);
@@ -177,7 +184,7 @@ static void _xfdashboard_settings_general_switch_to_view_on_resume_changed_by_xf
 	priv=self->priv;
 
 	/* Get new value to lookup and set at combo box */
-	if(G_UNLIKELY(G_VALUE_TYPE(inValue)!=G_TYPE_STRING)) newValue="";
+	if(G_UNLIKELY(G_VALUE_TYPE(inValue)!=G_TYPE_STRING)) newValue=NULL;
 		else newValue=g_value_get_string(inValue);
 
 	/* Iterate through combo box value and set new value if match is found */
@@ -187,7 +194,8 @@ static void _xfdashboard_settings_general_switch_to_view_on_resume_changed_by_xf
 		do
 		{
 			gtk_tree_model_get(model, &iter, 1, &value, -1);
-			if(G_UNLIKELY(g_str_equal(value, newValue)))
+			if(G_UNLIKELY((!newValue && !value)) ||
+				G_UNLIKELY(!g_strcmp0(value, newValue)))
 			{
 				g_free(value);
 				gtk_combo_box_set_active_iter(GTK_COMBO_BOX(priv->widgetSwitchToViewOnResume), &iter);
@@ -415,7 +423,6 @@ static void _xfdashboard_settings_general_set_builder(XfdashboardSettingsGeneral
 
 		/* Get default value from settings */
 		defaultValue=xfconf_channel_get_string(priv->xfconfChannel, SWITCH_TO_VIEW_ON_RESUME_XFCONF_PROP, DEFAULT_SWITCH_TO_VIEW_ON_RESUME);
-		if(!defaultValue) defaultValue=g_strdup("");
 
 		/* Clear combo box */
 		gtk_cell_layout_clear(GTK_CELL_LAYOUT(priv->widgetSwitchToViewOnResume));
@@ -432,7 +439,8 @@ static void _xfdashboard_settings_general_set_builder(XfdashboardSettingsGeneral
 		{
 			gtk_list_store_append(listStore, &listStoreIter);
 			gtk_list_store_set(listStore, &listStoreIter, 0, _(iter->displayName), 1, iter->value, -1);
-			if(!g_strcmp0(iter->value, defaultValue))
+			if((!defaultValue && !iter->value) ||
+				!g_strcmp0(iter->value, defaultValue))
 			{
 				defaultListStoreIter=gtk_tree_iter_copy(&listStoreIter);
 			}

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


More information about the Xfce4-commits mailing list