summaryrefslogtreecommitdiffstats
path: root/tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@qt.io>2017-09-02 10:27:08 +0200
committerFrederik Gladhorn <frederik.gladhorn@qt.io>2017-09-02 10:27:09 +0200
commit9831118378c5d489f76089011277a1b7234a8d68 (patch)
treea67e82fde179fa727172fff9098758d60912189d /tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp
parentb5d471d0c23128528a0aa33ed5172bb1bab05bb1 (diff)
parent4fa90c1757c15425d5e0df1a4f5dbc7e77c265f8 (diff)
Merge dev into 5.10
Diffstat (limited to 'tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp')
-rw-r--r--tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp b/tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp
index c20fafe158..92a06cda00 100644
--- a/tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp
+++ b/tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp
@@ -136,7 +136,7 @@ QStringList tst_QPrinterInfo::getPrintersFromSystem()
#ifdef Q_OS_UNIX
// This function does roughly the same as the `command substitution` in
// the shell.
-QString tst_QPrinterInfo::getOutputFromCommand(const QStringList& command)
+QString getOutputFromCommandInternal(const QStringList &command)
{
// The command execution does nothing on non-unix systems.
int pid;
@@ -194,6 +194,16 @@ QString tst_QPrinterInfo::getOutputFromCommand(const QStringList& command)
return QString(array);
}
}
+
+QString tst_QPrinterInfo::getOutputFromCommand(const QStringList &command)
+{
+ // Forces the ouptut from the command to be in English
+ const QByteArray origSoftwareEnv = qgetenv("SOFTWARE");
+ qputenv("SOFTWARE", QByteArray());
+ QString output = getOutputFromCommandInternal(command);
+ qputenv("SOFTWARE", origSoftwareEnv);
+ return output;
+}
#endif
// Windows test support not yet implemented