diff options
author | Matthias Clasen <mclasen@redhat.com> | 2016-05-19 09:03:20 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2016-05-19 12:10:07 -0400 |
commit | 7d2f54f0f3a3d06be919a75bb6f7f03a929555a7 (patch) | |
tree | 22c61aad77bf5309c4fe768483e148bb6ac16260 | |
parent | 706b3ffc825a84ee3d984acaca70fccbe63e631c (diff) | |
download | gtk+-7d2f54f0f3a3d06be919a75bb6f7f03a929555a7.tar.gz |
icon theme: Add a warning
Warn about the situation when we've found a resource or file path,
but gdk-pixbuf fails to give us a pixbuf. This generally means that
either pixbuf loaders are not found or the shared-mime database
is missing.
-rw-r--r-- | gtk/gtkicontheme.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c index 4cb4893600..8ebf652d4f 100644 --- a/gtk/gtkicontheme.c +++ b/gtk/gtkicontheme.c @@ -3951,7 +3951,30 @@ icon_info_ensure_scale_and_pixbuf (GtkIconInfo *icon_info) } if (!source_pixbuf) - return FALSE; + { + static gboolean warn_about_load_failure = TRUE; + + if (warn_about_load_failure) + { + gchar *path; + + if (icon_info->is_resource) + path = g_strdup (icon_info->filename); + else if (G_IS_FILE (icon_info->loadable)) + path = g_file_get_path (G_FILE (icon_info->loadable)); + else + path = g_strdup ("icon theme"); + + g_warning ("Could not load a pixbuf from %s.\n" + "This may indicate that pixbuf loaders or the mime database could not be found.", + path); + g_free (path); + + warn_about_load_failure = FALSE; + } + + return FALSE; + } /* Do scale calculations that depend on the image size */ |