summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Hertzfeld <andy@src.gnome.org>2001-02-15 02:44:08 +0000
committerAndy Hertzfeld <andy@src.gnome.org>2001-02-15 02:44:08 +0000
commit4a96ffc90684287800f228da7be090ff1c3dd9d6 (patch)
treebfe3c71a11d3b8590184ee8e16be9dfe985f3905
parent55c6a202d01286b3d62e1f321a2dd0ec8f330309 (diff)
downloadnautilus-4a96ffc90684287800f228da7be090ff1c3dd9d6.tar.gz
fixed bug 6623, .fig files cause warnings to spew, by checking for types
* libnautilus-extensions/nautilus-icon-factory.c: (is_supported_mime_type), (nautilus_icon_factory_get_icon_for_file): fixed bug 6623, .fig files cause warnings to spew, by checking for types that we don't support and excluding them from thumbnailing.
-rw-r--r--ChangeLog8
-rw-r--r--libnautilus-extensions/nautilus-icon-factory.c14
-rw-r--r--libnautilus-private/nautilus-icon-factory.c14
3 files changed, 36 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 03b6f50fd..e5151fb92 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2001-02-14 Andy Hertzfeld <andy@eazel.com>
+
+ * libnautilus-extensions/nautilus-icon-factory.c:
+ (is_supported_mime_type),
+ (nautilus_icon_factory_get_icon_for_file):
+ fixed bug 6623, .fig files cause warnings to spew, by checking for
+ types that we don't support and excluding them from thumbnailing.
+
2001-02-14 John Fleck <jfleck@inkstain.net>
reviewed by: Ali Abdin <aliabdin@aucegypt.edu>
diff --git a/libnautilus-extensions/nautilus-icon-factory.c b/libnautilus-extensions/nautilus-icon-factory.c
index 8cd4b1d4b..5d447a02d 100644
--- a/libnautilus-extensions/nautilus-icon-factory.c
+++ b/libnautilus-extensions/nautilus-icon-factory.c
@@ -1343,6 +1343,19 @@ should_display_image_file_as_itself (NautilusFile *file, gboolean anti_aliased)
return nautilus_file_is_local (file);
}
+/* return TRUE if the passed-in mime-type is one that we can thumbnail. It's
+ * used to exclude ones that we know will generate errors if we tried them.
+ */
+static gboolean
+is_supported_mime_type (const char *mime_type)
+{
+ /* exclude xfig images, since we can't handle them */
+ if (nautilus_strcmp (mime_type, "image/x-xfig") == 0) {
+ return FALSE;
+ }
+ return TRUE;
+}
+
/* key routine to get the scalable icon for a file */
NautilusScalableIcon *
nautilus_icon_factory_get_icon_for_file (NautilusFile *file, const char *modifier, gboolean anti_aliased)
@@ -1372,6 +1385,7 @@ nautilus_icon_factory_get_icon_for_file (NautilusFile *file, const char *modifie
file_size = nautilus_file_get_size (file);
if (nautilus_istr_has_prefix (mime_type, "image/")
+ && is_supported_mime_type (mime_type)
&& should_display_image_file_as_itself (file, anti_aliased)) {
if (file_size < SELF_THUMBNAIL_SIZE_THRESHOLD && is_local) {
uri = nautilus_file_get_uri (file);
diff --git a/libnautilus-private/nautilus-icon-factory.c b/libnautilus-private/nautilus-icon-factory.c
index 8cd4b1d4b..5d447a02d 100644
--- a/libnautilus-private/nautilus-icon-factory.c
+++ b/libnautilus-private/nautilus-icon-factory.c
@@ -1343,6 +1343,19 @@ should_display_image_file_as_itself (NautilusFile *file, gboolean anti_aliased)
return nautilus_file_is_local (file);
}
+/* return TRUE if the passed-in mime-type is one that we can thumbnail. It's
+ * used to exclude ones that we know will generate errors if we tried them.
+ */
+static gboolean
+is_supported_mime_type (const char *mime_type)
+{
+ /* exclude xfig images, since we can't handle them */
+ if (nautilus_strcmp (mime_type, "image/x-xfig") == 0) {
+ return FALSE;
+ }
+ return TRUE;
+}
+
/* key routine to get the scalable icon for a file */
NautilusScalableIcon *
nautilus_icon_factory_get_icon_for_file (NautilusFile *file, const char *modifier, gboolean anti_aliased)
@@ -1372,6 +1385,7 @@ nautilus_icon_factory_get_icon_for_file (NautilusFile *file, const char *modifie
file_size = nautilus_file_get_size (file);
if (nautilus_istr_has_prefix (mime_type, "image/")
+ && is_supported_mime_type (mime_type)
&& should_display_image_file_as_itself (file, anti_aliased)) {
if (file_size < SELF_THUMBNAIL_SIZE_THRESHOLD && is_local) {
uri = nautilus_file_get_uri (file);