[nautilus] Don't show a full path in the dialog for unknown file types



commit f9bdd4f33bb4c20926564a8d7d7176712cb105fc
Author: William Jon McCann <jmccann redhat com>
Date:   Mon Aug 13 17:00:34 2012 -0400

    Don't show a full path in the dialog for unknown file types

 src/nautilus-mime-actions.c |   17 +++++------------
 1 files changed, 5 insertions(+), 12 deletions(-)
---
diff --git a/src/nautilus-mime-actions.c b/src/nautilus-mime-actions.c
index c877b25..86d2bef 100644
--- a/src/nautilus-mime-actions.c
+++ b/src/nautilus-mime-actions.c
@@ -1095,27 +1095,20 @@ static char *
 get_application_no_mime_type_handler_message (NautilusFile *file, char *uri)
 {
 	char *uri_for_display;
-	char *nice_uri;
+	char *name;
 	char *error_message;
-	GFile *location;
 
-	/* For local files, we want to use filename if possible */
-	if (nautilus_file_is_local (file)) {
-		location = nautilus_file_get_location (file);
-		nice_uri = g_file_get_parse_name (location);
-		g_object_unref (location);
-	} else {
-		nice_uri = g_strdup (uri);
-	}
+	name = nautilus_file_get_display_name (file);
 
 	/* Truncate the URI so it doesn't get insanely wide. Note that even
 	 * though the dialog uses wrapped text, if the URI doesn't contain
 	 * white space then the text-wrapping code is too stupid to wrap it.
 	 */
-	uri_for_display = eel_str_middle_truncate (nice_uri, MAX_URI_IN_DIALOG_LENGTH);
+	uri_for_display = eel_str_middle_truncate (name, MAX_URI_IN_DIALOG_LENGTH);
 	error_message = g_strdup_printf (_("Could not display \"%s\"."), uri_for_display);
-	g_free (nice_uri);
 	g_free (uri_for_display);
+	g_free (name);
+
 	return error_message;
 }
 



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