summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathieu Lacage <mathieu@eazel.om>2000-11-17 23:16:35 +0000
committerMathieu Lacage <mathieu@src.gnome.org>2000-11-17 23:16:35 +0000
commit8cc84c8481887f82836d124916ba852386544a98 (patch)
tree9152fbeddc3aa1d5d453fb5d61b2ccc9eca2b7fe
parentf7e57b538c48e7b2bb490beac9ffeff62fc0a4c9 (diff)
downloadnautilus-8cc84c8481887f82836d124916ba852386544a98.tar.gz
reviewed by: Sullivan
2000-11-17 Mathieu Lacage <mathieu@eazel.om> reviewed by: Sullivan update nautilus to the latest gnome-vfs mime/type icon handling. * libnautilus-extensions/nautilus-icon-factory.c: (nautilus_icon_factory_get_icon_name_for_regular_file): use gnome_vfs_mime_get_icon instead of the raw get_value call. (get_themed_icon_file_path): if cannot find the pixmap through the standard theme code, fallback on gnome-vfs to find the icon. (get_icon_file_path): beautification. (nautilus_scalable_icon_new_from_text_pieces): idem.
-rw-r--r--ChangeLog13
-rw-r--r--libnautilus-extensions/nautilus-icon-factory.c17
-rw-r--r--libnautilus-private/nautilus-icon-factory.c17
3 files changed, 35 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index aca93fcb4..5c7ce0e71 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2000-11-17 Mathieu Lacage <mathieu@eazel.om>
+
+ reviewed by: Sullivan
+
+ update nautilus to the latest gnome-vfs mime/type icon handling.
+ * libnautilus-extensions/nautilus-icon-factory.c:
+ (nautilus_icon_factory_get_icon_name_for_regular_file): use
+ gnome_vfs_mime_get_icon instead of the raw get_value call.
+ (get_themed_icon_file_path): if cannot find the pixmap through
+ the standard theme code, fallback on gnome-vfs to find the icon.
+ (get_icon_file_path): beautification.
+ (nautilus_scalable_icon_new_from_text_pieces): idem.
+
2000-11-17 John Sullivan <sullivan@eazel.com>
reviewed by: Mathieu Lacage <mathieu@eazel.com>
diff --git a/libnautilus-extensions/nautilus-icon-factory.c b/libnautilus-extensions/nautilus-icon-factory.c
index 10592fd4f..88c92b5d0 100644
--- a/libnautilus-extensions/nautilus-icon-factory.c
+++ b/libnautilus-extensions/nautilus-icon-factory.c
@@ -52,6 +52,7 @@
#include <libgnome/gnome-util.h>
#include <libgnomevfs/gnome-vfs-file-info.h>
#include <libgnomevfs/gnome-vfs-mime-info.h>
+#include <libgnomevfs/gnome-vfs-mime-handlers.h>
#include <libgnomevfs/gnome-vfs-types.h>
#include <libnautilus-extensions/nautilus-gdk-pixbuf-extensions.h>
#include <librsvg/rsvg.h>
@@ -735,7 +736,7 @@ nautilus_icon_factory_get_icon_name_for_regular_file (NautilusFile *file)
is_text_file = mime_type != NULL && !nautilus_strcasecmp (mime_type, "text/plain");
if (mime_type != NULL && !is_text_file) {
- icon_name = gnome_vfs_mime_get_value (mime_type, "icon-filename");
+ icon_name = gnome_vfs_mime_get_icon (mime_type);
if (icon_name != NULL) {
g_free (mime_type);
return icon_name;
@@ -995,6 +996,10 @@ get_themed_icon_file_path (const char *theme_name,
}
g_free (themed_icon_name);
+ if (path == NULL) {
+ path = gnome_vfs_icon_path_from_filename (icon_name);
+ }
+
return path;
}
@@ -1038,10 +1043,10 @@ get_icon_file_path (const char *name,
g_free (path);
} else if (icon_factory->default_theme_name != NULL) {
path = get_themed_icon_file_path (icon_factory->default_theme_name,
- name,
- NAUTILUS_ICON_SIZE_STANDARD,
- aa_mode,
- details);
+ name,
+ NAUTILUS_ICON_SIZE_STANDARD,
+ aa_mode,
+ details);
if (path != NULL) {
theme_to_use = icon_factory->default_theme_name;
g_free (path);
@@ -1142,7 +1147,7 @@ nautilus_scalable_icon_new_from_text_pieces (const char *uri,
}
/* Get at the hash table. */
- hash_table = get_icon_factory ()->scalable_icons;
+ hash_table = factory->scalable_icons;
/* Check to see if it's already in the table. */
cache_key.uri = (char *) uri;
diff --git a/libnautilus-private/nautilus-icon-factory.c b/libnautilus-private/nautilus-icon-factory.c
index 10592fd4f..88c92b5d0 100644
--- a/libnautilus-private/nautilus-icon-factory.c
+++ b/libnautilus-private/nautilus-icon-factory.c
@@ -52,6 +52,7 @@
#include <libgnome/gnome-util.h>
#include <libgnomevfs/gnome-vfs-file-info.h>
#include <libgnomevfs/gnome-vfs-mime-info.h>
+#include <libgnomevfs/gnome-vfs-mime-handlers.h>
#include <libgnomevfs/gnome-vfs-types.h>
#include <libnautilus-extensions/nautilus-gdk-pixbuf-extensions.h>
#include <librsvg/rsvg.h>
@@ -735,7 +736,7 @@ nautilus_icon_factory_get_icon_name_for_regular_file (NautilusFile *file)
is_text_file = mime_type != NULL && !nautilus_strcasecmp (mime_type, "text/plain");
if (mime_type != NULL && !is_text_file) {
- icon_name = gnome_vfs_mime_get_value (mime_type, "icon-filename");
+ icon_name = gnome_vfs_mime_get_icon (mime_type);
if (icon_name != NULL) {
g_free (mime_type);
return icon_name;
@@ -995,6 +996,10 @@ get_themed_icon_file_path (const char *theme_name,
}
g_free (themed_icon_name);
+ if (path == NULL) {
+ path = gnome_vfs_icon_path_from_filename (icon_name);
+ }
+
return path;
}
@@ -1038,10 +1043,10 @@ get_icon_file_path (const char *name,
g_free (path);
} else if (icon_factory->default_theme_name != NULL) {
path = get_themed_icon_file_path (icon_factory->default_theme_name,
- name,
- NAUTILUS_ICON_SIZE_STANDARD,
- aa_mode,
- details);
+ name,
+ NAUTILUS_ICON_SIZE_STANDARD,
+ aa_mode,
+ details);
if (path != NULL) {
theme_to_use = icon_factory->default_theme_name;
g_free (path);
@@ -1142,7 +1147,7 @@ nautilus_scalable_icon_new_from_text_pieces (const char *uri,
}
/* Get at the hash table. */
- hash_table = get_icon_factory ()->scalable_icons;
+ hash_table = factory->scalable_icons;
/* Check to see if it's already in the table. */
cache_key.uri = (char *) uri;