2000-06-01 06:00:19 +00:00
|
|
|
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
|
|
|
|
/* test-mime.c - Test for the mime handler detection features of the GNOME
|
|
|
|
Virtual File System Library
|
|
|
|
|
|
|
|
Copyright (C) 2000 Eazel
|
|
|
|
|
|
|
|
The Gnome Library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Library General Public License as
|
|
|
|
published by the Free Software Foundation; either version 2 of the
|
|
|
|
License, or (at your option) any later version.
|
|
|
|
|
|
|
|
The Gnome Library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Library General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Library General Public
|
|
|
|
License along with the Gnome Library; see the file COPYING.LIB. If not,
|
|
|
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
Boston, MA 02111-1307, USA.
|
|
|
|
|
|
|
|
Author: Maciej Stachowiak <mjs@eazel.com>
|
|
|
|
*/
|
2000-11-08 01:11:33 +00:00
|
|
|
|
2000-06-01 06:00:19 +00:00
|
|
|
#include <config.h>
|
|
|
|
|
2000-11-08 01:11:33 +00:00
|
|
|
#include <gnome.h>
|
2000-06-01 06:00:19 +00:00
|
|
|
#include <libgnomevfs/gnome-vfs-mime-handlers.h>
|
2000-11-08 01:11:33 +00:00
|
|
|
#include <libgnomevfs/gnome-vfs.h>
|
2000-06-01 06:00:19 +00:00
|
|
|
#include <libnautilus-extensions/nautilus-mime-actions.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
2000-11-08 01:11:33 +00:00
|
|
|
static gboolean ready = FALSE;
|
|
|
|
|
2001-01-26 23:16:59 +00:00
|
|
|
|
|
|
|
static void
|
|
|
|
append_comma_and_scheme (gpointer scheme,
|
|
|
|
gpointer user_data)
|
|
|
|
{
|
|
|
|
char **string;
|
|
|
|
|
|
|
|
string = (char **) user_data;
|
|
|
|
if (strlen (*string) > 0) {
|
|
|
|
*string = g_strconcat (*string, ", ", scheme, NULL);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
*string = g_strdup (scheme);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static char *
|
|
|
|
format_supported_uri_schemes_for_display (GList *supported_uri_schemes)
|
|
|
|
{
|
|
|
|
char *string;
|
|
|
|
|
|
|
|
string = g_strdup ("");
|
|
|
|
g_list_foreach (supported_uri_schemes,
|
|
|
|
append_comma_and_scheme,
|
|
|
|
&string);
|
|
|
|
return string;
|
|
|
|
}
|
|
|
|
|
2000-06-01 06:00:19 +00:00
|
|
|
static void
|
|
|
|
print_application (GnomeVFSMimeApplication *application)
|
|
|
|
{
|
|
|
|
if (application == NULL) {
|
|
|
|
puts ("(none)");
|
|
|
|
} else {
|
2001-01-26 23:16:59 +00:00
|
|
|
printf ("name: %s\ncommand: %s\ncan_open_multiple_files: %s\nexpects_uris: %s\nsupported_uri_schemes: %s\nrequires_terminal: %s\n",
|
2000-06-01 06:00:19 +00:00
|
|
|
application->name, application->command,
|
|
|
|
(application->can_open_multiple_files ? "TRUE" : "FALSE"),
|
2001-01-26 23:16:59 +00:00
|
|
|
(application->expects_uris ? "TRUE" : "FALSE"),
|
|
|
|
format_supported_uri_schemes_for_display (application->supported_uri_schemes),
|
2000-06-01 12:11:54 +00:00
|
|
|
(application->requires_terminal ? "TRUE" : "FALSE"));
|
2000-06-01 06:00:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
print_component (OAF_ServerInfo *component)
|
|
|
|
{
|
|
|
|
if (component == NULL) {
|
|
|
|
puts ("(none)");
|
|
|
|
} else {
|
|
|
|
printf ("iid: %s\n", component->iid);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
print_action (GnomeVFSMimeAction *action)
|
|
|
|
{
|
|
|
|
if (action == NULL) {
|
|
|
|
puts ("(none)");
|
|
|
|
} else {
|
2000-11-08 01:11:33 +00:00
|
|
|
if (action->action_type == GNOME_VFS_MIME_ACTION_TYPE_APPLICATION) {
|
|
|
|
puts ("type: application");
|
|
|
|
print_application (action->action.application);
|
|
|
|
} else {
|
|
|
|
puts ("type: component");
|
|
|
|
print_component (action->action.component);
|
|
|
|
}
|
2000-06-01 06:00:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
print_component_list (GList *components)
|
|
|
|
{
|
2000-11-08 01:11:33 +00:00
|
|
|
GList *p;
|
|
|
|
|
|
|
|
if (components == NULL) {
|
|
|
|
puts ("(none)");
|
|
|
|
} else {
|
|
|
|
for (p = components; p != NULL; p = p->next) {
|
|
|
|
print_component (p->data);
|
|
|
|
puts ("------");
|
|
|
|
}
|
|
|
|
}
|
2000-06-01 06:00:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
print_application_list (GList *applications)
|
|
|
|
{
|
2000-11-08 01:11:33 +00:00
|
|
|
GList *p;
|
|
|
|
|
|
|
|
if (applications == NULL) {
|
|
|
|
puts ("(none)");
|
|
|
|
} else {
|
|
|
|
for (p = applications; p != NULL; p = p->next) {
|
|
|
|
print_application (p->data);
|
|
|
|
puts ("------");
|
|
|
|
}
|
|
|
|
}
|
2000-06-01 06:00:19 +00:00
|
|
|
}
|
|
|
|
|
2000-11-08 01:11:33 +00:00
|
|
|
static void
|
|
|
|
ready_callback (NautilusFile *file,
|
|
|
|
gpointer callback_data)
|
|
|
|
{
|
|
|
|
ready = TRUE;
|
|
|
|
}
|
2000-06-01 06:00:19 +00:00
|
|
|
|
|
|
|
int
|
|
|
|
main (int argc, char **argv)
|
|
|
|
{
|
|
|
|
const char *uri;
|
|
|
|
GnomeVFSMimeApplication *default_application;
|
|
|
|
OAF_ServerInfo *default_component;
|
|
|
|
GnomeVFSMimeAction *default_action;
|
|
|
|
GList *all_components;
|
|
|
|
GList *all_applications;
|
|
|
|
GList *short_list_components;
|
|
|
|
GList *short_list_applications;
|
Rename NAUTILUS_FILE_ATTRIBUTE_FAST_MIME_TYPE to
* libnautilus-extensions/nautilus-file-attributes.h: Rename
NAUTILUS_FILE_ATTRIBUTE_FAST_MIME_TYPE to
NAUTILUS_FILE_ATTRIBUTE_MIME_TYPE; add
NAUTILUS_FILE_ATTRIBUTE_SLOW_MIME_TYPE, for now just a synonym for
NAUTILUS_FILE_ATTRIBUTE_MIME_TYPE.
* libnautilus-extensions/nautilus-directory-async.c:
(set_up_request_by_file_attributes): Handle the new file
attributes.
* libnautilus-extensions/nautilus-directory.h: move
nautilus_directory_wait_until_ready call to
nautilus-wait-until-ready.h
* libnautilus-extensions/nautilus-directory.c:
(nautilus_self_check_directory): Include
nautilus-wait-until-ready.h, use new attributes.
* libnautilus-extensions/nautilus-wait-until-ready.h: New header
for the deprecated wait_until_ready calls.
* libnautilus-extensions/nautilus-file.c:
(nautilus_file_wait_until_ready): file equivalent of
nautilus_directory_wait_until_ready; temporary to help me
refactor.
(file_wait_until_ready_callback): helper function.
* libnautilus-extensions/Makefile.am: Add
nautilus-wait-until-ready.h
* libnautilus-extensions/nautilus-icon-factory.c:
(nautilus_icon_factory_get_required_file_attributes): Use new
attribute for mime type.
* libnautilus-extensions/nautilus-mime-actions.h,
libnautilus-extensions/nautilus-mime-actions.c:
(nautilus_mime_get_default_action_type_for_uri),
(nautilus_mime_get_default_action_for_uri),
(nautilus_mime_get_default_application_for_uri_internal),
(nautilus_mime_get_default_application_for_uri),
(nautilus_mime_is_default_application_for_uri_user_chosen),
(nautilus_mime_get_default_component_for_uri_internal),
(nautilus_mime_get_default_component_for_uri),
(nautilus_mime_is_default_component_for_uri_user_chosen),
(nautilus_mime_get_short_list_applications_for_uri),
(nautilus_mime_get_short_list_components_for_uri),
(nautilus_mime_get_short_list_methods_for_uri),
(nautilus_mime_get_all_applications_for_uri),
(nautilus_mime_has_any_applications_for_uri),
(nautilus_mime_get_all_components_for_uri),
(nautilus_mime_has_any_components_for_uri),
(nautilus_mime_set_default_action_type_for_uri),
(nautilus_mime_set_default_application_for_uri),
(nautilus_mime_set_default_component_for_uri),
(nautilus_mime_set_short_list_applications_for_uri),
(nautilus_mime_set_short_list_components_for_uri),
(nautilus_mime_add_application_to_short_list_for_uri),
(nautilus_mime_remove_application_from_short_list_for_uri),
(nautilus_mime_add_component_to_short_list_for_uri),
(nautilus_mime_remove_component_from_short_list_for_uri),
(nautilus_mime_extend_all_applications_for_uri),
(nautilus_mime_remove_from_all_applications_for_uri): All these
functions now take a NautilusDirectory and a NautilusFile, rather
than a URI.
(gnome_vfs_mime_application_has_id),
(gnome_vfs_mime_id_matches_application),
(gnome_vfs_mime_application_has_id_not_in_list),
(string_not_in_list), (extract_prefix_add_suffix),
(make_oaf_query_with_known_mime_type),
(make_oaf_query_with_uri_scheme_only), (free_key),
(server_matches_content_requirements),
(nautilus_do_component_query), (str_list_difference),
(strv_concat): Reformatted.
(get_mime_type_from_file): Changed from get_mime_type_from_uri;
uses nautilus_file_wait_until_ready instead of synchronous I/O.
* libnautilus-extensions/nautilus-program-chooser.c:
(repopulate_program_list), (is_application_default_for_uri),
(is_component_default_for_uri),
(is_component_in_short_list_for_uri),
(is_application_in_short_list_for_uri),
(program_file_pair_is_default_for_file),
(add_to_short_list_for_file), (remove_from_short_list_for_file),
(remove_default_for_item), (set_default_for_item):
* libnautilus-extensions/nautilus-program-choosing.c:
(any_programs_available_for_file):
* libnautilus-extensions/nautilus-wait-until-ready.h:
* src/file-manager/fm-directory-view.c: (switch_location_and_view),
(create_open_with_gtk_menu), (reset_bonobo_open_with_menu),
(activate_callback):
* src/nautilus-applicable-views.c: (got_file_info_callback),
(nautilus_navigation_info_new), (nautilus_navigation_info_free):
* src/nautilus-applicable-views.h:
* src/nautilus-sidebar.c: (nautilus_sidebar_update_buttons):
* src/nautilus-theme-selector.c: (add_theme_to_icons):
* src/nautilus-window.c: (nautilus_window_switch_views),
(nautilus_window_load_content_view_menu):
* test/test-nautilus-mime-actions-set.c: (main):
* test/test-nautilus-mime-actions.c: (main): Deal with above API changes.
2000-09-27 22:00:49 +00:00
|
|
|
NautilusFile *file;
|
2000-11-08 01:11:33 +00:00
|
|
|
GList *attributes;
|
2000-06-01 06:00:19 +00:00
|
|
|
|
|
|
|
g_thread_init (NULL);
|
|
|
|
gnome_vfs_init ();
|
2001-02-02 03:52:20 +00:00
|
|
|
|
|
|
|
gnomelib_register_popt_table (oaf_popt_options, oaf_get_popt_table_name ());
|
|
|
|
oaf_init (argc, argv);
|
Non-asynchronous equivalent of `nautilus_directory_call_when_ready'.
* libnautilus-extensions/nautilus-directory.h,
libnautilus-extensions/nautilus-directory.c:
(nautilus_directory_wait_until_ready): Non-asynchronous equivalent
of `nautilus_directory_call_when_ready'. However, it doesn't block
the UI while waiting.
(nautilus_directory_wait_until_ready_callback): Helper function
for implementing the above.
* libnautilus-extensions/nautilus-mime-actions.c:
(nautilus_mime_get_default_action_type_for_uri,
nautilus_mime_get_default_action_for_uri,
nautilus_mime_get_default_application_for_uri,
nautilus_mime_get_default_component_for_uri): Implemented with
fully with proper metadata checking and interface querying, etc.
(nautilus_mime_get_short_list_applications_for_uri,
nautilus_mime_get_short_list_components_for_uri,
nautilus_mime_get_all_applications_for_uri,
nautilus_mime_get_all_components_for_uri): Adjusted to deal with
the mime type checking function changing names.
(OAF_ServerInfo__copy, extract_prefix_add_suffix,
mime_type_get_supertype, uri_string_get_scheme),
get_explicit_content_view_iids_from_metafile,
make_oaf_query_for_explicit_content_view_iids,
make_oaf_query_with_known_mime_type,
make_oaf_query_with_uri_scheme_only,
file_list_to_mime_type_hash_table, free_key,
mime_type_hash_table_destroy, server_matches_content_requirements,
nautilus_do_component_query): Oodles of helper functions, many cut
& pasted from elswhere and only slightly modified.
get_mime_type_from_uri: Removed `_hack' from the name.
* libnautilus-extensions/nautilus-mime-actions.h: Added prototype
for nautilus_mime_get_default_action_type_for_uri.
* test/test-nautilus-mime-actions.c (main): Call gnome_init.
* src/nautilus-applicable-views.c: Removed a stray comment that no
longer applies.
2000-06-01 12:11:54 +00:00
|
|
|
gnome_init("test-nautilus-mime-actions", "0.0",
|
|
|
|
argc, argv);
|
2000-06-01 06:00:19 +00:00
|
|
|
|
|
|
|
if (argc != 2) {
|
|
|
|
fprintf (stderr, "Usage: %s uri\n", *argv);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
uri = argv[1];
|
Rename NAUTILUS_FILE_ATTRIBUTE_FAST_MIME_TYPE to
* libnautilus-extensions/nautilus-file-attributes.h: Rename
NAUTILUS_FILE_ATTRIBUTE_FAST_MIME_TYPE to
NAUTILUS_FILE_ATTRIBUTE_MIME_TYPE; add
NAUTILUS_FILE_ATTRIBUTE_SLOW_MIME_TYPE, for now just a synonym for
NAUTILUS_FILE_ATTRIBUTE_MIME_TYPE.
* libnautilus-extensions/nautilus-directory-async.c:
(set_up_request_by_file_attributes): Handle the new file
attributes.
* libnautilus-extensions/nautilus-directory.h: move
nautilus_directory_wait_until_ready call to
nautilus-wait-until-ready.h
* libnautilus-extensions/nautilus-directory.c:
(nautilus_self_check_directory): Include
nautilus-wait-until-ready.h, use new attributes.
* libnautilus-extensions/nautilus-wait-until-ready.h: New header
for the deprecated wait_until_ready calls.
* libnautilus-extensions/nautilus-file.c:
(nautilus_file_wait_until_ready): file equivalent of
nautilus_directory_wait_until_ready; temporary to help me
refactor.
(file_wait_until_ready_callback): helper function.
* libnautilus-extensions/Makefile.am: Add
nautilus-wait-until-ready.h
* libnautilus-extensions/nautilus-icon-factory.c:
(nautilus_icon_factory_get_required_file_attributes): Use new
attribute for mime type.
* libnautilus-extensions/nautilus-mime-actions.h,
libnautilus-extensions/nautilus-mime-actions.c:
(nautilus_mime_get_default_action_type_for_uri),
(nautilus_mime_get_default_action_for_uri),
(nautilus_mime_get_default_application_for_uri_internal),
(nautilus_mime_get_default_application_for_uri),
(nautilus_mime_is_default_application_for_uri_user_chosen),
(nautilus_mime_get_default_component_for_uri_internal),
(nautilus_mime_get_default_component_for_uri),
(nautilus_mime_is_default_component_for_uri_user_chosen),
(nautilus_mime_get_short_list_applications_for_uri),
(nautilus_mime_get_short_list_components_for_uri),
(nautilus_mime_get_short_list_methods_for_uri),
(nautilus_mime_get_all_applications_for_uri),
(nautilus_mime_has_any_applications_for_uri),
(nautilus_mime_get_all_components_for_uri),
(nautilus_mime_has_any_components_for_uri),
(nautilus_mime_set_default_action_type_for_uri),
(nautilus_mime_set_default_application_for_uri),
(nautilus_mime_set_default_component_for_uri),
(nautilus_mime_set_short_list_applications_for_uri),
(nautilus_mime_set_short_list_components_for_uri),
(nautilus_mime_add_application_to_short_list_for_uri),
(nautilus_mime_remove_application_from_short_list_for_uri),
(nautilus_mime_add_component_to_short_list_for_uri),
(nautilus_mime_remove_component_from_short_list_for_uri),
(nautilus_mime_extend_all_applications_for_uri),
(nautilus_mime_remove_from_all_applications_for_uri): All these
functions now take a NautilusDirectory and a NautilusFile, rather
than a URI.
(gnome_vfs_mime_application_has_id),
(gnome_vfs_mime_id_matches_application),
(gnome_vfs_mime_application_has_id_not_in_list),
(string_not_in_list), (extract_prefix_add_suffix),
(make_oaf_query_with_known_mime_type),
(make_oaf_query_with_uri_scheme_only), (free_key),
(server_matches_content_requirements),
(nautilus_do_component_query), (str_list_difference),
(strv_concat): Reformatted.
(get_mime_type_from_file): Changed from get_mime_type_from_uri;
uses nautilus_file_wait_until_ready instead of synchronous I/O.
* libnautilus-extensions/nautilus-program-chooser.c:
(repopulate_program_list), (is_application_default_for_uri),
(is_component_default_for_uri),
(is_component_in_short_list_for_uri),
(is_application_in_short_list_for_uri),
(program_file_pair_is_default_for_file),
(add_to_short_list_for_file), (remove_from_short_list_for_file),
(remove_default_for_item), (set_default_for_item):
* libnautilus-extensions/nautilus-program-choosing.c:
(any_programs_available_for_file):
* libnautilus-extensions/nautilus-wait-until-ready.h:
* src/file-manager/fm-directory-view.c: (switch_location_and_view),
(create_open_with_gtk_menu), (reset_bonobo_open_with_menu),
(activate_callback):
* src/nautilus-applicable-views.c: (got_file_info_callback),
(nautilus_navigation_info_new), (nautilus_navigation_info_free):
* src/nautilus-applicable-views.h:
* src/nautilus-sidebar.c: (nautilus_sidebar_update_buttons):
* src/nautilus-theme-selector.c: (add_theme_to_icons):
* src/nautilus-window.c: (nautilus_window_switch_views),
(nautilus_window_load_content_view_menu):
* test/test-nautilus-mime-actions-set.c: (main):
* test/test-nautilus-mime-actions.c: (main): Deal with above API changes.
2000-09-27 22:00:49 +00:00
|
|
|
file = nautilus_file_get (uri);
|
Fixed bugzilla.eazel.com bugs 2222, 3177, 3468, 3650, 3788
(some vestiges of wait_until_ready remain in the farther reaches
of the UI).
* libnautilus-extensions/nautilus-mime-actions.h,
libnautilus-extensions/nautilus-mime-actions.c
(nautilus_mime_actions_check_if_required_attributes_ready,
nautilus_mime_actions_get_required_file_attributes,
nautilus_mime_actions_wait_for_required_file_attributes): New
functions to help with monitoring or waiting for required
attributes for the nautilus mime API.
(nautilus_mime_get_default_action_type_for_file,
nautilus_mime_get_default_action_for_file,
nautilus_mime_get_default_application_for_file_internal,
nautilus_mime_get_default_application_for_file,
nautilus_mime_is_default_application_for_file_user_chosen,
nautilus_mime_get_default_component_for_file_internal,
nautilus_mime_get_default_component_for_file,
nautilus_mime_is_default_component_for_file_user_chosen,
nautilus_mime_get_short_list_applications_for_file,
nautilus_mime_get_short_list_components_for_file,
nautilus_mime_get_short_list_methods_for_file,
nautilus_mime_get_all_applications_for_file,
nautilus_mime_has_any_applications_for_file,
nautilus_mime_get_all_components_for_file,
nautilus_mime_has_any_components_for_file,
nautilus_mime_set_default_action_type_for_file,
nautilus_mime_set_default_application_for_file,
nautilus_mime_set_default_component_for_file,
nautilus_mime_set_short_list_applications_for_file,
nautilus_mime_set_short_list_components_for_file,
nautilus_mime_add_application_to_short_list_for_file,
nautilus_mime_remove_application_from_short_list_for_file,
nautilus_mime_add_component_to_short_list_for_file,
nautilus_mime_remove_component_from_short_list_for_file,
nautilus_mime_extend_all_applications_for_file,
nautilus_mime_remove_from_all_applications_for_file,
mime_type_get_supertype): Don't `nautilus_file_wait_until_ready'
for the required attributes; instead assert (Well, return_if_fail)
that they are available using
`nautilus_file_check_if_ready'. Also, use
`nautilus_file_get_uri_scheme' where possible.
* libnautilus-extensions/nautilus-directory-async.c
(mime_list_callback): Correct some coding mistakes.
* libnautilus-extensions/nautilus-wait-until-ready.h,
libnautilus-extensions/nautilus-directory.c: Remove
`nautilus_directory_wait_until_ready'.
* libnautilus-extensions/nautilus-file.h,
libnautilus-extensions/nautilus-file.c
(nautilus_file_get_uri_scheme): new convenience function.
* libnautilus-extensions/nautilus-program-chooser.c:
(repopulate_program_list, is_application_default_for_file,
is_component_default_for_file,
is_component_in_short_list_for_file,
is_application_in_short_list_for_file,
program_file_pair_is_default_for_file,
program_file_pair_is_in_short_list_for_file,
add_to_short_list_for_file, remove_from_short_list_for_file,
remove_default_for_item, set_default_for_item): wait_until_ready
for required file attributes.
* libnautilus-extensions/nautilus-program-choosing.c:
(any_programs_available_for_file): wait_until_ready for required
file attributes.
* src/file-manager/fm-directory-view.c: (switch_location_and_view,
create_open_with_gtk_menu, reset_bonobo_open_with_menu,
activate_callback): Wait for the right file attributes.
* src/nautilus-applicable-views.c: (got_file_info_callback),
(nautilus_navigation_info_new): Wait for the right file
attributes. (no wait_until_ready).
* src/nautilus-sidebar.c: (nautilus_sidebar_destroy,
nautilus_sidebar_update_buttons, nautilus_sidebar_update_all),
nautilus_sidebar_set_uri): Monitor the file the sidebar is
displaying, and update when it's attributes change.
* src/nautilus-window-manage-views.c
(nautilus_window_set_content_view): Wait for the right file
attributes. (no wait_until_ready).
* src/nautilus-window.c: (nautilus_window_destroy,
view_menu_choose_view_callback, view_menu_vfs_method_callback,
nautilus_window_real_load_content_view_menu,
nautilus_window_load_content_view_menu): Wait for the right
attributes. (no wait_until_ready in this chain).
* test/test-nautilus-mime-actions-set.c (main): Wait for the right attributes.
* test/test-nautilus-mime-actions.c (main): Wait for the right attributes.
2000-10-18 21:57:19 +00:00
|
|
|
|
2000-11-08 01:11:33 +00:00
|
|
|
attributes = nautilus_mime_actions_get_full_file_attributes ();
|
|
|
|
nautilus_file_call_when_ready (file, attributes, ready_callback, NULL);
|
|
|
|
g_list_free (attributes);
|
|
|
|
|
|
|
|
while (!ready) {
|
|
|
|
gtk_main_iteration ();
|
|
|
|
}
|
|
|
|
|
Fixed bugzilla.eazel.com bugs 2222, 3177, 3468, 3650, 3788
(some vestiges of wait_until_ready remain in the farther reaches
of the UI).
* libnautilus-extensions/nautilus-mime-actions.h,
libnautilus-extensions/nautilus-mime-actions.c
(nautilus_mime_actions_check_if_required_attributes_ready,
nautilus_mime_actions_get_required_file_attributes,
nautilus_mime_actions_wait_for_required_file_attributes): New
functions to help with monitoring or waiting for required
attributes for the nautilus mime API.
(nautilus_mime_get_default_action_type_for_file,
nautilus_mime_get_default_action_for_file,
nautilus_mime_get_default_application_for_file_internal,
nautilus_mime_get_default_application_for_file,
nautilus_mime_is_default_application_for_file_user_chosen,
nautilus_mime_get_default_component_for_file_internal,
nautilus_mime_get_default_component_for_file,
nautilus_mime_is_default_component_for_file_user_chosen,
nautilus_mime_get_short_list_applications_for_file,
nautilus_mime_get_short_list_components_for_file,
nautilus_mime_get_short_list_methods_for_file,
nautilus_mime_get_all_applications_for_file,
nautilus_mime_has_any_applications_for_file,
nautilus_mime_get_all_components_for_file,
nautilus_mime_has_any_components_for_file,
nautilus_mime_set_default_action_type_for_file,
nautilus_mime_set_default_application_for_file,
nautilus_mime_set_default_component_for_file,
nautilus_mime_set_short_list_applications_for_file,
nautilus_mime_set_short_list_components_for_file,
nautilus_mime_add_application_to_short_list_for_file,
nautilus_mime_remove_application_from_short_list_for_file,
nautilus_mime_add_component_to_short_list_for_file,
nautilus_mime_remove_component_from_short_list_for_file,
nautilus_mime_extend_all_applications_for_file,
nautilus_mime_remove_from_all_applications_for_file,
mime_type_get_supertype): Don't `nautilus_file_wait_until_ready'
for the required attributes; instead assert (Well, return_if_fail)
that they are available using
`nautilus_file_check_if_ready'. Also, use
`nautilus_file_get_uri_scheme' where possible.
* libnautilus-extensions/nautilus-directory-async.c
(mime_list_callback): Correct some coding mistakes.
* libnautilus-extensions/nautilus-wait-until-ready.h,
libnautilus-extensions/nautilus-directory.c: Remove
`nautilus_directory_wait_until_ready'.
* libnautilus-extensions/nautilus-file.h,
libnautilus-extensions/nautilus-file.c
(nautilus_file_get_uri_scheme): new convenience function.
* libnautilus-extensions/nautilus-program-chooser.c:
(repopulate_program_list, is_application_default_for_file,
is_component_default_for_file,
is_component_in_short_list_for_file,
is_application_in_short_list_for_file,
program_file_pair_is_default_for_file,
program_file_pair_is_in_short_list_for_file,
add_to_short_list_for_file, remove_from_short_list_for_file,
remove_default_for_item, set_default_for_item): wait_until_ready
for required file attributes.
* libnautilus-extensions/nautilus-program-choosing.c:
(any_programs_available_for_file): wait_until_ready for required
file attributes.
* src/file-manager/fm-directory-view.c: (switch_location_and_view,
create_open_with_gtk_menu, reset_bonobo_open_with_menu,
activate_callback): Wait for the right file attributes.
* src/nautilus-applicable-views.c: (got_file_info_callback),
(nautilus_navigation_info_new): Wait for the right file
attributes. (no wait_until_ready).
* src/nautilus-sidebar.c: (nautilus_sidebar_destroy,
nautilus_sidebar_update_buttons, nautilus_sidebar_update_all),
nautilus_sidebar_set_uri): Monitor the file the sidebar is
displaying, and update when it's attributes change.
* src/nautilus-window-manage-views.c
(nautilus_window_set_content_view): Wait for the right file
attributes. (no wait_until_ready).
* src/nautilus-window.c: (nautilus_window_destroy,
view_menu_choose_view_callback, view_menu_vfs_method_callback,
nautilus_window_real_load_content_view_menu,
nautilus_window_load_content_view_menu): Wait for the right
attributes. (no wait_until_ready in this chain).
* test/test-nautilus-mime-actions-set.c (main): Wait for the right attributes.
* test/test-nautilus-mime-actions.c (main): Wait for the right attributes.
2000-10-18 21:57:19 +00:00
|
|
|
default_action = nautilus_mime_get_default_action_for_file (file);
|
2000-06-01 06:00:19 +00:00
|
|
|
puts ("Default Action");
|
|
|
|
print_action (default_action);
|
|
|
|
puts ("");
|
|
|
|
|
Fixed bugzilla.eazel.com bugs 2222, 3177, 3468, 3650, 3788
(some vestiges of wait_until_ready remain in the farther reaches
of the UI).
* libnautilus-extensions/nautilus-mime-actions.h,
libnautilus-extensions/nautilus-mime-actions.c
(nautilus_mime_actions_check_if_required_attributes_ready,
nautilus_mime_actions_get_required_file_attributes,
nautilus_mime_actions_wait_for_required_file_attributes): New
functions to help with monitoring or waiting for required
attributes for the nautilus mime API.
(nautilus_mime_get_default_action_type_for_file,
nautilus_mime_get_default_action_for_file,
nautilus_mime_get_default_application_for_file_internal,
nautilus_mime_get_default_application_for_file,
nautilus_mime_is_default_application_for_file_user_chosen,
nautilus_mime_get_default_component_for_file_internal,
nautilus_mime_get_default_component_for_file,
nautilus_mime_is_default_component_for_file_user_chosen,
nautilus_mime_get_short_list_applications_for_file,
nautilus_mime_get_short_list_components_for_file,
nautilus_mime_get_short_list_methods_for_file,
nautilus_mime_get_all_applications_for_file,
nautilus_mime_has_any_applications_for_file,
nautilus_mime_get_all_components_for_file,
nautilus_mime_has_any_components_for_file,
nautilus_mime_set_default_action_type_for_file,
nautilus_mime_set_default_application_for_file,
nautilus_mime_set_default_component_for_file,
nautilus_mime_set_short_list_applications_for_file,
nautilus_mime_set_short_list_components_for_file,
nautilus_mime_add_application_to_short_list_for_file,
nautilus_mime_remove_application_from_short_list_for_file,
nautilus_mime_add_component_to_short_list_for_file,
nautilus_mime_remove_component_from_short_list_for_file,
nautilus_mime_extend_all_applications_for_file,
nautilus_mime_remove_from_all_applications_for_file,
mime_type_get_supertype): Don't `nautilus_file_wait_until_ready'
for the required attributes; instead assert (Well, return_if_fail)
that they are available using
`nautilus_file_check_if_ready'. Also, use
`nautilus_file_get_uri_scheme' where possible.
* libnautilus-extensions/nautilus-directory-async.c
(mime_list_callback): Correct some coding mistakes.
* libnautilus-extensions/nautilus-wait-until-ready.h,
libnautilus-extensions/nautilus-directory.c: Remove
`nautilus_directory_wait_until_ready'.
* libnautilus-extensions/nautilus-file.h,
libnautilus-extensions/nautilus-file.c
(nautilus_file_get_uri_scheme): new convenience function.
* libnautilus-extensions/nautilus-program-chooser.c:
(repopulate_program_list, is_application_default_for_file,
is_component_default_for_file,
is_component_in_short_list_for_file,
is_application_in_short_list_for_file,
program_file_pair_is_default_for_file,
program_file_pair_is_in_short_list_for_file,
add_to_short_list_for_file, remove_from_short_list_for_file,
remove_default_for_item, set_default_for_item): wait_until_ready
for required file attributes.
* libnautilus-extensions/nautilus-program-choosing.c:
(any_programs_available_for_file): wait_until_ready for required
file attributes.
* src/file-manager/fm-directory-view.c: (switch_location_and_view,
create_open_with_gtk_menu, reset_bonobo_open_with_menu,
activate_callback): Wait for the right file attributes.
* src/nautilus-applicable-views.c: (got_file_info_callback),
(nautilus_navigation_info_new): Wait for the right file
attributes. (no wait_until_ready).
* src/nautilus-sidebar.c: (nautilus_sidebar_destroy,
nautilus_sidebar_update_buttons, nautilus_sidebar_update_all),
nautilus_sidebar_set_uri): Monitor the file the sidebar is
displaying, and update when it's attributes change.
* src/nautilus-window-manage-views.c
(nautilus_window_set_content_view): Wait for the right file
attributes. (no wait_until_ready).
* src/nautilus-window.c: (nautilus_window_destroy,
view_menu_choose_view_callback, view_menu_vfs_method_callback,
nautilus_window_real_load_content_view_menu,
nautilus_window_load_content_view_menu): Wait for the right
attributes. (no wait_until_ready in this chain).
* test/test-nautilus-mime-actions-set.c (main): Wait for the right attributes.
* test/test-nautilus-mime-actions.c (main): Wait for the right attributes.
2000-10-18 21:57:19 +00:00
|
|
|
default_application = nautilus_mime_get_default_application_for_file (file);
|
2000-06-01 06:00:19 +00:00
|
|
|
puts("Default Application");
|
|
|
|
print_application (default_application);
|
|
|
|
puts ("");
|
|
|
|
|
Fixed bugzilla.eazel.com bugs 2222, 3177, 3468, 3650, 3788
(some vestiges of wait_until_ready remain in the farther reaches
of the UI).
* libnautilus-extensions/nautilus-mime-actions.h,
libnautilus-extensions/nautilus-mime-actions.c
(nautilus_mime_actions_check_if_required_attributes_ready,
nautilus_mime_actions_get_required_file_attributes,
nautilus_mime_actions_wait_for_required_file_attributes): New
functions to help with monitoring or waiting for required
attributes for the nautilus mime API.
(nautilus_mime_get_default_action_type_for_file,
nautilus_mime_get_default_action_for_file,
nautilus_mime_get_default_application_for_file_internal,
nautilus_mime_get_default_application_for_file,
nautilus_mime_is_default_application_for_file_user_chosen,
nautilus_mime_get_default_component_for_file_internal,
nautilus_mime_get_default_component_for_file,
nautilus_mime_is_default_component_for_file_user_chosen,
nautilus_mime_get_short_list_applications_for_file,
nautilus_mime_get_short_list_components_for_file,
nautilus_mime_get_short_list_methods_for_file,
nautilus_mime_get_all_applications_for_file,
nautilus_mime_has_any_applications_for_file,
nautilus_mime_get_all_components_for_file,
nautilus_mime_has_any_components_for_file,
nautilus_mime_set_default_action_type_for_file,
nautilus_mime_set_default_application_for_file,
nautilus_mime_set_default_component_for_file,
nautilus_mime_set_short_list_applications_for_file,
nautilus_mime_set_short_list_components_for_file,
nautilus_mime_add_application_to_short_list_for_file,
nautilus_mime_remove_application_from_short_list_for_file,
nautilus_mime_add_component_to_short_list_for_file,
nautilus_mime_remove_component_from_short_list_for_file,
nautilus_mime_extend_all_applications_for_file,
nautilus_mime_remove_from_all_applications_for_file,
mime_type_get_supertype): Don't `nautilus_file_wait_until_ready'
for the required attributes; instead assert (Well, return_if_fail)
that they are available using
`nautilus_file_check_if_ready'. Also, use
`nautilus_file_get_uri_scheme' where possible.
* libnautilus-extensions/nautilus-directory-async.c
(mime_list_callback): Correct some coding mistakes.
* libnautilus-extensions/nautilus-wait-until-ready.h,
libnautilus-extensions/nautilus-directory.c: Remove
`nautilus_directory_wait_until_ready'.
* libnautilus-extensions/nautilus-file.h,
libnautilus-extensions/nautilus-file.c
(nautilus_file_get_uri_scheme): new convenience function.
* libnautilus-extensions/nautilus-program-chooser.c:
(repopulate_program_list, is_application_default_for_file,
is_component_default_for_file,
is_component_in_short_list_for_file,
is_application_in_short_list_for_file,
program_file_pair_is_default_for_file,
program_file_pair_is_in_short_list_for_file,
add_to_short_list_for_file, remove_from_short_list_for_file,
remove_default_for_item, set_default_for_item): wait_until_ready
for required file attributes.
* libnautilus-extensions/nautilus-program-choosing.c:
(any_programs_available_for_file): wait_until_ready for required
file attributes.
* src/file-manager/fm-directory-view.c: (switch_location_and_view,
create_open_with_gtk_menu, reset_bonobo_open_with_menu,
activate_callback): Wait for the right file attributes.
* src/nautilus-applicable-views.c: (got_file_info_callback),
(nautilus_navigation_info_new): Wait for the right file
attributes. (no wait_until_ready).
* src/nautilus-sidebar.c: (nautilus_sidebar_destroy,
nautilus_sidebar_update_buttons, nautilus_sidebar_update_all),
nautilus_sidebar_set_uri): Monitor the file the sidebar is
displaying, and update when it's attributes change.
* src/nautilus-window-manage-views.c
(nautilus_window_set_content_view): Wait for the right file
attributes. (no wait_until_ready).
* src/nautilus-window.c: (nautilus_window_destroy,
view_menu_choose_view_callback, view_menu_vfs_method_callback,
nautilus_window_real_load_content_view_menu,
nautilus_window_load_content_view_menu): Wait for the right
attributes. (no wait_until_ready in this chain).
* test/test-nautilus-mime-actions-set.c (main): Wait for the right attributes.
* test/test-nautilus-mime-actions.c (main): Wait for the right attributes.
2000-10-18 21:57:19 +00:00
|
|
|
default_component = nautilus_mime_get_default_component_for_file (file);
|
2000-06-01 06:00:19 +00:00
|
|
|
puts("Default Component");
|
|
|
|
print_component (default_component);
|
|
|
|
puts ("");
|
|
|
|
|
Fixed bugzilla.eazel.com bugs 2222, 3177, 3468, 3650, 3788
(some vestiges of wait_until_ready remain in the farther reaches
of the UI).
* libnautilus-extensions/nautilus-mime-actions.h,
libnautilus-extensions/nautilus-mime-actions.c
(nautilus_mime_actions_check_if_required_attributes_ready,
nautilus_mime_actions_get_required_file_attributes,
nautilus_mime_actions_wait_for_required_file_attributes): New
functions to help with monitoring or waiting for required
attributes for the nautilus mime API.
(nautilus_mime_get_default_action_type_for_file,
nautilus_mime_get_default_action_for_file,
nautilus_mime_get_default_application_for_file_internal,
nautilus_mime_get_default_application_for_file,
nautilus_mime_is_default_application_for_file_user_chosen,
nautilus_mime_get_default_component_for_file_internal,
nautilus_mime_get_default_component_for_file,
nautilus_mime_is_default_component_for_file_user_chosen,
nautilus_mime_get_short_list_applications_for_file,
nautilus_mime_get_short_list_components_for_file,
nautilus_mime_get_short_list_methods_for_file,
nautilus_mime_get_all_applications_for_file,
nautilus_mime_has_any_applications_for_file,
nautilus_mime_get_all_components_for_file,
nautilus_mime_has_any_components_for_file,
nautilus_mime_set_default_action_type_for_file,
nautilus_mime_set_default_application_for_file,
nautilus_mime_set_default_component_for_file,
nautilus_mime_set_short_list_applications_for_file,
nautilus_mime_set_short_list_components_for_file,
nautilus_mime_add_application_to_short_list_for_file,
nautilus_mime_remove_application_from_short_list_for_file,
nautilus_mime_add_component_to_short_list_for_file,
nautilus_mime_remove_component_from_short_list_for_file,
nautilus_mime_extend_all_applications_for_file,
nautilus_mime_remove_from_all_applications_for_file,
mime_type_get_supertype): Don't `nautilus_file_wait_until_ready'
for the required attributes; instead assert (Well, return_if_fail)
that they are available using
`nautilus_file_check_if_ready'. Also, use
`nautilus_file_get_uri_scheme' where possible.
* libnautilus-extensions/nautilus-directory-async.c
(mime_list_callback): Correct some coding mistakes.
* libnautilus-extensions/nautilus-wait-until-ready.h,
libnautilus-extensions/nautilus-directory.c: Remove
`nautilus_directory_wait_until_ready'.
* libnautilus-extensions/nautilus-file.h,
libnautilus-extensions/nautilus-file.c
(nautilus_file_get_uri_scheme): new convenience function.
* libnautilus-extensions/nautilus-program-chooser.c:
(repopulate_program_list, is_application_default_for_file,
is_component_default_for_file,
is_component_in_short_list_for_file,
is_application_in_short_list_for_file,
program_file_pair_is_default_for_file,
program_file_pair_is_in_short_list_for_file,
add_to_short_list_for_file, remove_from_short_list_for_file,
remove_default_for_item, set_default_for_item): wait_until_ready
for required file attributes.
* libnautilus-extensions/nautilus-program-choosing.c:
(any_programs_available_for_file): wait_until_ready for required
file attributes.
* src/file-manager/fm-directory-view.c: (switch_location_and_view,
create_open_with_gtk_menu, reset_bonobo_open_with_menu,
activate_callback): Wait for the right file attributes.
* src/nautilus-applicable-views.c: (got_file_info_callback),
(nautilus_navigation_info_new): Wait for the right file
attributes. (no wait_until_ready).
* src/nautilus-sidebar.c: (nautilus_sidebar_destroy,
nautilus_sidebar_update_buttons, nautilus_sidebar_update_all),
nautilus_sidebar_set_uri): Monitor the file the sidebar is
displaying, and update when it's attributes change.
* src/nautilus-window-manage-views.c
(nautilus_window_set_content_view): Wait for the right file
attributes. (no wait_until_ready).
* src/nautilus-window.c: (nautilus_window_destroy,
view_menu_choose_view_callback, view_menu_vfs_method_callback,
nautilus_window_real_load_content_view_menu,
nautilus_window_load_content_view_menu): Wait for the right
attributes. (no wait_until_ready in this chain).
* test/test-nautilus-mime-actions-set.c (main): Wait for the right attributes.
* test/test-nautilus-mime-actions.c (main): Wait for the right attributes.
2000-10-18 21:57:19 +00:00
|
|
|
short_list_applications = nautilus_mime_get_short_list_applications_for_file (file);
|
2000-06-01 06:00:19 +00:00
|
|
|
puts("Short List Applications");
|
|
|
|
print_application_list (short_list_applications);
|
|
|
|
puts ("");
|
|
|
|
|
Fixed bugzilla.eazel.com bugs 2222, 3177, 3468, 3650, 3788
(some vestiges of wait_until_ready remain in the farther reaches
of the UI).
* libnautilus-extensions/nautilus-mime-actions.h,
libnautilus-extensions/nautilus-mime-actions.c
(nautilus_mime_actions_check_if_required_attributes_ready,
nautilus_mime_actions_get_required_file_attributes,
nautilus_mime_actions_wait_for_required_file_attributes): New
functions to help with monitoring or waiting for required
attributes for the nautilus mime API.
(nautilus_mime_get_default_action_type_for_file,
nautilus_mime_get_default_action_for_file,
nautilus_mime_get_default_application_for_file_internal,
nautilus_mime_get_default_application_for_file,
nautilus_mime_is_default_application_for_file_user_chosen,
nautilus_mime_get_default_component_for_file_internal,
nautilus_mime_get_default_component_for_file,
nautilus_mime_is_default_component_for_file_user_chosen,
nautilus_mime_get_short_list_applications_for_file,
nautilus_mime_get_short_list_components_for_file,
nautilus_mime_get_short_list_methods_for_file,
nautilus_mime_get_all_applications_for_file,
nautilus_mime_has_any_applications_for_file,
nautilus_mime_get_all_components_for_file,
nautilus_mime_has_any_components_for_file,
nautilus_mime_set_default_action_type_for_file,
nautilus_mime_set_default_application_for_file,
nautilus_mime_set_default_component_for_file,
nautilus_mime_set_short_list_applications_for_file,
nautilus_mime_set_short_list_components_for_file,
nautilus_mime_add_application_to_short_list_for_file,
nautilus_mime_remove_application_from_short_list_for_file,
nautilus_mime_add_component_to_short_list_for_file,
nautilus_mime_remove_component_from_short_list_for_file,
nautilus_mime_extend_all_applications_for_file,
nautilus_mime_remove_from_all_applications_for_file,
mime_type_get_supertype): Don't `nautilus_file_wait_until_ready'
for the required attributes; instead assert (Well, return_if_fail)
that they are available using
`nautilus_file_check_if_ready'. Also, use
`nautilus_file_get_uri_scheme' where possible.
* libnautilus-extensions/nautilus-directory-async.c
(mime_list_callback): Correct some coding mistakes.
* libnautilus-extensions/nautilus-wait-until-ready.h,
libnautilus-extensions/nautilus-directory.c: Remove
`nautilus_directory_wait_until_ready'.
* libnautilus-extensions/nautilus-file.h,
libnautilus-extensions/nautilus-file.c
(nautilus_file_get_uri_scheme): new convenience function.
* libnautilus-extensions/nautilus-program-chooser.c:
(repopulate_program_list, is_application_default_for_file,
is_component_default_for_file,
is_component_in_short_list_for_file,
is_application_in_short_list_for_file,
program_file_pair_is_default_for_file,
program_file_pair_is_in_short_list_for_file,
add_to_short_list_for_file, remove_from_short_list_for_file,
remove_default_for_item, set_default_for_item): wait_until_ready
for required file attributes.
* libnautilus-extensions/nautilus-program-choosing.c:
(any_programs_available_for_file): wait_until_ready for required
file attributes.
* src/file-manager/fm-directory-view.c: (switch_location_and_view,
create_open_with_gtk_menu, reset_bonobo_open_with_menu,
activate_callback): Wait for the right file attributes.
* src/nautilus-applicable-views.c: (got_file_info_callback),
(nautilus_navigation_info_new): Wait for the right file
attributes. (no wait_until_ready).
* src/nautilus-sidebar.c: (nautilus_sidebar_destroy,
nautilus_sidebar_update_buttons, nautilus_sidebar_update_all),
nautilus_sidebar_set_uri): Monitor the file the sidebar is
displaying, and update when it's attributes change.
* src/nautilus-window-manage-views.c
(nautilus_window_set_content_view): Wait for the right file
attributes. (no wait_until_ready).
* src/nautilus-window.c: (nautilus_window_destroy,
view_menu_choose_view_callback, view_menu_vfs_method_callback,
nautilus_window_real_load_content_view_menu,
nautilus_window_load_content_view_menu): Wait for the right
attributes. (no wait_until_ready in this chain).
* test/test-nautilus-mime-actions-set.c (main): Wait for the right attributes.
* test/test-nautilus-mime-actions.c (main): Wait for the right attributes.
2000-10-18 21:57:19 +00:00
|
|
|
short_list_components = nautilus_mime_get_short_list_components_for_file (file);
|
2000-06-01 06:00:19 +00:00
|
|
|
puts("Short List Components");
|
|
|
|
print_component_list (short_list_components);
|
|
|
|
puts ("");
|
|
|
|
|
Fixed bugzilla.eazel.com bugs 2222, 3177, 3468, 3650, 3788
(some vestiges of wait_until_ready remain in the farther reaches
of the UI).
* libnautilus-extensions/nautilus-mime-actions.h,
libnautilus-extensions/nautilus-mime-actions.c
(nautilus_mime_actions_check_if_required_attributes_ready,
nautilus_mime_actions_get_required_file_attributes,
nautilus_mime_actions_wait_for_required_file_attributes): New
functions to help with monitoring or waiting for required
attributes for the nautilus mime API.
(nautilus_mime_get_default_action_type_for_file,
nautilus_mime_get_default_action_for_file,
nautilus_mime_get_default_application_for_file_internal,
nautilus_mime_get_default_application_for_file,
nautilus_mime_is_default_application_for_file_user_chosen,
nautilus_mime_get_default_component_for_file_internal,
nautilus_mime_get_default_component_for_file,
nautilus_mime_is_default_component_for_file_user_chosen,
nautilus_mime_get_short_list_applications_for_file,
nautilus_mime_get_short_list_components_for_file,
nautilus_mime_get_short_list_methods_for_file,
nautilus_mime_get_all_applications_for_file,
nautilus_mime_has_any_applications_for_file,
nautilus_mime_get_all_components_for_file,
nautilus_mime_has_any_components_for_file,
nautilus_mime_set_default_action_type_for_file,
nautilus_mime_set_default_application_for_file,
nautilus_mime_set_default_component_for_file,
nautilus_mime_set_short_list_applications_for_file,
nautilus_mime_set_short_list_components_for_file,
nautilus_mime_add_application_to_short_list_for_file,
nautilus_mime_remove_application_from_short_list_for_file,
nautilus_mime_add_component_to_short_list_for_file,
nautilus_mime_remove_component_from_short_list_for_file,
nautilus_mime_extend_all_applications_for_file,
nautilus_mime_remove_from_all_applications_for_file,
mime_type_get_supertype): Don't `nautilus_file_wait_until_ready'
for the required attributes; instead assert (Well, return_if_fail)
that they are available using
`nautilus_file_check_if_ready'. Also, use
`nautilus_file_get_uri_scheme' where possible.
* libnautilus-extensions/nautilus-directory-async.c
(mime_list_callback): Correct some coding mistakes.
* libnautilus-extensions/nautilus-wait-until-ready.h,
libnautilus-extensions/nautilus-directory.c: Remove
`nautilus_directory_wait_until_ready'.
* libnautilus-extensions/nautilus-file.h,
libnautilus-extensions/nautilus-file.c
(nautilus_file_get_uri_scheme): new convenience function.
* libnautilus-extensions/nautilus-program-chooser.c:
(repopulate_program_list, is_application_default_for_file,
is_component_default_for_file,
is_component_in_short_list_for_file,
is_application_in_short_list_for_file,
program_file_pair_is_default_for_file,
program_file_pair_is_in_short_list_for_file,
add_to_short_list_for_file, remove_from_short_list_for_file,
remove_default_for_item, set_default_for_item): wait_until_ready
for required file attributes.
* libnautilus-extensions/nautilus-program-choosing.c:
(any_programs_available_for_file): wait_until_ready for required
file attributes.
* src/file-manager/fm-directory-view.c: (switch_location_and_view,
create_open_with_gtk_menu, reset_bonobo_open_with_menu,
activate_callback): Wait for the right file attributes.
* src/nautilus-applicable-views.c: (got_file_info_callback),
(nautilus_navigation_info_new): Wait for the right file
attributes. (no wait_until_ready).
* src/nautilus-sidebar.c: (nautilus_sidebar_destroy,
nautilus_sidebar_update_buttons, nautilus_sidebar_update_all),
nautilus_sidebar_set_uri): Monitor the file the sidebar is
displaying, and update when it's attributes change.
* src/nautilus-window-manage-views.c
(nautilus_window_set_content_view): Wait for the right file
attributes. (no wait_until_ready).
* src/nautilus-window.c: (nautilus_window_destroy,
view_menu_choose_view_callback, view_menu_vfs_method_callback,
nautilus_window_real_load_content_view_menu,
nautilus_window_load_content_view_menu): Wait for the right
attributes. (no wait_until_ready in this chain).
* test/test-nautilus-mime-actions-set.c (main): Wait for the right attributes.
* test/test-nautilus-mime-actions.c (main): Wait for the right attributes.
2000-10-18 21:57:19 +00:00
|
|
|
all_applications = nautilus_mime_get_all_applications_for_file (file);
|
2000-06-01 06:00:19 +00:00
|
|
|
puts("All Applications");
|
|
|
|
print_application_list (all_applications);
|
|
|
|
puts ("");
|
|
|
|
|
Fixed bugzilla.eazel.com bugs 2222, 3177, 3468, 3650, 3788
(some vestiges of wait_until_ready remain in the farther reaches
of the UI).
* libnautilus-extensions/nautilus-mime-actions.h,
libnautilus-extensions/nautilus-mime-actions.c
(nautilus_mime_actions_check_if_required_attributes_ready,
nautilus_mime_actions_get_required_file_attributes,
nautilus_mime_actions_wait_for_required_file_attributes): New
functions to help with monitoring or waiting for required
attributes for the nautilus mime API.
(nautilus_mime_get_default_action_type_for_file,
nautilus_mime_get_default_action_for_file,
nautilus_mime_get_default_application_for_file_internal,
nautilus_mime_get_default_application_for_file,
nautilus_mime_is_default_application_for_file_user_chosen,
nautilus_mime_get_default_component_for_file_internal,
nautilus_mime_get_default_component_for_file,
nautilus_mime_is_default_component_for_file_user_chosen,
nautilus_mime_get_short_list_applications_for_file,
nautilus_mime_get_short_list_components_for_file,
nautilus_mime_get_short_list_methods_for_file,
nautilus_mime_get_all_applications_for_file,
nautilus_mime_has_any_applications_for_file,
nautilus_mime_get_all_components_for_file,
nautilus_mime_has_any_components_for_file,
nautilus_mime_set_default_action_type_for_file,
nautilus_mime_set_default_application_for_file,
nautilus_mime_set_default_component_for_file,
nautilus_mime_set_short_list_applications_for_file,
nautilus_mime_set_short_list_components_for_file,
nautilus_mime_add_application_to_short_list_for_file,
nautilus_mime_remove_application_from_short_list_for_file,
nautilus_mime_add_component_to_short_list_for_file,
nautilus_mime_remove_component_from_short_list_for_file,
nautilus_mime_extend_all_applications_for_file,
nautilus_mime_remove_from_all_applications_for_file,
mime_type_get_supertype): Don't `nautilus_file_wait_until_ready'
for the required attributes; instead assert (Well, return_if_fail)
that they are available using
`nautilus_file_check_if_ready'. Also, use
`nautilus_file_get_uri_scheme' where possible.
* libnautilus-extensions/nautilus-directory-async.c
(mime_list_callback): Correct some coding mistakes.
* libnautilus-extensions/nautilus-wait-until-ready.h,
libnautilus-extensions/nautilus-directory.c: Remove
`nautilus_directory_wait_until_ready'.
* libnautilus-extensions/nautilus-file.h,
libnautilus-extensions/nautilus-file.c
(nautilus_file_get_uri_scheme): new convenience function.
* libnautilus-extensions/nautilus-program-chooser.c:
(repopulate_program_list, is_application_default_for_file,
is_component_default_for_file,
is_component_in_short_list_for_file,
is_application_in_short_list_for_file,
program_file_pair_is_default_for_file,
program_file_pair_is_in_short_list_for_file,
add_to_short_list_for_file, remove_from_short_list_for_file,
remove_default_for_item, set_default_for_item): wait_until_ready
for required file attributes.
* libnautilus-extensions/nautilus-program-choosing.c:
(any_programs_available_for_file): wait_until_ready for required
file attributes.
* src/file-manager/fm-directory-view.c: (switch_location_and_view,
create_open_with_gtk_menu, reset_bonobo_open_with_menu,
activate_callback): Wait for the right file attributes.
* src/nautilus-applicable-views.c: (got_file_info_callback),
(nautilus_navigation_info_new): Wait for the right file
attributes. (no wait_until_ready).
* src/nautilus-sidebar.c: (nautilus_sidebar_destroy,
nautilus_sidebar_update_buttons, nautilus_sidebar_update_all),
nautilus_sidebar_set_uri): Monitor the file the sidebar is
displaying, and update when it's attributes change.
* src/nautilus-window-manage-views.c
(nautilus_window_set_content_view): Wait for the right file
attributes. (no wait_until_ready).
* src/nautilus-window.c: (nautilus_window_destroy,
view_menu_choose_view_callback, view_menu_vfs_method_callback,
nautilus_window_real_load_content_view_menu,
nautilus_window_load_content_view_menu): Wait for the right
attributes. (no wait_until_ready in this chain).
* test/test-nautilus-mime-actions-set.c (main): Wait for the right attributes.
* test/test-nautilus-mime-actions.c (main): Wait for the right attributes.
2000-10-18 21:57:19 +00:00
|
|
|
all_components = nautilus_mime_get_all_components_for_file (file);
|
2000-06-01 06:00:19 +00:00
|
|
|
puts("All Components");
|
|
|
|
print_component_list (all_components);
|
|
|
|
puts ("");
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|