diff options
author | Carlos Garcia Campos <carlosgc@gnome.org> | 2008-01-25 12:30:28 (GMT) |
---|---|---|
committer | Carlos Garcia Campos <carlosgc@src.gnome.org> | 2008-01-25 12:30:28 (GMT) |
commit | e912e532fd67211aa87ac79414efb30f30a00fab (patch) | |
tree | 7a4a5fd318af1bcae3659ffea4e0cd3ed0eae4a8 /backend | |
parent | efb48b86f60fbaa6ab7e6cb1edb9b1994f5575b3 (diff) |
Port to gio and drop gnome-vfs dependency. Fixes bug #510401. Based on
2008-01-25 Carlos Garcia Campos <carlosgc@gnome.org>
* configure.ac:
* backend/comics/comics-document.c: (comics_document_load):
* libdocument/ev-attachment.[ch]: (ev_attachment_finalize),
(ev_attachment_set_property), (ev_attachment_init),
(ev_attachment_save), (ev_attachment_launch_app),
(ev_attachment_open):
* libdocument/ev-document-factory.c: (get_document_from_uri):
* libdocument/ev-file-helpers.[ch]: (ev_tmp_file_get),
(ev_tmp_file_unlink), (ev_tmp_uri_unlink), (ev_xfer_uri_simple),:
* shell/ev-jobs.c:
* shell/ev-password.c: (ev_password_dialog_set_property),
(ev_password_dialog_save_password):
* shell/ev-sidebar-attachments.c:
(ev_sidebar_attachments_drag_data_get):
* shell/ev-window-title.c: (get_filename_from_uri):
* shell/ev-window.c: (ev_window_clear_temp_file),
(ev_window_load_job_cb), (window_open_file_copy_ready_cb),
(ev_window_open_uri), (window_save_file_copy_ready_cb),
(ev_window_save_remote), (ev_window_cmd_save_as), (launch_action),
(launch_external_uri), (image_save_dialog_response_cb),
(attachment_save_dialog_response_cb):
* shell/main.c: (load_files), (load_files_remote), (main):
* thumbnailer/evince-thumbnailer.c: (main):
Port to gio and drop gnome-vfs dependency. Fixes bug
#510401. Based on patch by Cosimo Cecchi.
svn path=/trunk/; revision=2858
Diffstat (limited to 'backend')
-rw-r--r-- | backend/comics/comics-document.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/backend/comics/comics-document.c b/backend/comics/comics-document.c index 004cb8e..b0d99ca 100644 --- a/backend/comics/comics-document.c +++ b/backend/comics/comics-document.c @@ -23,7 +23,7 @@ #include <unistd.h> #include <string.h> #include <glib/gi18n.h> -#include <libgnomevfs/gnome-vfs-mime-utils.h> +#include <gio/gio.h> #include "comics-document.h" #include "ev-document-misc.h" @@ -109,7 +109,10 @@ comics_document_load (EvDocument *document, { ComicsDocument *comics_document = COMICS_DOCUMENT (document); GSList *supported_extensions; - gchar *list_files_command = NULL, *std_out, *quoted_file, *mime_type; + GFile *file; + GFileInfo *file_info; + gchar *list_files_command = NULL, *std_out, *quoted_file; + const gchar *mime_type = NULL; gchar **cbr_files; gboolean success; int i, retval; @@ -118,7 +121,14 @@ comics_document_load (EvDocument *document, g_return_val_if_fail (comics_document->archive != NULL, FALSE); quoted_file = g_shell_quote (comics_document->archive); - mime_type = gnome_vfs_get_mime_type (uri); + file = g_file_new_for_uri (uri); + file_info = g_file_query_info (file, + G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE, + 0, NULL, NULL); + if (file_info != NULL) { + mime_type = g_file_info_get_content_type (file_info); + } + g_object_unref (file); /* FIXME, use proper cbr/cbz mime types once they're * included in shared-mime-info */ @@ -136,6 +146,7 @@ comics_document_load (EvDocument *document, comics_document->regex_arg = TRUE; } + g_object_unref (file_info); g_free (quoted_file); /* Get list of files in archive */ @@ -144,14 +155,12 @@ comics_document_load (EvDocument *document, g_free (list_files_command); if (!success) { - g_free (mime_type); return FALSE; } else if (retval != 0) { g_set_error (error, EV_DOCUMENT_ERROR, EV_DOCUMENT_ERROR_INVALID, _("File corrupted.")); - g_free (mime_type); return FALSE; } @@ -177,7 +186,6 @@ comics_document_load (EvDocument *document, } g_free (std_out); - g_free (mime_type); g_strfreev (cbr_files); g_slist_foreach (supported_extensions, (GFunc) g_free, NULL); g_slist_free (supported_extensions); |