do not trust gnome_vfs_mime_get_default_application. It silently removes

2002-06-26  Jody Goldberg <jody@gnome.org>

	* mime-type-info.c (mime_type_info_load_all) : do not trust
	  gnome_vfs_mime_get_default_application.  It silently removes
	  applications that do not exist on the current system.  That makes it
	  look like they are not being assigned.

	* mime-edit-dialog.c (validate_data) : relax the restriction here.  By
	  supplying a reasonable default to the new info it was appearing in
	  our internal data structures.  That was a useful test before we were
	  instant apply, but is no longer helpful.
This commit is contained in:
Jody Goldberg 2002-06-26 23:36:59 +00:00 committed by Jody Goldberg
parent 2fe0927aa1
commit f8d3fe9e7c
3 changed files with 25 additions and 4 deletions

View file

@ -1,3 +1,15 @@
2002-06-26 Jody Goldberg <jody@gnome.org>
* mime-type-info.c (mime_type_info_load_all) : do not trust
gnome_vfs_mime_get_default_application. It silently removes
applications that do not exist on the current system. That makes it
look like they are not being assigned.
* mime-edit-dialog.c (validate_data) : relax the restriction here. By
supplying a reasonable default to the new info it was appearing in
our internal data structures. That was a useful test before we were
instant apply, but is no longer helpful.
2002-06-26 Jody Goldberg <jody@gnome.org>
* file-types-capplet.c (main) : blah, test things _before_ I commit.

View file

@ -824,8 +824,7 @@ validate_data (MimeEditDialog *dialog)
GTK_BUTTONS_CANCEL,
_("Please enter a valid MIME type. It should be of the form "
"class/type and may not contain any spaces."));
} else if (dialog->p->is_add && (gnome_vfs_mime_type_is_known (mime_type) ||
get_mime_type_info (mime_type) != NULL)) {
} else if (dialog->p->is_add && gnome_vfs_mime_type_is_known (mime_type)) {
err_dialog = gtk_message_dialog_new (
GTK_WINDOW (dialog->p->dialog_win),
GTK_DIALOG_MODAL, GTK_MESSAGE_QUESTION,

View file

@ -108,8 +108,18 @@ mime_type_info_load_all (MimeTypeInfo *info)
if (info->icon_pixbuf == NULL)
get_icon_pixbuf (info, info->icon_name, TRUE);
if (info->default_action == NULL)
info->default_action = gnome_vfs_mime_get_default_application (info->mime_type);
if (info->default_action == NULL && info->mime_type != NULL) {
/* DO NOT USE gnome_vfs_mime_get_default_application
* it will silently remove non-existant applications
* which will make them seem to disappear on systems that
* are configured differently */
char const *app_id = gnome_vfs_mime_get_value (
info->mime_type, "default_application_id");
if (app_id != NULL && app_id[0] != '\0')
info->default_action =
gnome_vfs_application_registry_get_mime_application (app_id);
}
if (info->default_action == NULL)
info->default_action = g_new0 (GnomeVFSMimeApplication, 1);