]> www.fi.muni.cz Git - evince.git/commitdiff
Parse page dest from uri before creating the file
authorCarlos Garcia Campos <carlosgc@gnome.org>
Sun, 25 Apr 2010 11:07:38 +0000 (13:07 +0200)
committerCarlos Garcia Campos <carlosgc@gnome.org>
Sun, 25 Apr 2010 11:11:24 +0000 (13:11 +0200)
See bug #616515.

shell/main.c

index 3252f1a5566f6cced574960945bbf43794756cba..dfe6a200db31049a0ad72695aefe8a2f9d3011cb 100644 (file)
@@ -171,13 +171,24 @@ load_files (const char **files)
                mode = EV_WINDOW_MODE_PRESENTATION;
 
        for (i = 0; files[i]; i++) {
+               const gchar *filename;
                gchar       *uri;
                gchar       *label;
                GFile       *file;
                EvLinkDest  *dest = NULL;
                const gchar *app_uri;
 
-               file = g_file_new_for_commandline_arg (files[i]);
+               filename = files[i];
+               label = strchr (filename, '#');
+               if (label) {
+                       *label = 0;
+                       label++;
+                       dest = ev_link_dest_new_page_label (label);
+               } else if (global_dest) {
+                       dest = g_object_ref (global_dest);
+               }
+
+               file = g_file_new_for_commandline_arg (filename);
                uri = g_file_get_uri (file);
                g_object_unref (file);
 
@@ -187,14 +198,7 @@ load_files (const char **files)
                        continue;
                }
 
-               label = strchr (uri, '#');
-               if (label) {
-                       *label = 0;
-                       label++;
-                       dest = ev_link_dest_new_page_label (label);
-               } else if (global_dest) {
-                       dest = g_object_ref (global_dest);
-               }
+
 
                ev_application_open_uri_at_dest (EV_APP, uri, screen, dest,
                                                 mode, ev_find_string,