From 3681c78c7db4e2b02feb370bbff5275c64f430b7 Mon Sep 17 00:00:00 2001 From: Carlos Garcia Campos Date: Sun, 25 Apr 2010 11:07:38 +0000 Subject: Parse page dest from uri before creating the file See bug #616515. --- (limited to 'shell/main.c') diff --git a/shell/main.c b/shell/main.c index 3252f1a..dfe6a20 100644 --- a/shell/main.c +++ b/shell/main.c @@ -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, -- cgit v0.9.1