summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKjell Ahlstedt <kjellahlstedt@gmail.com>2020-03-15 15:20:06 +0100
committerKjell Ahlstedt <kjellahlstedt@gmail.com>2020-03-15 15:20:06 +0100
commit3261b2ad7e57f749d0fd63b7be7b937d4efeac91 (patch)
treecd4fc20d3e5c793034fa05ec2f50416d6231b331
parentc8d53117a388911e8e19d38500cd7c98a7013650 (diff)
downloadglibmm-3261b2ad7e57f749d0fd63b7be7b937d4efeac91.tar.gz
Glib::get_host_name(): Return a Glib::ustring
g_get_host_name() returns a UTF-8 string.
-rw-r--r--glib/src/miscutils.ccg4
-rw-r--r--glib/src/miscutils.hg8
2 files changed, 5 insertions, 7 deletions
diff --git a/glib/src/miscutils.ccg b/glib/src/miscutils.ccg
index 199035a6..67e0db81 100644
--- a/glib/src/miscutils.ccg
+++ b/glib/src/miscutils.ccg
@@ -98,10 +98,10 @@ get_real_name()
return convert_const_gchar_ptr_to_stdstring(g_get_real_name());
}
-std::string
+Glib::ustring
get_host_name()
{
- return convert_const_gchar_ptr_to_stdstring(g_get_host_name());
+ return convert_const_gchar_ptr_to_ustring(g_get_host_name());
}
std::string
diff --git a/glib/src/miscutils.hg b/glib/src/miscutils.hg
index 10809bde..2d7b0df3 100644
--- a/glib/src/miscutils.hg
+++ b/glib/src/miscutils.hg
@@ -182,17 +182,15 @@ std::string get_real_name();
* is. Callers should not rely on the return value having any specific
* properties like uniqueness for security purposes. Even if the name
* of the machine is changed while an application is running, the
- * return value from this function does not change. The returned
- * string is owned by GLib and should not be modified or freed. If no
- * name can be determined, a default fixed string "localhost" is
- * returned.
+ * return value from this function does not change. If no name can be
+ * determined, a default fixed string "localhost" is returned.
*
* @return The host name of the machine.
*
* @newin{2,64}
*/
GLIBMM_API
-std::string get_host_name();
+Glib::ustring get_host_name();
/** Gets the current user's home directory.
* @return The current user's home directory or an empty string if not defined.