Skip to content

Commit e29f5f2

Browse files
committed
nemo-icon-info.c: Stop using gtk_icon_theme_has_icon() - it returns
false negative when attempting to check for icons that have been added using gtk_icon_theme_append_search_path(). This entire branch of functionality is considered 'legacy' and not recommended, but for dropbox emblems, where more than one package may attempt to provide them, putting them in the (recommended) hicolor icon folder won't work.
1 parent b0bda90 commit e29f5f2

4 files changed

Lines changed: 12 additions & 37 deletions

File tree

libnemo-private/nemo-icon-info.c

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -750,26 +750,6 @@ nemo_icon_get_emblem_size_for_icon_size (guint size)
750750
return 0; /* no emblems for smaller sizes */
751751
}
752752

753-
gboolean
754-
nemo_icon_theme_can_render (GThemedIcon *icon)
755-
{
756-
GtkIconTheme *icon_theme;
757-
const gchar * const *names;
758-
gint idx;
759-
760-
names = g_themed_icon_get_names (icon);
761-
762-
icon_theme = gtk_icon_theme_get_default ();
763-
764-
for (idx = 0; names[idx] != NULL; idx++) {
765-
if (gtk_icon_theme_has_icon (icon_theme, names[idx])) {
766-
return TRUE;
767-
}
768-
}
769-
770-
return FALSE;
771-
}
772-
773753
GIcon *
774754
nemo_user_special_directory_get_gicon (GUserDirectory directory)
775755
{

libnemo-private/nemo-icon-info.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ guint nemo_get_desktop_icon_size_for_zoom_level (NemoZoomLevel zoom_level);
9898
gint nemo_get_icon_size_for_stock_size (GtkIconSize size);
9999
guint nemo_icon_get_emblem_size_for_icon_size (guint size);
100100

101-
gboolean nemo_icon_theme_can_render (GThemedIcon *icon);
102101
GIcon * nemo_user_special_directory_get_gicon (GUserDirectory directory);
103102

104103

src/nemo-list-model.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -368,16 +368,14 @@ nemo_list_model_get_value (GtkTreeModel *tree_model, GtkTreeIter *iter, int colu
368368
/* pick only the first emblem we can render for the list view */
369369
for (l = emblem_icons; !bad_ratio && l != NULL; l = l->next) {
370370
emblem_icon = l->data;
371-
if (nemo_icon_theme_can_render (G_THEMED_ICON (emblem_icon))) {
372-
emblem = g_emblem_new (emblem_icon);
373-
emblemed_icon = g_emblemed_icon_new (gicon, emblem);
371+
emblem = g_emblem_new (emblem_icon);
372+
emblemed_icon = g_emblemed_icon_new (gicon, emblem);
374373

375-
g_object_unref (gicon);
376-
g_object_unref (emblem);
377-
gicon = emblemed_icon;
374+
g_object_unref (gicon);
375+
g_object_unref (emblem);
376+
gicon = emblemed_icon;
378377

379-
break;
380-
}
378+
break;
381379
}
382380

383381
g_list_free_full (emblem_icons, g_object_unref);

src/nemo-tree-sidebar-model.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -298,16 +298,14 @@ get_menu_icon_for_file (TreeNode *node,
298298
/* pick only the first emblem we can render for the tree view */
299299
for (l = emblem_icons; l != NULL; l = l->next) {
300300
emblem_icon = l->data;
301-
if (nemo_icon_theme_can_render (G_THEMED_ICON (emblem_icon))) {
302-
emblem = g_emblem_new (emblem_icon);
303-
emblemed_icon = g_emblemed_icon_new (gicon, emblem);
301+
emblem = g_emblem_new (emblem_icon);
302+
emblemed_icon = g_emblemed_icon_new (gicon, emblem);
304303

305-
g_object_unref (gicon);
306-
g_object_unref (emblem);
307-
gicon = emblemed_icon;
304+
g_object_unref (gicon);
305+
g_object_unref (emblem);
306+
gicon = emblemed_icon;
308307

309-
break;
310-
}
308+
break;
311309
}
312310

313311
g_list_free_full (emblem_icons, g_object_unref);

0 commit comments

Comments
 (0)