summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2012-10-19 18:28:51 -0400
committerCosimo Cecchi <cosimoc@gnome.org>2012-10-22 19:07:13 -0400
commit65c02e2cd70a5913087c0636021eea7acab6e969 (patch)
tree2bf0e67e6b28db5280da501ad6546892b46e2137
parent231f0b074da973f2c0b69513b743548810d4e716 (diff)
downloadnautilus-65c02e2cd70a5913087c0636021eea7acab6e969.tar.gz
mime-actions: resolve symbolic links before launching the application
We already do this for all other kind of references, and I think it makes sense to do it for symbolic links too. This also ensures applications don't have to deal with e.g. ensuring backup files are saved relative to the original file and not the symlink, as reported in https://bugzilla.gnome.org/show_bug.cgi?id=686465
-rw-r--r--src/nautilus-mime-actions.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/nautilus-mime-actions.c b/src/nautilus-mime-actions.c
index 13a6a21bf..5a838a018 100644
--- a/src/nautilus-mime-actions.c
+++ b/src/nautilus-mime-actions.c
@@ -2020,13 +2020,21 @@ activate_activation_uris_ready_callback (GList *files_ignore,
/* Convert the files to the actual activation uri files */
for (l = parameters->locations; l != NULL; l = l->next) {
- char *uri;
+ char *uri = NULL;
+
location = l->data;
/* We want the file for the activation URI since we care
* about the attributes for that, not for the original file.
*/
- uri = nautilus_file_get_activation_uri (location->file);
+ if (nautilus_file_is_symbolic_link (location->file)) {
+ uri = nautilus_file_get_symbolic_link_target_uri (location->file);
+ }
+
+ if (uri == NULL) {
+ uri = nautilus_file_get_activation_uri (location->file);
+ }
+
if (uri != NULL) {
launch_location_update_from_uri (location, uri);
}