summaryrefslogtreecommitdiff
path: root/capplets/appearance/mate-wp-xml.c
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2014-01-27 11:52:36 +0100
committerStefano Karapetsas <[email protected]>2014-01-27 11:52:36 +0100
commitf4012ecd2751f3bb280604087de71f6a4009a9a9 (patch)
tree61b6193e292d8d8c539deace0d3db4cc76f1b441 /capplets/appearance/mate-wp-xml.c
parent3ca08cb10bd7650d771da98c457460556cc43db5 (diff)
downloadmate-control-center-f4012ecd2751f3bb280604087de71f6a4009a9a9.tar.bz2
mate-control-center-f4012ecd2751f3bb280604087de71f6a4009a9a9.tar.xz
appearance: Add support for 'artist' tag in xml backgrounds files
This feature was already implemented in Linux Mint and Cinnamon, so we are going to implement it in MATE too.
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);