summaryrefslogtreecommitdiff
path: root/capplets/appearance/mate-wp-xml.c
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2014-01-28 20:16:00 +0100
committerStefano Karapetsas <[email protected]>2014-01-28 20:16:00 +0100
commita3c69729467538e2821f0a27efbf0a8477d35791 (patch)
tree2f2add9b2477b400fef28613d6661ec2f6f8a414 /capplets/appearance/mate-wp-xml.c
parentee511ba9f042c64be34af0f7d8123391605a34c3 (diff)
parent38f7a4c66ec15897c05eb0f3577aaca4cb1b884d (diff)
downloadmate-control-center-a3c69729467538e2821f0a27efbf0a8477d35791.tar.bz2
mate-control-center-a3c69729467538e2821f0a27efbf0a8477d35791.tar.xz
Merge branch 'master' of github.com:mate-desktop/mate-control-center
Diffstat (limited to 'capplets/appearance/mate-wp-xml.c')
-rw-r--r--capplets/appearance/mate-wp-xml.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/capplets/appearance/mate-wp-xml.c b/capplets/appearance/mate-wp-xml.c
index d6b0c71d..11e19235 100644
--- a/capplets/appearance/mate-wp-xml.c
+++ b/capplets/appearance/mate-wp-xml.c
@@ -145,7 +145,7 @@ static void mate_wp_xml_load_xml(AppearanceData* data, const char* filename)
{
MateWPItem * wp;
char *pcolor = NULL, *scolor = NULL;
- gboolean have_scale = FALSE, have_shade = FALSE;
+ gboolean have_scale = FALSE, have_shade = FALSE, have_artist = FALSE;
wp = g_new0(MateWPItem, 1);
@@ -242,6 +242,14 @@ static void mate_wp_xml_load_xml(AppearanceData* data, const char* filename)
scolor = g_strdup(g_strstrip ((char *)wpa->last->content));
}
}
+ else if (!strcmp ((char*) wpa->name, "artist"))
+ {
+ if (wpa->last != NULL)
+ {
+ wp->artist = g_strdup (g_strstrip ((char *)wpa->last->content));
+ have_artist = TRUE;
+ }
+ }
else if (!strcmp ((char*) wpa->name, "text"))
{
/* Do nothing here, libxml2 is being weird */
@@ -283,6 +291,11 @@ static void mate_wp_xml_load_xml(AppearanceData* data, const char* filename)
scolor = g_settings_get_string (data->wp_settings, WP_SCOLOR_KEY);
}
+ if (!have_artist)
+ {
+ wp->artist = g_strdup ("(none)");
+ }
+
gdk_color_parse(pcolor, &color1);
gdk_color_parse(scolor, &color2);
g_free(pcolor);
@@ -541,6 +554,7 @@ void mate_wp_xml_save_list(AppearanceData* data)
xmlNewTextChild(wallpaper, NULL, (xmlChar*) "shade_type", (xmlChar*) shade);
xmlNewTextChild(wallpaper, NULL, (xmlChar*) "pcolor", (xmlChar*) pcolor);
xmlNewTextChild(wallpaper, NULL, (xmlChar*) "scolor", (xmlChar*) scolor);
+ xmlNewTextChild(wallpaper, NULL, (xmlChar*) "artist", (xmlChar*) wpitem->artist);
g_free(pcolor);
g_free(scolor);