[nautilus] mime-actions: resolve symbolic links before launching the application



commit fe1965f2cafc4616caaea0ae048bf1ff5c8975f5
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Fri Oct 19 18:28:51 2012 -0400

    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

 src/nautilus-mime-actions.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/nautilus-mime-actions.c b/src/nautilus-mime-actions.c
index 13a6a21..5a838a0 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);
 		}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]