summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qprocess_p.h
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2011-04-21 18:32:36 +0200
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2011-04-29 12:59:52 +0200
commitf3db5603871928ebed43a085a496397e65952b39 (patch)
treee54aafed9aadc3dc4f93aa902b908dd942b14782 /src/corelib/io/qprocess_p.h
parent11a79c65ea992be0e2ede7dc8f60660c9190291f (diff)
make QProcessEnvironment on Windows preserve variable name case
while windows itself does not care which case the variable names are in, they may be passed to unix tools which *do* care. note that this uses true case folding for string comparisons while windows uses uppercasing. this means that "ess" and "eß" will be considered the same by us, while not by windows. this is not expected to have real-world impact, particularly because non-ascii variable names are not used much. Task-number: QTCREATORBUG-3110 Reviewed-by: thiago Reviewed-by: dt
Diffstat (limited to 'src/corelib/io/qprocess_p.h')
-rw-r--r--src/corelib/io/qprocess_p.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/corelib/io/qprocess_p.h b/src/corelib/io/qprocess_p.h
index b2a69ef905..2d4c55670d 100644
--- a/src/corelib/io/qprocess_p.h
+++ b/src/corelib/io/qprocess_p.h
@@ -85,7 +85,15 @@ class QProcessEnvironmentPrivate: public QSharedData
{
public:
#ifdef Q_OS_WIN
- typedef QString Key;
+ class Key : public QString
+ {
+ public:
+ Key() {}
+ explicit Key(const QString &other) : QString(other) {}
+ Key(const Key &other) : QString(other) {}
+ bool operator==(const Key &other) const { return !compare(other, Qt::CaseInsensitive); }
+ };
+
typedef QString Value;
#else
typedef QByteArray Key;
@@ -100,6 +108,10 @@ public:
QStringList keys() const;
void insert(const Hash &hash);
};
+#ifdef Q_OS_WIN
+Q_DECLARE_TYPEINFO(QProcessEnvironmentPrivate::Key, Q_MOVABLE_TYPE);
+inline uint qHash(const QProcessEnvironmentPrivate::Key &key) { return qHash(key.toCaseFolded()); }
+#endif
class QProcessPrivate : public QIODevicePrivate
{