summaryrefslogtreecommitdiffstats
path: root/tests/auto/printsupport
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/printsupport')
-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