public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [gentoo-commits] gentoo-x86 commit in gnome-base/nautilus/files: nautilus-2.26.3-thumbnail-zoom-level.patch nautilus-2.26.3-file-management-properties-ui-dup-id.patch
@ 2009-09-28 13:09 99% Romain Perier (mrpouet)
  0 siblings, 0 replies; 1+ results
From: Romain Perier (mrpouet) @ 2009-09-28 13:09 UTC (permalink / raw
  To: gentoo-commits

mrpouet     09/09/28 13:09:56

  Added:                nautilus-2.26.3-thumbnail-zoom-level.patch
                        nautilus-2.26.3-file-management-properties-ui-dup-id.patch
  Log:
  Version bump, which includes fix for duplicates id in nautilus-file-management-properties (bug #286312). Apply this fix to 2.26.3, import patch from upstream (see distributor ML) which fixes massive memory consumption by Nautilus for larger zoom levels.
  (Portage version: 2.2_rc42/cvs/Linux x86_64)

Revision  Changes    Path
1.1                  gnome-base/nautilus/files/nautilus-2.26.3-thumbnail-zoom-level.patch

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/gnome-base/nautilus/files/nautilus-2.26.3-thumbnail-zoom-level.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/gnome-base/nautilus/files/nautilus-2.26.3-thumbnail-zoom-level.patch?rev=1.1&content-type=text/plain

Index: nautilus-2.26.3-thumbnail-zoom-level.patch
===================================================================
From a8097e57788ad735227489e6c51d06bedc796889 Mon Sep 17 00:00:00 2001
From: Alexander Larsson <alexl@redhat.com>
Date: Fri, 18 Sep 2009 09:05:44 +0000
Subject: [PATCH] Do not load files for thumbnailing that we can not thumbnail anyway

When zooming out we read the real image and use that as the thumbnail. However, we should only do this for files gdk-pixbuf can read as other things can't be read anyway and may potentially be very large (such as videos) since the thumbnail size limit only applies for images. 

---
 libnautilus-private/nautilus-file.c       |    3 +-
 libnautilus-private/nautilus-thumbnails.c |   30 +++++++++++++++++++++++-----
 libnautilus-private/nautilus-thumbnails.h |    1 +
 3 files changed, 27 insertions(+), 7 deletions(-)

diff --git a/libnautilus-private/nautilus-file.c b/libnautilus-private/nautilus-file.c
index fb6d92b..a2a84f0 100644
--- a/libnautilus-private/nautilus-file.c
+++ b/libnautilus-private/nautilus-file.c
@@ -3588,7 +3588,8 @@ nautilus_file_get_icon (NautilusFile *file,
 			   since the zoom level 150% gives thumbnails at 144, which is
 			   ok to scale up from 128. */
 			if (modified_size > 128*1.25 &&
-			    !file->details->thumbnail_wants_original) {
+			    !file->details->thumbnail_wants_original &&
+			    nautilus_can_thumbnail_internally (file)) {
 				/* Invalidate if we resize upward */
 				file->details->thumbnail_wants_original = TRUE;
 				nautilus_file_invalidate_attributes (file, NAUTILUS_FILE_ATTRIBUTE_THUMBNAIL);
diff --git a/libnautilus-private/nautilus-thumbnails.c b/libnautilus-private/nautilus-thumbnails.c
index f064135..2a3fede 100644
--- a/libnautilus-private/nautilus-thumbnails.c
+++ b/libnautilus-private/nautilus-thumbnails.c
@@ -765,17 +765,35 @@ get_types_table (void)
 	return image_mime_types;
 }
 
-gboolean
-nautilus_thumbnail_is_mimetype_limited_by_size (const char *mime_type)
+static gboolean
+pixbuf_can_load_type (const char *mime_type)
 {
 	GHashTable *image_mime_types;
-	
+
 	image_mime_types = get_types_table ();
-        if (g_hash_table_lookup (image_mime_types, mime_type)) {
-                return TRUE;
+	if (g_hash_table_lookup (image_mime_types, mime_type)) {
+		return TRUE;
 	}
 
-        return FALSE;
+	return FALSE;
+}
+
+gboolean
+nautilus_can_thumbnail_internally (NautilusFile *file)
+{
+	char *mime_type;
+	gboolean res;
+
+	mime_type = nautilus_file_get_mime_type (file);
+	res = pixbuf_can_load_type (mime_type);
+	g_free (mime_type);
+	return res;
+}
+
+gboolean
+nautilus_thumbnail_is_mimetype_limited_by_size (const char *mime_type)
+{
+	return pixbuf_can_load_type (mime_type);
 }
 
 gboolean
diff --git a/libnautilus-private/nautilus-thumbnails.h b/libnautilus-private/nautilus-thumbnails.h
index 82007ba..715133b 100644
--- a/libnautilus-private/nautilus-thumbnails.h
+++ b/libnautilus-private/nautilus-thumbnails.h
@@ -46,6 +46,7 @@ typedef void (* NautilusThumbnailAsyncLoadFunc) (NautilusThumbnailAsyncLoadHandl
 /* Returns NULL if there's no thumbnail yet. */
 void       nautilus_create_thumbnail                (NautilusFile *file);
 gboolean   nautilus_can_thumbnail                   (NautilusFile *file);
+gboolean   nautilus_can_thumbnail_internally        (NautilusFile *file);
 gboolean   nautilus_has_valid_failed_thumbnail      (NautilusFile *file);
 gboolean   nautilus_thumbnail_is_mimetype_limited_by_size
 						    (const char *mime_type);
-- 
1.6.5.rc1




1.1                  gnome-base/nautilus/files/nautilus-2.26.3-file-management-properties-ui-dup-id.patch

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/gnome-base/nautilus/files/nautilus-2.26.3-file-management-properties-ui-dup-id.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/gnome-base/nautilus/files/nautilus-2.26.3-file-management-properties-ui-dup-id.patch?rev=1.1&content-type=text/plain

Index: nautilus-2.26.3-file-management-properties-ui-dup-id.patch
===================================================================
From bf6bfde36bcadf43a39fb095650b7fc78741d62a Mon Sep 17 00:00:00 2001
From: Matthias Clasen <mclasen@redhat.com>
Date: Thu, 27 Aug 2009 00:05:28 +0000
Subject: Fix a duplicate id in a .ui file

This caused nautilus-file-management-properties to crash.
---
diff --git a/src/nautilus-file-management-properties.ui b/src/nautilus-file-management-properties.ui
index eae16d1..c4fb6ee 100644
--- a/src/nautilus-file-management-properties.ui
+++ b/src/nautilus-file-management-properties.ui
@@ -1128,7 +1128,7 @@
                               </packing>
                             </child>
                             <child>
-                              <object class="GtkLabel" id="label">
+                              <object class="GtkLabel" id="label99">
                                 <property name="height_request">6</property>
                                 <property name="visible">True</property>
                                 <property name="label" translatable="yes"/>
--
cgit v0.8.2






^ permalink raw reply related	[relevance 99%]

Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2009-09-28 13:09 99% [gentoo-commits] gentoo-x86 commit in gnome-base/nautilus/files: nautilus-2.26.3-thumbnail-zoom-level.patch nautilus-2.26.3-file-management-properties-ui-dup-id.patch Romain Perier (mrpouet)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox