X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;ds=sidebyside;f=cut-n-paste%2Frecent-files%2Fegg-recent-util.c;h=4597f03c2d7aa280910143036289e6841f73c190;hb=b4400b84fbb899a1984c8e145b91a09de3a35516;hp=bc15a06e76f92a15f2f82ae9937f528b41259d31;hpb=50ba6d2ea8219ef2ec7b69e027b2a0f8f803e5a6;p=evince.git diff --git a/cut-n-paste/recent-files/egg-recent-util.c b/cut-n-paste/recent-files/egg-recent-util.c index bc15a06e..4597f03c 100644 --- a/cut-n-paste/recent-files/egg-recent-util.c +++ b/cut-n-paste/recent-files/egg-recent-util.c @@ -2,13 +2,12 @@ #include #include #include -#include -#include -#include #ifndef USE_STABLE_LIBGNOMEUI -#include #include #endif +#include +#include +#include #include #include "egg-recent-util.h" @@ -57,72 +56,26 @@ egg_recent_util_escape_underlines (const gchar* text) return g_string_free (str, FALSE); } -#ifndef USE_STABLE_LIBGNOMEUI -static GdkPixbuf * -load_icon_file (char *filename, - guint nominal_size) -{ - GdkPixbuf *pixbuf, *scaled_pixbuf; - guint width, height; - - pixbuf = gdk_pixbuf_new_from_file_at_size (filename, nominal_size, nominal_size, NULL); - - if (pixbuf == NULL) { - return NULL; - } - - width = gdk_pixbuf_get_width (pixbuf); - height = gdk_pixbuf_get_height (pixbuf); - /* if the icon is larger than the nominal size, scale down */ - if (MAX (width, height) > nominal_size) { - if (width > height) { - height = height * nominal_size / width; - width = nominal_size; - } else { - width = width * nominal_size / height; - height = nominal_size; - } - scaled_pixbuf = gdk_pixbuf_scale_simple - (pixbuf, width, height, GDK_INTERP_BILINEAR); - g_object_unref (pixbuf); - pixbuf = scaled_pixbuf; - } - - return pixbuf; -} - GdkPixbuf * -egg_recent_util_get_icon (GnomeIconTheme *theme, const gchar *uri, +egg_recent_util_get_icon (GtkIconTheme *theme, const gchar *uri, const gchar *mime_type, int size) { +#ifndef USE_STABLE_LIBGNOMEUI gchar *icon; - gchar *filename; - const GnomeIconData *icon_data; GdkPixbuf *pixbuf; icon = gnome_icon_lookup (theme, NULL, uri, NULL, NULL, mime_type, 0, NULL); - g_return_val_if_fail (icon != NULL, NULL); - filename = gnome_icon_theme_lookup_icon (theme, icon, - size, - &icon_data, - NULL); + pixbuf = gtk_icon_theme_load_icon (theme, icon, size, 0, NULL); g_free (icon); - if (filename == NULL) { - return NULL; - } - - pixbuf = load_icon_file (filename, size); - g_free (filename); - - return pixbuf; +#endif + return NULL; } -#endif /* !USE_STABLE_LIBGNOMEUI */ gchar * egg_recent_util_get_unique_id (void)