summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorDave Camp <dave@ximian.com>2003-03-14 21:28:51 +0000
committerDave Camp <campd@src.gnome.org>2003-03-14 21:28:51 +0000
commit0d69f015bbba23a97b5d7f879611c8aab9e4de8a (patch)
tree89232c841121e283447abe139e31b5c994527965 /components
parent67f3531bd50d752125705162bb58d0d05cae0444 (diff)
downloadnautilus-0d69f015bbba23a97b5d7f879611c8aab9e4de8a.tar.gz
Recompute the mime type and passit to the stream's load method.
2003-03-14 Dave Camp <dave@ximian.com> * components/adapter/nautilus-adapter-stream-load-strategy.c (nautilus_adapter_stream_load_strategy_load_location): Recompute the mime type and passit to the stream's load method.
Diffstat (limited to 'components')
-rw-r--r--components/adapter/nautilus-adapter-stream-load-strategy.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/components/adapter/nautilus-adapter-stream-load-strategy.c b/components/adapter/nautilus-adapter-stream-load-strategy.c
index 1fb619634..37cf7552f 100644
--- a/components/adapter/nautilus-adapter-stream-load-strategy.c
+++ b/components/adapter/nautilus-adapter-stream-load-strategy.c
@@ -40,6 +40,7 @@
#include <eel/eel-gtk-macros.h>
#include <libnautilus/nautilus-view.h>
#include <libgnomevfs/gnome-vfs-utils.h>
+#include <libgnomevfs/gnome-vfs-mime-utils.h>
struct NautilusAdapterStreamLoadStrategyDetails {
Bonobo_PersistStream persist_stream;
@@ -172,16 +173,12 @@ nautilus_adapter_stream_load_strategy_load_location (NautilusAdapterLoadStrategy
if (BONOBO_EX (&ev) || CORBA_Object_is_nil (stream, &ev)) {
nautilus_adapter_load_strategy_report_load_failed (abstract_strategy);
} else {
- /* FIXME bugzilla.gnome.org 41248:
- * Dan Winship points out that we should pass the
- * MIME type here to work with new implementers of
- * PersistStream that pay attention to the MIME type. It
- * doesn't matter right now, but we should fix it
- * eventually. Currently, we don't store the MIME type, but
- * it should be easy to keep it around and pass it in here.
- */
-
- mime_type = "";
+ /* This adds an extra sniffing, which is a bit of a problem.
+ * We think this is ok, since it is relatively cheap and
+ * the adapter isn't used often. When the adapter is
+ * moved into the nautilus process, this should use the
+ * mime type from the NautilusFile. */
+ mime_type = gnome_vfs_get_mime_type (uri);
args [0] = &stream;
args [1] = &mime_type;
@@ -192,6 +189,8 @@ nautilus_adapter_stream_load_strategy_load_location (NautilusAdapterLoadStrategy
args,
unref_stream_cb,
stream);
+
+ g_free (mime_type);
}
g_object_unref (strategy);