]> www.fi.muni.cz Git - evince.git/commitdiff
Open links with anchors. Fix for the bug #339836.
authorNickolay V. Shmyrev <nshmyrev@src.gnome.org>
Sat, 27 May 2006 12:37:56 +0000 (12:37 +0000)
committerNickolay V. Shmyrev <nshmyrev@src.gnome.org>
Sat, 27 May 2006 12:37:56 +0000 (12:37 +0000)
* shell/ev-jobs.c: (ev_job_xfer_run):
* shell/main.c: (load_files):

Open links with anchors. Fix for the bug #339836.

ChangeLog
shell/ev-jobs.c
shell/main.c

index 0e08e1b98c416817acf51b4cc6c810e36c6eaf82..4848a7950e6d48489c59d78699438223400cd826 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-05-27  Nickolay V. Shmyrev  <nshmyrev@yandex.ru>
+
+       * 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  <nshmyrev@yandex.ru>
 
        * backend/ev-link-dest.c: (ev_link_dest_type_get_type),
index 9ee598ac4aae5f83f938a182e6a35b7a607b2436..4e01ab1923ab41e81166e33a6dceeccf88e8eed0 100644 (file)
@@ -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);
index d1aabceb3021c7d38d55e393cec41bc3e4a863a7..c86ae23ead39d5de44cfb5d0e4c05176f3d426fd 100644 (file)
@@ -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);
         }
 }