GNOME Bugzilla – Bug 518481
URL shortcuts do not open query part
Last modified: 2009-05-15 13:56:07 UTC
Please describe the problem: If I have .desktop file shortcut to URL with query part, opening it does not open the query in Epiphany, only the mail portion of the URL. Steps to reproduce: 1. Drag current page icon to the desktop. 2. Open the created icon. 3. Only the http://bugzilla.gnome.org/show_bug.cgi is opened in Epiphany. Actual results: http://bugzilla.gnome.org/show_bug.cgi is opened in Epiphany. Expected results: http://bugzilla.gnome.org/show_bug.cgi?id=x14x24x should be opened. Does this happen every time? Yes. Other information:
Confirming, this is really strange, as the desktop file has the right link inside it.
It probably roundtrips through GFile at some place.
> It probably roundtrips through GFile at some place. Yes. nautilus_mime_activate_files() is executed on the launcher URI (i.e. "file://.../foo.desktop"). It is detected as Nautilus link, with the activation URI "http://bugzilla.gnome.org/show_bug.cgi?id=x14x24x". Next, we construct a GFile of the target URI to get the target file info. At this point, the query and fragment parts are discarded. The entire fm_directory_view_make_activation_parameters() handling will operate on the GFiles, and we will finally launch them without any query/fragment. Finally, nautilus_launch_application() expects NautilusFiles, instead of URIs, and uses nautilus_file_get_activation_location(), which will return a GFile *. For resolving this issue, we could migrate nautilus_launch_application() to char *-type URIs. I'll look into it... .
*** Bug 545494 has been marked as a duplicate of this bug. ***
*** Bug 548641 has been marked as a duplicate of this bug. ***
Created attachment 117416 [details] [review] [PATCH] Initial patch, modify nautilus_launch_application () to accept an optional separate list of activation URIs in addition to the NautilusFiles and use it if present. Also, modify the surrounding code to store the activation URIs list before roundtripping to GFile. --- libnautilus-private/nautilus-autorun.c | 1 + libnautilus-private/nautilus-mime-actions.c | 77 +++++++++++++++++------ libnautilus-private/nautilus-program-choosing.c | 12 +++- libnautilus-private/nautilus-program-choosing.h | 1 + src/file-manager/fm-directory-view.c | 3 +- src/nautilus-information-panel.c | 2 +- 6 files changed, 72 insertions(+), 24 deletions(-)
could that change be reviewed?
Seems a bit roundabout way of avoiding the fact that activation uri is stored as a GFile. Since having activation uri != NULL is kinda uncommon anyway, why not just store it as a uri.
Any progress on this one, please? It would be a lovely Christmas present to know I can at last reliably open URL shortcuts! ;)
*** Bug 575927 has been marked as a duplicate of this bug. ***
2009-04-01 Alexander Larsson <alexl@redhat.com> Bug 518481 – URL shortcuts do not open query part * libnautilus-private/nautilus-file-private.h: * libnautilus-private/nautilus-file.[ch]: * libnautilus-private/nautilus-desktop-icon-file.c: (update_info_from_link): * libnautilus-private/nautilus-directory-async.c: (lacks_mount): (link_info_done): * libnautilus-private/nautilus-search-directory-file.c: (nautilus_search_directory_file_init): Store NautilusFile activation uri as char *uri, not GFile, as we sometimes handle links that are not true GFile locations such as mailto: links in desktop files. * libnautilus-private/nautilus-desktop-link.[ch]: Add nautilus_desktop_link_get_activation_uri * libnautilus-private/nautilus-directory.c: (nautilus_directory_notify_files_added_by_uri): (nautilus_directory_notify_files_changed_by_uri): (nautilus_directory_notify_files_removed_by_uri): (nautilus_directory_schedule_metadata_remove_by_uri): Use public nautilus_file_list_from_uris instead of local copy of it. * libnautilus-private/nautilus-mime-actions.c: Store both NautilusFile and char *uri in ApplicationLaunchParameters. This allows us to correctly handle uris that don't work well as GFiles and pass them unmodified to the launched applications. * libnautilus-private/nautilus-program-choosing.[ch]: Add nautilus_launch_application_by_uri() that launches an application by specifying the file as a uri, so that we can handle uris that don't work well as GFile/NautilusFiles.
*** Bug 550083 has been marked as a duplicate of this bug. ***
*** Bug 582769 has been marked as a duplicate of this bug. ***