diff options
author | rbuj <[email protected]> | 2021-10-26 12:49:17 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2022-01-02 21:03:47 +0100 |
commit | f033cb68fea4b1ad028fc25b80a0c5b52ab3896d (patch) | |
tree | 9ae0ec0f6f51370958d13796abee457088ef2625 /libview | |
parent | 816d2dc8226f8d271aa1a6cd30549614769d5267 (diff) | |
download | atril-f033cb68fea4b1ad028fc25b80a0c5b52ab3896d.tar.bz2 atril-f033cb68fea4b1ad028fc25b80a0c5b52ab3896d.tar.xz |
Don't build the path to stock icons
Diffstat (limited to 'libview')
-rw-r--r-- | libview/ev-stock-icons.c | 17 | ||||
-rw-r--r-- | libview/ev-stock-icons.h | 1 |
2 files changed, 3 insertions, 15 deletions
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 |