Add g_file_query_default_handler utility to easily look up the GAppInfo

2008-01-29  Alexander Larsson  <alexl@redhat.com>

        * gfile.[ch]:
        Add g_file_query_default_handler utility to easily look up
	the GAppInfo that handles a file.
	
        * gdesktopappinfo.[ch]:
        * giomodule.c:
	Set up an extension point for g_app_info_get_default_for_uri_scheme()
	
        * gvfs.c:
	Remove unused function



svn path=/trunk/; revision=6409
This commit is contained in:
Alexander Larsson
2008-01-29 12:18:48 +00:00
committed by Alexander Larsson
parent 1b0fce2dca
commit 431fef8617
7 changed files with 209 additions and 46 deletions

View File

@@ -167,46 +167,6 @@ g_vfs_parse_name (GVfs *vfs,
return (* class->parse_name) (vfs, parse_name);
}
/* Note: This compares in reverse order.
Higher prio -> sort first
*/
static gint
compare_vfs_type (gconstpointer a,
gconstpointer b,
gpointer user_data)
{
GType a_type, b_type;
char *a_name, *b_name;
int a_prio, b_prio;
gint res;
const char *use_this_monitor;
GQuark private_q, name_q;
private_q = g_quark_from_static_string ("gio-prio");
name_q = g_quark_from_static_string ("gio-name");
use_this_monitor = user_data;
a_type = *(GType *)a;
b_type = *(GType *)b;
a_prio = GPOINTER_TO_INT (g_type_get_qdata (a_type, private_q));
a_name = g_type_get_qdata (a_type, name_q);
b_prio = GPOINTER_TO_INT (g_type_get_qdata (b_type, private_q));
b_name = g_type_get_qdata (b_type, name_q);
if (a_type == b_type)
res = 0;
else if (use_this_monitor != NULL &&
strcmp (a_name, use_this_monitor) == 0)
res = -1;
else if (use_this_monitor != NULL &&
strcmp (b_name, use_this_monitor) == 0)
res = 1;
else
res = b_prio - a_prio;
return res;
}
static gpointer
get_default_vfs (gpointer arg)
{