[Kazehakase-cvs] CVS update: kazehakase/src/libegg/pixbufthumbnail

Back to archive index

Hiroyuki Ikezoe ikezo****@users*****
Fri Mar 16 15:33:15 JST 2007


Index: kazehakase/src/libegg/pixbufthumbnail/egg-pixbuf-thumbnail.c
diff -u kazehakase/src/libegg/pixbufthumbnail/egg-pixbuf-thumbnail.c:1.6 kazehakase/src/libegg/pixbufthumbnail/egg-pixbuf-thumbnail.c:1.7
--- kazehakase/src/libegg/pixbufthumbnail/egg-pixbuf-thumbnail.c:1.6	Thu Mar 15 21:33:21 2007
+++ kazehakase/src/libegg/pixbufthumbnail/egg-pixbuf-thumbnail.c	Fri Mar 16 15:33:15 2007
@@ -83,17 +83,18 @@
 #define THUMB_SOFTWARE_VALUE	"GdkPixbuf"
 
 
-#define SIZE_TO_DIR(size) ({\
-  const gchar *__r; \
-  if (size == EGG_PIXBUF_THUMB_NORMAL) \
-    __r = NORMAL_DIR_NAME; \
-  else if (size == EGG_PIXBUF_THUMB_LARGE) \
-    __r = LARGE_DIR_NAME; \
-  else \
-    __r = NULL; \
-  __r; \
-})
-
+static const gchar *
+size_to_dir (size) 
+{
+  const gchar *__r;
+  if (size == EGG_PIXBUF_THUMB_NORMAL)
+    __r = NORMAL_DIR_NAME;
+  else if (size == EGG_PIXBUF_THUMB_LARGE)
+    __r = LARGE_DIR_NAME;
+  else
+    __r = NULL;
+  return __r;
+}
 
 static gboolean ensure_thumbnail_dirs (GError **error);
 
@@ -984,7 +985,7 @@
   g_return_val_if_fail (GDK_IS_PIXBUF (thumbnail), FALSE);
   g_return_val_if_fail (size == EGG_PIXBUF_THUMB_NORMAL || size == EGG_PIXBUF_THUMB_LARGE, FALSE);
 
-  return gdk_pixbuf_set_option (thumbnail, THUMB_SIZE_KEY, SIZE_TO_DIR (size));
+  return gdk_pixbuf_set_option (thumbnail, THUMB_SIZE_KEY, size_to_dir(size));
 }
 
 
@@ -1560,7 +1561,7 @@
 
   md5 = egg_str_get_md5_str (uri);
   basename = g_strconcat (md5, ".png", NULL);
-  filename = g_build_filename (home_dir, ".thumbnails", SIZE_TO_DIR (size), basename, NULL);
+  filename = g_build_filename (home_dir, ".thumbnails", size_to_dir(size), basename, NULL);
   g_free (basename);
 
   return filename;


More information about the Kazehakase-cvs mailing list
Back to archive index