Branch: refs/heads/master Author: Jiří Techet techet@gmail.com Committer: Jiří Techet techet@gmail.com Date: Mon, 29 Dec 2014 14:12:56 UTC Commit: 89aae7f6b7469fa9c39b72d22eb65417be96a23b https://github.com/geany/geany-plugins/commit/89aae7f6b7469fa9c39b72d22eb654...
Log Message: ----------- projectorganizer: verify icon image availability in current theme
GIcon doesn't try to load the icon bitmap, just represents the icon by MIME type. It may happen the MIME type is registered but the corresponding icon doesn't exist on the system (happens on OS X, Windows) in which canse the GIcon cannot be used.
Modified Paths: -------------- projectorganizer/src/prjorg-sidebar.c
Modified: projectorganizer/src/prjorg-sidebar.c 13 lines changed, 13 insertions(+), 0 deletions(-) =================================================================== @@ -922,6 +922,19 @@ static void create_branch(gint level, GSList *leaf_list, GtkTreeIter *parent, if (content_type) { icon = g_content_type_get_icon(content_type); + if (icon) + { + GtkIconInfo *icon_info; + + icon_info = gtk_icon_theme_lookup_by_gicon(gtk_icon_theme_get_default(), icon, 16, 0); + if (!icon_info) + { + g_object_unref(icon); + icon = NULL; + } + else + gtk_icon_info_free(icon_info); + } g_free(content_type); }
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
plugins-commits@lists.geany.org