rpms/control-center/devel control-center-2.17.1-fix-thumbnailing.patch, NONE, 1.1 control-center.spec, 1.200, 1.201 control-center-2.15.91-fix-thumbnailing.patch, 1.2, NONE

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Fri Nov 17 15:45:58 UTC 2006


Author: rstrode

Update of /cvs/dist/rpms/control-center/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv14887

Modified Files:
	control-center.spec 
Added Files:
	control-center-2.17.1-fix-thumbnailing.patch 
Removed Files:
	control-center-2.15.91-fix-thumbnailing.patch 
Log Message:
- apply aforementioned thumbnail fixups


control-center-2.17.1-fix-thumbnailing.patch:
 gnome-wp-info.c |   26 --------------------------
 gnome-wp-item.c |   42 +++++++++++++++++++++++++++++-------------
 2 files changed, 29 insertions(+), 39 deletions(-)

--- NEW FILE control-center-2.17.1-fix-thumbnailing.patch ---
--- control-center-2.17.1/capplets/background/gnome-wp-item.c.fix-thumbnailing	2006-01-28 09:52:03.000000000 -0500
+++ control-center-2.17.1/capplets/background/gnome-wp-item.c	2006-11-17 10:43:55.000000000 -0500
@@ -201,7 +201,6 @@
 GdkPixbuf * gnome_wp_item_get_thumbnail (GnomeWPItem * item,
 					 GnomeThumbnailFactory * thumbs) {
   GdkPixbuf * pixbuf, * bgpixbuf;
-  GdkPixbuf * tmpbuf;
   GdkPixbuf * scaled = NULL;
   gint sw, sh, bw, bh, pw, ph, tw, th;
   gdouble ratio;
@@ -241,22 +240,42 @@
      If we are creating the thumbnail for "No Wallpaper", then we just copy
      the background colors pixbuf we created above, here
   */
-  if (item->fileinfo->thumburi != NULL &&
-      g_file_test (item->fileinfo->thumburi, G_FILE_TEST_EXISTS)) {
-    pixbuf = gdk_pixbuf_new_from_file (item->fileinfo->thumburi, NULL);
-  } else if (!strcmp (item->filename, "(none)")) {
+  pixbuf = NULL;
+  if (!strcmp (item->filename, "(none)")) {
     return bgpixbuf;
   } else {
-    gchar * escaped_path;
+    gchar * escaped_path, * thumbnail_filename;
 
     escaped_path = gnome_vfs_escape_path_string (item->filename);
+    thumbnail_filename = gnome_thumbnail_factory_lookup (thumbs,
+                                                         escaped_path,
+                                                         item->fileinfo->mtime);
 
+    if (thumbnail_filename == NULL) {
     pixbuf = gnome_thumbnail_factory_generate_thumbnail (thumbs,
 							 escaped_path,
 							 item->fileinfo->mime_type);
     gnome_thumbnail_factory_save_thumbnail (thumbs, pixbuf,
 					    escaped_path,
 					    item->fileinfo->mtime);
+       g_object_unref (pixbuf);
+       pixbuf = NULL;
+
+       thumbnail_filename = gnome_thumbnail_factory_lookup (thumbs,
+                                                            escaped_path,
+                                                            item->fileinfo->mtime);
+    }
+
+    if (thumbnail_filename != NULL) {
+ 
+      pixbuf = gdk_pixbuf_new_from_file (thumbnail_filename, NULL);
+
+      if (pixbuf != NULL) {
+        item->fileinfo->thumburi = thumbnail_filename;
+        thumbnail_filename = NULL;
+      }
+    }
+
     g_free (escaped_path);
   }
 
@@ -273,16 +292,12 @@
 	gchar ** keys = NULL;
 	gchar ** vals = NULL;
 
-	tmpbuf = gdk_pixbuf_new_from_file (item->filename, NULL);
-
-	item->width = gdk_pixbuf_get_width (tmpbuf);
-	item->height = gdk_pixbuf_get_height (tmpbuf);
-
+        gdk_pixbuf_get_file_info (item->filename, 
+                                  &item->width, &item->height); 
 	collect_save_options (pixbuf, &keys, &vals, item->width, item->height);
 	gdk_pixbuf_savev (pixbuf, item->fileinfo->thumburi, "png",
 			  keys, vals, NULL);
 
-	g_object_unref (tmpbuf);
 	g_strfreev (keys);
 	g_strfreev (vals);
       }
@@ -322,9 +337,10 @@
       }
       scaled = gnome_wp_pixbuf_center (pixbuf, bgpixbuf, tw, th);
     }
+
+    g_object_unref (pixbuf);
   }
 
-  g_object_unref (pixbuf);
   g_object_unref (bgpixbuf);
 
   return scaled;
--- control-center-2.17.1/capplets/background/gnome-wp-info.c.fix-thumbnailing	2006-01-28 09:52:03.000000000 -0500
+++ control-center-2.17.1/capplets/background/gnome-wp-info.c	2006-11-17 10:43:55.000000000 -0500
@@ -38,24 +38,11 @@
 				    GNOME_VFS_FILE_INFO_FOLLOW_LINKS);
   if (info == NULL || info->mime_type == NULL || result != GNOME_VFS_OK) {
     if (!strcmp (uri, "(none)")) {
-      gchar * md5sum;
-
       new = g_new0 (GnomeWPInfo, 1);
 
       new->mime_type = g_strdup ("image/x-no-data");
       new->uri = g_strdup (uri);
-
-      md5sum = gnome_thumbnail_md5 (escaped_path);
-
-      new->thumburi = g_strconcat (g_get_home_dir (),
-				   "/.thumbnails/normal/",
-				   md5sum,
-				   ".png",
-				   NULL);
-      g_free (md5sum);
-
       new->name = g_strdup (_("No Wallpaper"));
-
       new->size = 0;
     } else {
       new = NULL;
@@ -68,19 +55,6 @@
     new->thumburi = gnome_thumbnail_factory_lookup (thumbs,
 						    escaped_path,
 						    info->mtime);
-    if (new->thumburi == NULL) {
-      gchar * md5sum;
-
-      md5sum = gnome_thumbnail_md5 (escaped_path);
-
-      new->thumburi = g_strconcat (g_get_home_dir (),
-				   "/.thumbnails/normal/",
-				   md5sum,
-				   ".png",
-				   NULL);
-
-      g_free (md5sum);
-    }
     new->name = g_strdup (info->name);
     new->mime_type = g_strdup (info->mime_type);
 


Index: control-center.spec
===================================================================
RCS file: /cvs/dist/rpms/control-center/devel/control-center.spec,v
retrieving revision 1.200
retrieving revision 1.201
diff -u -r1.200 -r1.201
--- control-center.spec	17 Nov 2006 15:24:04 -0000	1.200
+++ control-center.spec	17 Nov 2006 15:45:51 -0000	1.201
@@ -21,7 +21,7 @@
 Summary: GNOME Control Center
 Name: control-center
 Version: 2.17.1
-Release: 4%{?dist}
+Release: 5%{?dist}
 Epoch: 1
 License: GPL/LGPL
 Group: User Interface/Desktops
@@ -42,7 +42,7 @@
 Patch3: control-center-2.16.0-about-me-help.patch
 
 # http://bugzilla.gnome.org/show_bug.cgi?id=351991
-Patch4: control-center-2.15.91-fix-thumbnailing.patch
+Patch4: control-center-2.17.1-fix-thumbnailing.patch
 # http://bugzilla.gnome.org/show_bug.cgi?id=376045
 Patch5: control-center-2.15.91-compiz-support.patch
 # http://bugzilla.gnome.org/show_bug.cgi?id=133815
@@ -336,6 +336,9 @@
 %{_libdir}/pkgconfig/*
 
 %changelog
+* Fri Nov 17 2006 Ray Strode <rstrode at redhat.com> - 2.17.1-5
+- apply aforementioned thumbnail fixups
+
 * Fri Nov 17 2006 Ray Strode <rstrode at redhat.com> - 2.17.1-4
 - Drop unused/bogus patches
 - Try to fix up background capplet thumbnail code again (better this time)


--- control-center-2.15.91-fix-thumbnailing.patch DELETED ---




More information about the fedora-cvs-commits mailing list