summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefano Teso <stefano.teso@gmail.com>2011-05-23 11:20:26 -0400
committerCosimo Cecchi <cosimoc@gnome.org>2011-05-23 11:20:26 -0400
commit25badb9e28ef372f5d4febefd6b2409c6e21670c (patch)
tree992737d5418b60cc014fff18ad50d57fedd70499
parent2513d69fa7258c044d48547ce042b8aaa9053c1f (diff)
downloadnautilus-25badb9e28ef372f5d4febefd6b2409c6e21670c.tar.gz
connect-server: strip the scheme if it matches the chosen method
If e.g. ftp://ftp.example.com is specified as an address, and the FTP method is chosen, we should strip "ftp://" automatically from the address before connecting. https://bugzilla.gnome.org/show_bug.cgi?id=643608
-rw-r--r--src/nautilus-connect-server-dialog.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/nautilus-connect-server-dialog.c b/src/nautilus-connect-server-dialog.c
index 11d9fec5d..f1aa337bb 100644
--- a/src/nautilus-connect-server-dialog.c
+++ b/src/nautilus-connect-server-dialog.c
@@ -513,6 +513,7 @@ connect_dialog_connect_to_server (NautilusConnectServerDialog *dialog)
GtkTreeIter iter;
char *user, *initial_path, *server, *folder, *domain, *port_str;
char *t, *join, *uri;
+ char *temp, *stripped_server;
double port;
/* Get our method info */
@@ -524,6 +525,14 @@ connect_dialog_connect_to_server (NautilusConnectServerDialog *dialog)
server = gtk_editable_get_chars (GTK_EDITABLE (dialog->details->server_entry), 0, -1);
+ temp = g_strconcat (meth->scheme, "://", NULL);
+ if (g_str_has_prefix (server, temp)) {
+ stripped_server = g_strdup (server + strlen (temp));
+ g_free (server);
+ server = stripped_server;
+ }
+ g_free (temp);
+
user = NULL;
initial_path = g_strdup ("");
domain = NULL;