From f4012ecd2751f3bb280604087de71f6a4009a9a9 Mon Sep 17 00:00:00 2001 From: Stefano Karapetsas Date: Mon, 27 Jan 2014 11:52:36 +0100 Subject: 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. --- capplets/appearance/mate-wp-item.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'capplets/appearance/mate-wp-item.c') 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: wallpaper name * mime type, size * Folder: /path/to/file + * Artist: wallpaper author */ item->description = g_markup_printf_escaped (_("%s\n" "%s, %s\n" - "Folder: %s"), + "Folder: %s\n" + "Artist: %s"), item->name, description, size, - dirname); + dirname, + artist); } else { /* translators: wallpaper name * Image missing * Folder: /path/to/file + * Artist: wallpaper author */ item->description = g_markup_printf_escaped (_("%s\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); } } -- cgit v1.2.1