summaryrefslogtreecommitdiff
path: root/src/libs/utils/environment.cpp
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@theqtcompany.com>2016-04-07 13:06:01 +0200
committerJarek Kobus <jaroslaw.kobus@theqtcompany.com>2016-04-11 12:36:29 +0000
commit3f19774c0fa8ce280198eca02512bda03e2e68f3 (patch)
treef72c70c4c3b4d6b72165dc629e36682ca2322714 /src/libs/utils/environment.cpp
parent6fc7fb5f578f449302de5b6c60b6a7a2ffc17618 (diff)
downloadqt-creator-3f19774c0fa8ce280198eca02512bda03e2e68f3.tar.gz
Set LC_MESSAGES instead of LC_ALL for parsing the error output
Task-number: QTCREATORBUG-15855 Change-Id: I05aa83acb356840cfdacc92796b190fb8754ada0 Reviewed-by: hjk <hjk@theqtcompany.com> Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Diffstat (limited to 'src/libs/utils/environment.cpp')
-rw-r--r--src/libs/utils/environment.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/libs/utils/environment.cpp b/src/libs/utils/environment.cpp
index eeb7f75925..50c32f9a07 100644
--- a/src/libs/utils/environment.cpp
+++ b/src/libs/utils/environment.cpp
@@ -212,6 +212,26 @@ Environment Environment::systemEnvironment()
return *staticSystemEnvironment();
}
+const char lcMessages[] = "LC_MESSAGES";
+const char englishLocale[] = "en_US.utf8";
+
+void Environment::setupEnglishOutput(Environment *environment)
+{
+ environment->set(QLatin1String(lcMessages), QLatin1String(englishLocale));
+}
+
+void Environment::setupEnglishOutput(QProcessEnvironment *environment)
+{
+ environment->insert(QLatin1String(lcMessages), QLatin1String(englishLocale));
+}
+
+void Environment::setupEnglishOutput(QStringList *environment)
+{
+ Environment env(*environment);
+ setupEnglishOutput(&env);
+ *environment = env.toStringList();
+}
+
void Environment::clear()
{
m_values.clear();