[gnome-commander] Separates declaration and definition of gnome_cmd_con_make_smb_uri function



commit 625229cd85afa5dfebda26c7212e4ec40705bd78
Author: Uwe Scholz <uwescholz src gnome org>
Date:   Tue Apr 11 21:49:56 2017 +0200

    Separates declaration and definition of gnome_cmd_con_make_smb_uri function

 src/gnome-cmd-con.cc |   34 ++++++++++++++++++++++++++++++++++
 src/gnome-cmd-con.h  |   32 +-------------------------------
 2 files changed, 35 insertions(+), 31 deletions(-)
---
diff --git a/src/gnome-cmd-con.cc b/src/gnome-cmd-con.cc
index 4a82506..a671388 100644
--- a/src/gnome-cmd-con.cc
+++ b/src/gnome-cmd-con.cc
@@ -559,6 +559,40 @@ string &__gnome_cmd_con_make_uri (string &s, const gchar *method, gboolean use_a
     return s;
 }
 
+#ifdef HAVE_SAMBA
+std::string &gnome_cmd_con_make_smb_uri (std::string &s, gboolean use_auth, std::string &server, std::string 
&share, std::string &folder, std::string &domain, std::string &user, std::string &password)
+{
+    share = '/' + share;
+
+    user = stringify (gnome_vfs_escape_string (user.c_str()));
+    password = stringify (gnome_vfs_escape_string (password.c_str()));
+
+    if (!password.empty() && !use_auth)
+    {
+        user += ':';
+        user += password;
+    }
+
+    if (!domain.empty())
+        user = domain + ';' + user;
+
+    const gchar *join = !folder.empty() && folder[0] != '/' ? "/" : "";
+
+    folder = share + join + folder;
+    folder = stringify (gnome_vfs_escape_path_string (folder.c_str()));
+
+    s = "smb://";
+
+    if (!user.empty())
+        s += user + '@';
+
+    s += server;
+    s += folder;
+
+    return s;
+}
+#endif
+
 
 XML::xstream &operator << (XML::xstream &xml, GnomeCmdCon &con)
 {
diff --git a/src/gnome-cmd-con.h b/src/gnome-cmd-con.h
index f3d33fe..bcc55c8 100644
--- a/src/gnome-cmd-con.h
+++ b/src/gnome-cmd-con.h
@@ -427,37 +427,7 @@ inline std::string &gnome_cmd_con_make_ftp_uri (std::string &s, gboolean use_aut
 }
 
 #ifdef HAVE_SAMBA
-inline std::string &gnome_cmd_con_make_smb_uri (std::string &s, gboolean use_auth, std::string &server, 
std::string &share, std::string &folder, std::string &domain, std::string &user, std::string &password)
-{
-    share = '/' + share;
-
-    user = stringify (gnome_vfs_escape_string (user.c_str()));
-    password = stringify (gnome_vfs_escape_string (password.c_str()));
-
-    if (!password.empty() && !use_auth)
-    {
-        user += ':';
-        user += password;
-    }
-
-    if (!domain.empty())
-        user = domain + ';' + user;
-
-    const gchar *join = !folder.empty() && folder[0] != '/' ? "/" : "";
-
-    folder = share + join + folder;
-    folder = stringify (gnome_vfs_escape_path_string (folder.c_str()));
-
-    s = "smb://";
-
-    if (!user.empty())
-        s += user + '@';
-
-    s += server;
-    s += folder;
-
-    return s;
-}
+std::string &gnome_cmd_con_make_smb_uri (std::string &s, gboolean use_auth, std::string &server, std::string 
&share, std::string &folder, std::string &domain, std::string &user, std::string &password);
 #endif
 
 inline std::string &gnome_cmd_con_make_dav_uri (std::string &s, gboolean use_auth, std::string &server, 
std::string &port, std::string &folder, std::string &user, std::string &password)


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