From f033cb68fea4b1ad028fc25b80a0c5b52ab3896d Mon Sep 17 00:00:00 2001 From: rbuj Date: Tue, 26 Oct 2021 12:49:17 +0200 Subject: Don't build the path to stock icons --- libview/ev-stock-icons.c | 17 +++-------------- libview/ev-stock-icons.h | 1 - 2 files changed, 3 insertions(+), 15 deletions(-) (limited to 'libview') diff --git a/libview/ev-stock-icons.c b/libview/ev-stock-icons.c index 58da21b1..7447955a 100644 --- a/libview/ev-stock-icons.c +++ b/libview/ev-stock-icons.c @@ -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; @@ -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); } @@ -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); @@ -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); -} - diff --git a/libview/ev-stock-icons.h b/libview/ev-stock-icons.h index ab9671e1..363b0c62 100644 --- a/libview/ev-stock-icons.h +++ b/libview/ev-stock-icons.h @@ -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 -- cgit v1.2.1