From: Nickolay V. Shmyrev Date: Sat, 27 May 2006 12:37:56 +0000 (+0000) Subject: Open links with anchors. Fix for the bug #339836. X-Git-Tag: EVINCE_0_5_4~47 X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=75e184c10b9d8f1f52ebcde19660e45c5244f9a0;p=evince.git Open links with anchors. Fix for the bug #339836. * shell/ev-jobs.c: (ev_job_xfer_run): * shell/main.c: (load_files): Open links with anchors. Fix for the bug #339836. --- diff --git a/ChangeLog b/ChangeLog index 0e08e1b9..4848a795 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-05-27 Nickolay V. Shmyrev + + * shell/ev-jobs.c: (ev_job_xfer_run): + * shell/main.c: (load_files): + + Open links with anchors. Fix for the bug #339836. + 2006-05-27 Nickolay V. Shmyrev * backend/ev-link-dest.c: (ev_link_dest_type_get_type), diff --git a/shell/ev-jobs.c b/shell/ev-jobs.c index 9ee598ac..4e01ab19 100644 --- a/shell/ev-jobs.c +++ b/shell/ev-jobs.c @@ -433,9 +433,13 @@ ev_job_xfer_run (EvJobXfer *job) char *tmp_name; char *base_name; + /* We'd like to keep extension of source uri since + * it helps to resolve some mime types, say cbz */ + tmp_name = ev_tmp_filename (); - base_name = g_path_get_basename (job->uri); - job->local_uri = g_strconcat ("file:", tmp_name, base_name, NULL); + base_name = gnome_vfs_uri_extract_short_name (source_uri); + job->local_uri = g_strconcat ("file:", tmp_name, "-", base_name, NULL); + g_free (base_name); g_free (tmp_name); target_uri = gnome_vfs_uri_new (job->local_uri); diff --git a/shell/main.c b/shell/main.c index d1aabceb..c86ae23e 100644 --- a/shell/main.c +++ b/shell/main.c @@ -44,7 +44,7 @@ #include "ev-file-helpers.h" static char *ev_page_label; -static char **file_arguments = NULL; +static const char **file_arguments = NULL; static const GOptionEntry goption_options[] = { @@ -65,10 +65,20 @@ load_files (const char **files) for (i = 0; files[i]; i++) { char *uri; + char *label; uri = gnome_vfs_make_uri_from_shell_arg (files[i]); - ev_application_open_uri (EV_APP, uri, ev_page_label, - GDK_CURRENT_TIME, NULL); + + label = strchr (uri, GNOME_VFS_URI_MAGIC_CHR); + + if (label) { + *label = 0; label++; + ev_application_open_uri (EV_APP, uri, label, + GDK_CURRENT_TIME, NULL); + } else { + ev_application_open_uri (EV_APP, uri, ev_page_label, + GDK_CURRENT_TIME, NULL); + } g_free (uri); } }