r11151 - in /desktop/unstable/nautilus/debian: changelog patches/13_thumbnail_size_pref.patch patches/series

joss at users.alioth.debian.org joss at users.alioth.debian.org
Sat May 26 21:59:49 UTC 2007


Author: joss
Date: Sat May 26 21:59:49 2007
New Revision: 11151

URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=11151
Log:
* 13_thumbnail_size_pref.patch: stolen from upstream SVN. Introduces a 
  preference to define the thumbnail size (closes: #425400).

Added:
    desktop/unstable/nautilus/debian/patches/13_thumbnail_size_pref.patch
Modified:
    desktop/unstable/nautilus/debian/changelog
    desktop/unstable/nautilus/debian/patches/series

Modified: desktop/unstable/nautilus/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/nautilus/debian/changelog?rev=11151&op=diff
==============================================================================
--- desktop/unstable/nautilus/debian/changelog (original)
+++ desktop/unstable/nautilus/debian/changelog Sat May 26 21:59:49 2007
@@ -3,8 +3,10 @@
   * 12_list-view_expand.patch: update the minimum width to 20
     characters.
   * Update watch file.
-
- -- Josselin Mouette <joss at debian.org>  Sun, 20 May 2007 02:50:12 +0200
+  * 13_thumbnail_size_pref.patch: stolen from upstream SVN. Introduces a 
+    preference to define the thumbnail size (closes: #425400).
+
+ -- Josselin Mouette <joss at debian.org>  Sat, 26 May 2007 23:58:12 +0200
 
 nautilus (2.18.1-3) unstable; urgency=low
 

Added: desktop/unstable/nautilus/debian/patches/13_thumbnail_size_pref.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/nautilus/debian/patches/13_thumbnail_size_pref.patch?rev=11151&op=file
==============================================================================
--- desktop/unstable/nautilus/debian/patches/13_thumbnail_size_pref.patch (added)
+++ desktop/unstable/nautilus/debian/patches/13_thumbnail_size_pref.patch Sat May 26 21:59:49 2007
@@ -1,0 +1,168 @@
+Index: nautilus-2.18.1/libnautilus-private/nautilus-icon-factory.c
+===================================================================
+--- nautilus-2.18.1.orig/libnautilus-private/nautilus-icon-factory.c	2007-04-10 14:06:07.000000000 +0200
++++ nautilus-2.18.1/libnautilus-private/nautilus-icon-factory.c	2007-05-26 23:57:30.733116000 +0200
+@@ -171,6 +171,7 @@
+ 
+ 
+ static int cached_thumbnail_limit;
++static int cached_thumbnail_size;
+ static int show_image_thumbs;
+ 
+ /* forward declarations */
+@@ -180,6 +181,7 @@
+ static void       nautilus_icon_factory_instance_init    (NautilusIconFactory      *factory);
+ static void       nautilus_icon_factory_finalize         (GObject                  *object);
+ static void       thumbnail_limit_changed_callback       (gpointer                  user_data);
++static void       thumbnail_size_changed_callback       (gpointer                  user_data);
+ static void       show_thumbnails_changed_callback       (gpointer                  user_data);
+ static void       mime_type_data_changed_callback        (GnomeVFSMIMEMonitor	   *monitor,
+ 							  gpointer                  user_data);
+@@ -210,6 +212,9 @@
+ 	eel_preferences_remove_callback (NAUTILUS_PREFERENCES_IMAGE_FILE_THUMBNAIL_LIMIT,
+ 					 thumbnail_limit_changed_callback,
+ 					 NULL);
++	eel_preferences_remove_callback (NAUTILUS_PREFERENCES_ICON_VIEW_THUMBNAIL_SIZE,
++					 thumbnail_size_changed_callback,
++					 NULL);
+ 	eel_preferences_remove_callback (NAUTILUS_PREFERENCES_SHOW_IMAGE_FILE_THUMBNAILS,
+ 					 show_thumbnails_changed_callback,
+ 					 NULL);
+@@ -231,6 +236,11 @@
+ 					      thumbnail_limit_changed_callback,
+ 					      NULL);
+ 
++		thumbnail_size_changed_callback (NULL);
++		eel_preferences_add_callback (NAUTILUS_PREFERENCES_ICON_VIEW_THUMBNAIL_SIZE,
++					      thumbnail_size_changed_callback,
++					      NULL);
++
+ 		show_thumbnails_changed_callback (NULL);
+ 		eel_preferences_add_callback (NAUTILUS_PREFERENCES_SHOW_IMAGE_FILE_THUMBNAILS,
+ 					      show_thumbnails_changed_callback,
+@@ -719,6 +729,20 @@
+ }
+ 
+ static void
++thumbnail_size_changed_callback (gpointer user_data)
++{
++	cached_thumbnail_size = eel_preferences_get_integer (NAUTILUS_PREFERENCES_ICON_VIEW_THUMBNAIL_SIZE);
++
++	/* Tell the world that icons might have changed. We could invent a narrower-scope
++	 * signal to mean only "thumbnails might have changed" if this ends up being slow
++	 * for some reason.
++	 */
++	nautilus_icon_factory_clear ();
++	g_signal_emit (global_icon_factory,
++			 signals[ICONS_CHANGED], 0);
++}
++
++static void
+ show_thumbnails_changed_callback (gpointer user_data)
+ {
+ 	show_image_thumbs = eel_preferences_get_enum (NAUTILUS_PREFERENCES_SHOW_IMAGE_FILE_THUMBNAILS);
+@@ -1163,7 +1187,7 @@
+ 
+ 		original_size = ceil (MAX (gdk_pixbuf_get_width (pixbuf) / *scale_x, gdk_pixbuf_get_height (pixbuf) / *scale_y));
+ 
+-		if ((is_thumbnail || (!force_nominal && base_size == 0 && original_size > NAUTILUS_ICON_SIZE_THUMBNAIL))
++		if ((is_thumbnail || (!force_nominal && base_size == 0 && original_size > cached_thumbnail_size))
+ 		     && !gdk_pixbuf_get_has_alpha (pixbuf)) {
+ 			add_frame = TRUE;
+ 		}
+Index: nautilus-2.18.1/libnautilus-private/apps_nautilus_preferences.schemas.in
+===================================================================
+--- nautilus-2.18.1.orig/libnautilus-private/apps_nautilus_preferences.schemas.in	2007-05-26 23:53:25.417784750 +0200
++++ nautilus-2.18.1/libnautilus-private/apps_nautilus_preferences.schemas.in	2007-05-26 23:57:30.733116000 +0200
+@@ -555,6 +555,20 @@
+       </locale>
+     </schema>
+ 
++    <schema>
++      <key>/schemas/apps/nautilus/icon_view/thumbnail_size</key>
++      <applyto>/apps/nautilus/icon_view/thumbnail_size</applyto>
++      <owner>nautilus</owner>
++      <type>int</type>
++      <default>96</default>
++      <locale name="C">
++         <short>Default Thumbnail Icon Size</short>
++         <long>
++             The default size of an icon for a thumbnail thumbnail in the icon view.
++         </long>
++      </locale>
++    </schema>    
++    
+     <!-- List View -->
+ 
+     <schema>
+Index: nautilus-2.18.1/libnautilus-private/nautilus-global-preferences.c
+===================================================================
+--- nautilus-2.18.1.orig/libnautilus-private/nautilus-global-preferences.c	2007-05-26 23:53:25.417784750 +0200
++++ nautilus-2.18.1/libnautilus-private/nautilus-global-preferences.c	2007-05-26 23:57:30.733116000 +0200
+@@ -444,7 +444,11 @@
+ 	  NULL, NULL,
+ 	  "default_zoom_level"
+ 	},
+-
++	{ NAUTILUS_PREFERENCES_ICON_VIEW_THUMBNAIL_SIZE,
++	  PREFERENCE_INTEGER,
++	  GINT_TO_POINTER (96)
++	},
++	
+ 	/* List View Default Preferences */
+ 	{ NAUTILUS_PREFERENCES_LIST_VIEW_DEFAULT_SORT_ORDER,
+ 	  PREFERENCE_STRING,
+Index: nautilus-2.18.1/libnautilus-private/nautilus-global-preferences.h
+===================================================================
+--- nautilus-2.18.1.orig/libnautilus-private/nautilus-global-preferences.h	2007-05-26 23:53:25.421785000 +0200
++++ nautilus-2.18.1/libnautilus-private/nautilus-global-preferences.h	2007-05-26 23:57:30.733116000 +0200
+@@ -131,6 +131,9 @@
+ /* Which text attributes appear beneath icon names */
+ #define NAUTILUS_PREFERENCES_ICON_VIEW_CAPTIONS				"icon_view/captions"
+ 
++/* The default size for thumbnail icons */
++#define NAUTILUS_PREFERENCES_ICON_VIEW_THUMBNAIL_SIZE			"icon_view/thumbnail_size"
++
+ /* List View */
+ #define NAUTILUS_PREFERENCES_LIST_VIEW_DEFAULT_SORT_IN_REVERSE_ORDER	"list_view/default_sort_in_reverse_order"
+ #define NAUTILUS_PREFERENCES_LIST_VIEW_DEFAULT_SORT_ORDER		"list_view/default_sort_order"
+Index: nautilus-2.18.1/libnautilus-private/nautilus-thumbnails.c
+===================================================================
+--- nautilus-2.18.1.orig/libnautilus-private/nautilus-thumbnails.c	2007-04-10 14:06:07.000000000 +0200
++++ nautilus-2.18.1/libnautilus-private/nautilus-thumbnails.c	2007-05-26 23:57:30.733116000 +0200
+@@ -96,6 +96,8 @@
+ 
+ static GnomeThumbnailFactory *thumbnail_factory = NULL;
+ 
++static int thumbnail_icon_size = 0;
++
+ static gboolean
+ get_file_mtime (const char *file_uri, time_t* mtime)
+ {
+@@ -290,10 +292,10 @@
+ 		args->base_size = size;                        
+ 	} else if (args->base_size == 0) {
+ 		if (args->is_thumbnail) {
+-			args->base_size = 128 * NAUTILUS_ICON_SIZE_STANDARD / NAUTILUS_ICON_SIZE_THUMBNAIL;
++			args->base_size = 128 * NAUTILUS_ICON_SIZE_STANDARD / thumbnail_icon_size;
+ 		} else {
+-			if (size > args->nominal_size * NAUTILUS_ICON_SIZE_THUMBNAIL / NAUTILUS_ICON_SIZE_STANDARD) {
+-				args->base_size = size * NAUTILUS_ICON_SIZE_STANDARD / NAUTILUS_ICON_SIZE_THUMBNAIL;
++			if (size > args->nominal_size * thumbnail_icon_size / NAUTILUS_ICON_SIZE_STANDARD) {
++				args->base_size = size * NAUTILUS_ICON_SIZE_STANDARD / thumbnail_icon_size;
+ 			} else if (size > NAUTILUS_ICON_SIZE_STANDARD) {
+ 				args->base_size = args->nominal_size;
+ 			} else {
+@@ -353,6 +355,12 @@
+ 
+ 	error = NULL;
+ 
++	if (thumbnail_icon_size == 0) {
++		eel_preferences_add_auto_integer (NAUTILUS_PREFERENCES_ICON_VIEW_THUMBNAIL_SIZE,
++						  &thumbnail_icon_size);
++	}
++
++	
+ 	if (!g_file_get_contents (path, (gchar **) &buffer, &buflen, &error)) {
+ 		g_message ("Failed to load %s into memory: %s", path, error->message);
+ 

Modified: desktop/unstable/nautilus/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/nautilus/debian/patches/series?rev=11151&op=diff
==============================================================================
--- desktop/unstable/nautilus/debian/patches/series (original)
+++ desktop/unstable/nautilus/debian/patches/series Sat May 26 21:59:49 2007
@@ -8,4 +8,5 @@
 10_location_titlebar.patch
 11_gnomevfs_query_eject.patch
 12_list-view_expand.patch
+13_thumbnail_size_pref.patch
 20_upstream_nautilus-dnd-user-owned.patch -p0




More information about the pkg-gnome-commits mailing list