aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-icon-factory.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2014-07-11 03:01:42 +0800
committerMilan Crha <mcrha@redhat.com>2014-07-11 03:01:42 +0800
commitfa3d3c2403a3fcdd7bd4b66cb2acb7baf40ab231 (patch)
treef315f05c15fd4973a30f8dff1a29477ac8c2f803 /e-util/e-icon-factory.c
parent1690e6760f23f95f245d4acde8c768ccdedfc3b8 (diff)
downloadgsoc2013-evolution-fa3d3c2403a3fcdd7bd4b66cb2acb7baf40ab231.tar
gsoc2013-evolution-fa3d3c2403a3fcdd7bd4b66cb2acb7baf40ab231.tar.gz
gsoc2013-evolution-fa3d3c2403a3fcdd7bd4b66cb2acb7baf40ab231.tar.bz2
gsoc2013-evolution-fa3d3c2403a3fcdd7bd4b66cb2acb7baf40ab231.tar.lz
gsoc2013-evolution-fa3d3c2403a3fcdd7bd4b66cb2acb7baf40ab231.tar.xz
gsoc2013-evolution-fa3d3c2403a3fcdd7bd4b66cb2acb7baf40ab231.tar.zst
gsoc2013-evolution-fa3d3c2403a3fcdd7bd4b66cb2acb7baf40ab231.zip
Bug 722068 - Make Evolution build under Win32
This also makes gnome-desktop an optional dependency, which can be avoided with --disable-gnome-desktop configure option.
Diffstat (limited to 'e-util/e-icon-factory.c')
-rw-r--r--e-util/e-icon-factory.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/e-util/e-icon-factory.c b/e-util/e-icon-factory.c
index 43c1239b03..7aac6f61ce 100644
--- a/e-util/e-icon-factory.c
+++ b/e-util/e-icon-factory.c
@@ -29,9 +29,11 @@
#include <sys/types.h>
#include <sys/stat.h>
+#ifdef HAVE_GNOME_DESKTOP
#define GNOME_DESKTOP_USE_UNSTABLE_API
#include <libgnome-desktop/gnome-desktop-thumbnail.h>
#undef GNOME_DESKTOP_USE_UNSTABLE_API
+#endif
#include <glib/gstdio.h>
#include <gtk/gtk.h>
@@ -147,9 +149,11 @@ e_icon_factory_pixbuf_scale (GdkPixbuf *pixbuf,
if (height <= 0)
height = 1;
+ #ifdef HAVE_GNOME_DESKTOP
/* because this can only scale down, not up */
if (gdk_pixbuf_get_width (pixbuf) > width && gdk_pixbuf_get_height (pixbuf) > height)
return gnome_desktop_thumbnail_scale_down_pixbuf (pixbuf, width, height);
+ #endif
return gdk_pixbuf_scale_simple (pixbuf, width, height, GDK_INTERP_BILINEAR);
}
@@ -166,6 +170,7 @@ e_icon_factory_pixbuf_scale (GdkPixbuf *pixbuf,
gchar *
e_icon_factory_create_thumbnail (const gchar *filename)
{
+#ifdef HAVE_GNOME_DESKTOP
static GnomeDesktopThumbnailFactory *thumbnail_factory = NULL;
struct stat file_stat;
gchar *thumbnail = NULL;
@@ -211,4 +216,7 @@ e_icon_factory_create_thumbnail (const gchar *filename)
}
return thumbnail;
+#else
+ return NULL;
+#endif /* HAVE_GNOME_DESKTOP */
}