From ced1fdd37cb4a6d127afe1341f1d43f76623023b Mon Sep 17 00:00:00 2001 From: Robert Adam Date: Fri, 28 Aug 2020 09:32:59 +0200 Subject: FIX(cmake): Set QT_RESTRICTED_CAST_FROM_ASCII With the old qmake buildsystem we used to set QT_NO_CAST_FROM_ASCII (for the Mumble client) in order to avoid problems with character encodings in our Strings. This was not done in the new cmake system yet. Instead of the aforementioned macro, this commit sets (for all targets) QT_RESTRICTED_CAST_FROM_ASCII instead in order to be able to automatically convert direct String literals to QString as these usually don't contain any problematic characters (non-ASCII) in the first place. And this allows to e.g. compare a QString against a String literal or do something like QString myString = "This is a test"; which we know to be unproblematic. Note however that (quote from Qt's docs) "Using this macro together with source strings outside the 7-bit range, non-literals, or literals with embedded NUL characters is undefined." --- src/murmur/UnixMurmur.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/murmur/UnixMurmur.cpp') diff --git a/src/murmur/UnixMurmur.cpp b/src/murmur/UnixMurmur.cpp index 954e4f2a5..2b2abd0ec 100644 --- a/src/murmur/UnixMurmur.cpp +++ b/src/murmur/UnixMurmur.cpp @@ -292,7 +292,7 @@ void UnixMurmur::setuid() { // QDir::homePath is broken. It only looks at $HOME // instead of getpwuid() so we have to set our home // ourselves - EnvUtils::setenv(QLatin1String("HOME"), qPrintable(Meta::mp.qsHome)); + EnvUtils::setenv(QLatin1String("HOME"), Meta::mp.qsHome); } #endif } else if (bRoot) { -- cgit v1.2.3