summaryrefslogtreecommitdiff
path: root/capplets/appearance/mate-wp-item.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-item.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-item.c')
-rw-r--r--capplets/appearance/mate-wp-item.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/capplets/appearance/mate-wp-item.c b/capplets/appearance/mate-wp-item.c
index d11fa896..96e7d67a 100644
--- a/capplets/appearance/mate-wp-item.c
+++ b/capplets/appearance/mate-wp-item.c
@@ -279,10 +279,16 @@ void mate_wp_item_update_description (MateWPItem * item) {
const gchar *description;
gchar *size;
gchar *dirname = g_path_get_dirname (item->filename);
+ gchar *artist;
description = NULL;
size = NULL;
+ if (!item->artist || item->artist[0] == 0 || !g_strcmp0(item->artist, "(none)"))
+ artist = g_strdup (_("unknown"));
+ else
+ artist = g_strdup (item->artist);
+
if (strcmp (item->fileinfo->mime_type, "application/xml") == 0)
{
if (mate_bg_changes_with_time (item->bg))
@@ -308,28 +314,35 @@ void mate_wp_item_update_description (MateWPItem * item) {
/* translators: <b>wallpaper name</b>
* mime type, size
* Folder: /path/to/file
+ * Artist: wallpaper author
*/
item->description = g_markup_printf_escaped (_("<b>%s</b>\n"
"%s, %s\n"
- "Folder: %s"),
+ "Folder: %s\n"
+ "Artist: %s"),
item->name,
description,
size,
- dirname);
+ dirname,
+ artist);
} else {
/* translators: <b>wallpaper name</b>
* Image missing
* Folder: /path/to/file
+ * Artist: wallpaper author
*/
item->description = g_markup_printf_escaped (_("<b>%s</b>\n"
"%s\n"
- "Folder: %s"),
+ "Folder: %s\n"
+ "Artist: %s"),
item->name,
_("Image missing"),
- dirname);
+ dirname,
+ artist);
}
g_free (size);
g_free (dirname);
+ g_free (artist);
}
}