split QProcessEnvironmentPrivate::Unit into Key and Value

Reviewed-by: thiago
Reviewed-by: dt
(cherry picked from commit 11a79c65ea992be0e2ede7dc8f60660c9190291f)
This commit is contained in:
Oswald Buddenhagen 2011-04-21 17:50:40 +02:00 committed by Olivier Goffart
parent 1e9a4bce9d
commit 3ab236d77b
2 changed files with 14 additions and 11 deletions

View File

@ -144,22 +144,22 @@ QT_BEGIN_NAMESPACE
\sa QProcess, QProcess::systemEnvironment(), QProcess::setProcessEnvironment()
*/
#ifdef Q_OS_WIN
static inline QProcessEnvironmentPrivate::Unit prepareName(const QString &name)
static inline QProcessEnvironmentPrivate::Key prepareName(const QString &name)
{ return name.toUpper(); }
static inline QString nameToString(const QProcessEnvironmentPrivate::Unit &name)
static inline QString nameToString(const QProcessEnvironmentPrivate::Key &name)
{ return name; }
static inline QProcessEnvironmentPrivate::Unit prepareValue(const QString &value)
static inline QProcessEnvironmentPrivate::Value prepareValue(const QString &value)
{ return value; }
static inline QString valueToString(const QProcessEnvironmentPrivate::Unit &value)
static inline QString valueToString(const QProcessEnvironmentPrivate::Value &value)
{ return value; }
#else
static inline QProcessEnvironmentPrivate::Unit prepareName(const QString &name)
static inline QProcessEnvironmentPrivate::Key prepareName(const QString &name)
{ return name.toLocal8Bit(); }
static inline QString nameToString(const QProcessEnvironmentPrivate::Unit &name)
static inline QString nameToString(const QProcessEnvironmentPrivate::Key &name)
{ return QString::fromLocal8Bit(name); }
static inline QProcessEnvironmentPrivate::Unit prepareValue(const QString &value)
static inline QProcessEnvironmentPrivate::Value prepareValue(const QString &value)
{ return value.toLocal8Bit(); }
static inline QString valueToString(const QProcessEnvironmentPrivate::Unit &value)
static inline QString valueToString(const QProcessEnvironmentPrivate::Value &value)
{ return QString::fromLocal8Bit(value); }
#endif

View File

@ -85,11 +85,14 @@ class QProcessEnvironmentPrivate: public QSharedData
{
public:
#ifdef Q_OS_WIN
typedef QString Unit;
typedef QString Key;
typedef QString Value;
#else
typedef QByteArray Unit;
typedef QByteArray Key;
typedef QByteArray Value;
#endif
typedef QHash<Unit, Unit> Hash;
typedef QHash<Key, Value> Hash;
Hash hash;
static QProcessEnvironment fromList(const QStringList &list);