[gnome-commander] Show error message about invalid URI in the GUI



commit cbf4b52e0e40e1270f96bdacbec878f83bc7717f
Author: Uwe Scholz <u scholz83 gmx de>
Date:   Thu Sep 30 23:14:28 2021 +0200

    Show error message about invalid URI in the GUI

 src/dialogs/gnome-cmd-con-dialog.cc | 2 +-
 src/gnome-cmd-con.h                 | 2 --
 2 files changed, 1 insertion(+), 3 deletions(-)
---
diff --git a/src/dialogs/gnome-cmd-con-dialog.cc b/src/dialogs/gnome-cmd-con-dialog.cc
index 864b70cd..3de333f2 100644
--- a/src/dialogs/gnome-cmd-con-dialog.cc
+++ b/src/dialogs/gnome-cmd-con-dialog.cc
@@ -319,7 +319,7 @@ gboolean GnomeCmdConnectDialog::verify_uri()
 
     gnome_cmd_con_make_uri (uri, (ConnectionMethodID) type, priv->auth==GnomeCmdCon::SAVE_PERMANENTLY, uri, 
server, share, port, folder, domain, user, password);
 
-    if (type==CON_URI && uri.empty())
+    if (type==CON_URI && !uri_is_valid(uri.c_str()))
     {
         gnome_cmd_show_message (*this,
                                 stringify(g_strdup_printf (_("ā€œ%sā€ is not a valid location"), uri.c_str())),
diff --git a/src/gnome-cmd-con.h b/src/gnome-cmd-con.h
index dbff832f..1b960dbe 100644
--- a/src/gnome-cmd-con.h
+++ b/src/gnome-cmd-con.h
@@ -471,14 +471,12 @@ inline std::string &gnome_cmd_con_make_custom_uri (std::string &s, const std::st
     {
         g_warning ("g_uri_parse error of \"%s\": %s", uri.c_str(), error->message);
         g_error_free(error);
-        s.erase();
         return s;
     }
     stringify (s, g_uri_to_string(gUri));
 
     if (!uri_is_valid (s))
         s.erase();
-
     return s;
 }
 


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