Skip to content

Commit

Permalink
Don't build the path to stock icons
Browse files Browse the repository at this point in the history
  • Loading branch information
rbuj authored and raveit65 committed Jan 2, 2022
1 parent 816d2dc commit f033cb6
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 18 deletions.
1 change: 0 additions & 1 deletion help/reference/libview/libatrilview-sections.txt
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,6 @@ EV_STOCK_RESIZE_SW
EV_STOCK_CLOSE
EV_STOCK_INVERTED_COLORS
ev_stock_icons_init
ev_stock_icons_shutdown
ev_stock_icons_set_screen
</SECTION>

Expand Down
17 changes: 3 additions & 14 deletions libview/ev-stock-icons.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,13 @@ static const EvStockIcon stock_icons [] = {
{ EV_STOCK_SEND_TO, "document-send"},
};

static gchar *ev_icons_path;
#define EV_ICONS_PATH ATRILDATADIR "/icons"

static void
ev_stock_icons_add_icons_path_for_screen (GdkScreen *screen)
{
GtkIconTheme *icon_theme;

g_return_if_fail (ev_icons_path != NULL);

icon_theme = screen ? gtk_icon_theme_get_for_screen (screen) : gtk_icon_theme_get_default ();
if (icon_theme) {
gchar **path = NULL;
Expand All @@ -71,13 +69,13 @@ ev_stock_icons_add_icons_path_for_screen (GdkScreen *screen)
*/
gtk_icon_theme_get_search_path (icon_theme, &path, &n_paths);
for (i = n_paths - 1; i >= 0; i--) {
if (g_ascii_strcasecmp (ev_icons_path, path[i]) == 0)
if (g_ascii_strcasecmp (EV_ICONS_PATH, path[i]) == 0)
break;
}

if (i < 0)
gtk_icon_theme_append_search_path (icon_theme,
ev_icons_path);
EV_ICONS_PATH);

g_strfreev (path);
}
Expand All @@ -95,8 +93,6 @@ ev_stock_icons_init (void)
GtkIconSource *source;
gint i;

ev_icons_path = g_build_filename (ATRILDATADIR, "icons", NULL);

factory = gtk_icon_factory_new ();
gtk_icon_factory_add_default (factory);

Expand Down Expand Up @@ -128,10 +124,3 @@ ev_stock_icons_set_screen (GdkScreen *screen)

ev_stock_icons_add_icons_path_for_screen (screen);
}

void
ev_stock_icons_shutdown (void)
{
g_free (ev_icons_path);
}

1 change: 0 additions & 1 deletion libview/ev-stock-icons.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ G_BEGIN_DECLS
#define EV_STOCK_SEND_TO "document-send"

void ev_stock_icons_init (void);
void ev_stock_icons_shutdown (void);
void ev_stock_icons_set_screen (GdkScreen *screen);

G_END_DECLS
Expand Down
1 change: 0 additions & 1 deletion previewer/ev-previewer.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ main (gint argc, gchar **argv)
ev_previewer_unlink_tempfile (print_settings);

ev_shutdown ();
ev_stock_icons_shutdown ();
g_object_unref (model);

return 0;
Expand Down
1 change: 0 additions & 1 deletion shell/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,6 @@ main (int argc, char *argv[])

done:
ev_shutdown ();
ev_stock_icons_shutdown ();

g_object_unref (application);
return status;
Expand Down

0 comments on commit f033cb6

Please sign in to comment.