diff --git a/src/configuration.cpp b/src/configuration.cpp index bc83b32a49..06078455f1 100644 --- a/src/configuration.cpp +++ b/src/configuration.cpp @@ -25,6 +25,8 @@ #include "configuration.h" +#include "str_helpers.h" + #include #include @@ -220,14 +222,14 @@ bool Config::Read(const std::string& key, std::string *out) wxString s; if (!wxConfig::Get()->Read(key, &s)) return false; - *out = s.utf8_string(); + *out = str::to_utf8(s); return true; } void Config::Write(const std::string& key, const std::string& value) { CfgLock lock; - wxConfig::Get()->Write(key, wxString(value)); + wxConfig::Get()->Write(key, str::to_wx(value)); } bool Config::Read(const std::string& key, std::wstring *out) @@ -237,14 +239,14 @@ bool Config::Read(const std::string& key, std::wstring *out) wxString s; if (!wxConfig::Get()->Read(key, &s)) return false; - *out = s.ToStdWstring(); + *out = str::to_wstring(s); return true; } void Config::Write(const std::string& key, const std::wstring& value) { CfgLock lock; - wxConfig::Get()->Write(key, wxString(value)); + wxConfig::Get()->Write(key, str::to_wx(value)); } bool Config::Read(const std::string& key, bool *out) diff --git a/src/str_helpers.h b/src/str_helpers.h index 60107f3dbf..29ff4558db 100644 --- a/src/str_helpers.h +++ b/src/str_helpers.h @@ -108,6 +108,11 @@ inline wxString to_wx(const std::string& utf8) return wxString::FromUTF8(utf8.c_str()); } +inline wxString to_wx(const std::wstring& str) +{ + return wxString(str); +} + #if defined(__cplusplus) && defined(__OBJC__) inline NSString *to_NS(const wxString& str)