Last active
May 23, 2016 17:25
-
-
Save luis-pereira/ecea31ec60fe4a534d98d57a2e44e226 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/qtxdg/xdgdesktopfile.cpp b/qtxdg/xdgdesktopfile.cpp | |
index 659fbf4..b7ad0be 100644 | |
--- a/qtxdg/xdgdesktopfile.cpp | |
+++ b/qtxdg/xdgdesktopfile.cpp | |
@@ -676,13 +676,13 @@ void XdgDesktopFile::setLocalizedValue(const QString &key, const QVariant &value | |
************************************************/ | |
QString XdgDesktopFile::localizedKey(const QString& key) const | |
{ | |
- QString lang = QString::fromLocal8Bit(qgetenv("LC_MESSAGES")); | |
+ QString lang = QString::fromLatin1(qgetenv("LC_MESSAGES")); | |
if (lang.isEmpty()) | |
- lang = QString::fromLocal8Bit(qgetenv("LC_ALL")); | |
+ lang = QString::fromLatin1(qgetenv("LC_ALL")); | |
if (lang.isEmpty()) | |
- lang = QString::fromLocal8Bit(qgetenv("LANG")); | |
+ lang = QString::fromLatin1(qgetenv("LANG")); | |
QString modifier = lang.section(QLatin1Char('@'), 1); | |
if (!modifier.isEmpty()) | |
@@ -929,7 +929,7 @@ QString expandEnvVariables(const QString str) | |
res.replace(QRegExp(QString::fromLatin1("~(?=$|/)")), QFile::decodeName(qgetenv("HOME"))); | |
replaceVar(res, QLatin1String("HOME"), QFile::decodeName(qgetenv("HOME"))); | |
- replaceVar(res, QLatin1String("USER"), QString::fromLocal8Bit(getenv("USER"))); | |
+ replaceVar(res, QLatin1String("USER"), QString::fromUtf8(getenv("USER"))); | |
replaceVar(res, QLatin1String("XDG_DESKTOP_DIR"), XdgDirs::userDir(XdgDirs::Desktop)); | |
replaceVar(res, QLatin1String("XDG_TEMPLATES_DIR"), XdgDirs::userDir(XdgDirs::Templates)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment