summaryrefslogtreecommitdiff
path: root/src/nautilus-location-entry.c
diff options
context:
space:
mode:
authorStefano Teso <stefano.teso@gmail.com>2011-02-04 16:24:49 -0500
committerCosimo Cecchi <cosimoc@gnome.org>2011-02-04 16:28:12 -0500
commit82fb99a34a6c27f6881e0a049d9882756b615f42 (patch)
tree9c05e498650f7716ecdf62649c94622411d7d9a9 /src/nautilus-location-entry.c
parent1212e12456347da601a77de013082fd1beac8463 (diff)
downloadnautilus-82fb99a34a6c27f6881e0a049d9882756b615f42.tar.gz
location-entry: fix auto-complete for non-local URIs
https://bugzilla.gnome.org/show_bug.cgi?id=635333
Diffstat (limited to 'src/nautilus-location-entry.c')
-rw-r--r--src/nautilus-location-entry.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/nautilus-location-entry.c b/src/nautilus-location-entry.c
index b4ac8ff52..97bd556dd 100644
--- a/src/nautilus-location-entry.c
+++ b/src/nautilus-location-entry.c
@@ -80,7 +80,7 @@ try_to_expand_path (gpointer callback_data)
{
NautilusLocationEntry *entry;
GtkEditable *editable;
- char *suffix, *user_location, *absolute_location;
+ char *suffix, *user_location, *absolute_location, *uri_scheme;
int user_location_length, pos;
entry = NAUTILUS_LOCATION_ENTRY (callback_data);
@@ -89,7 +89,9 @@ try_to_expand_path (gpointer callback_data)
user_location_length = g_utf8_strlen (user_location, -1);
entry->details->idle_id = 0;
- if (!g_path_is_absolute (user_location) && user_location[0] != '~') {
+ uri_scheme = g_uri_parse_scheme (user_location);
+
+ if (!g_path_is_absolute (user_location) && uri_scheme == NULL && user_location[0] != '~') {
absolute_location = g_build_filename (entry->details->current_directory, user_location, NULL);
suffix = g_filename_completer_get_completion_suffix (entry->details->completer,
absolute_location);
@@ -97,9 +99,11 @@ try_to_expand_path (gpointer callback_data)
} else {
suffix = g_filename_completer_get_completion_suffix (entry->details->completer,
user_location);
- g_free (user_location);
}
+ g_free (user_location);
+ g_free (uri_scheme);
+
/* if we've got something, add it to the entry */
if (suffix != NULL) {
pos = user_location_length;