anjuta r3809 - in branches/anjuta-2-4: . libanjuta plugins/file-loader



Author: jhs
Date: Wed Apr  2 09:53:40 2008
New Revision: 3809
URL: http://svn.gnome.org/viewvc/anjuta?rev=3809&view=rev

Log:
2008-04-02  Johannes Schmid  <jhs gnome org>

	* libanjuta/anjuta-utils.c (anjuta_util_get_uri_mime_type):
	* plugins/file-loader/plugin.c (get_available_plugins_for_mime),
	(open_with_dialog):
	
	Use gnome_vfs_get_slow_mime_type() to determine the mime-type and try
	supertype instead no plugin for mime-type was found (#525706)
	
	(backport from trunk)

Modified:
   branches/anjuta-2-4/ChangeLog
   branches/anjuta-2-4/libanjuta/anjuta-utils.c
   branches/anjuta-2-4/plugins/file-loader/plugin.c

Modified: branches/anjuta-2-4/libanjuta/anjuta-utils.c
==============================================================================
--- branches/anjuta-2-4/libanjuta/anjuta-utils.c	(original)
+++ branches/anjuta-2-4/libanjuta/anjuta-utils.c	Wed Apr  2 09:53:40 2008
@@ -998,7 +998,7 @@
 	 */
 	if (!path)
 	{
-		mime_type = gnome_vfs_get_mime_type (uri);
+		mime_type = gnome_vfs_get_slow_mime_type (uri);
 	}
 	else if (anjuta_util_path_has_extension (path, "anjuta"))
 	{
@@ -1018,7 +1018,7 @@
 	}
 	else
 	{
-		mime_type = gnome_vfs_get_mime_type (uri);
+		mime_type = gnome_vfs_get_slow_mime_type (uri);
 	}
 	
 	if (vfs_uri)

Modified: branches/anjuta-2-4/plugins/file-loader/plugin.c
==============================================================================
--- branches/anjuta-2-4/plugins/file-loader/plugin.c	(original)
+++ branches/anjuta-2-4/plugins/file-loader/plugin.c	Wed Apr  2 09:53:40 2008
@@ -20,6 +20,7 @@
 
 #include <config.h>
 #include <libgnomevfs/gnome-vfs-mime-utils.h>
+#include <libgnomevfs/gnome-vfs-mime.h>
 #include <libgnomevfs/gnome-vfs-mime-handlers.h>
 #include <libgnomevfs/gnome-vfs-ops.h>
 
@@ -122,6 +123,19 @@
 												"SupportedMimeTypes",
 												mime_type,
 												NULL);
+	if (!plugin_descs);
+	{
+		gchar* supertype = gnome_vfs_get_supertype_from_mime_type (mime_type);
+		plugin_descs = anjuta_plugin_manager_query (plugin_manager,
+												"Anjuta Plugin",
+												"Interfaces", "IAnjutaFile",
+												"File Loader",
+												"SupportedMimeTypes",
+												supertype,
+												NULL);
+		g_free (supertype);
+	}
+	
 	return plugin_descs;
 }
 
@@ -145,7 +159,7 @@
 								 "There is no plugin, default action, or application "
 								 "configured to handle this file type.\n"
 								 "\n"
-								 "Mime type: %s.\n"
+								 "Mime type: %s\n"
 								 "\n"
 								 "You may choose to try opening it with the following "
 								 "plugins or applications."),



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]