class QSocketNotifier;
class QTimer;
-class QProcEnvKey
-{
-public:
- QProcEnvKey() : hash(0) {}
- explicit QProcEnvKey(const QByteArray &other) : key(other), hash(qHash(key)) {}
- QProcEnvKey(const QProcEnvKey &other) { *this = other; }
- bool operator==(const QProcEnvKey &other) const { return key == other.key; }
-
- QByteArray key;
- uint hash;
-};
-inline uint qHash(const QProcEnvKey &key) { return key.hash; }
-
class QProcEnvValue
{
public:
mutable QString stringValue;
};
Q_DECLARE_TYPEINFO(QProcEnvValue, Q_MOVABLE_TYPE);
-Q_DECLARE_TYPEINFO(QProcEnvKey, Q_MOVABLE_TYPE);
class QProcessEnvironmentPrivate: public QSharedData
{
public:
- typedef QProcEnvKey Key;
+ typedef QByteArray Key;
typedef QProcEnvValue Value;
inline Key prepareName(const QString &name) const
{
Key &ent = nameMap[name];
- if (ent.key.isEmpty())
- ent = Key(name.toLocal8Bit());
+ if (ent.isEmpty())
+ ent = name.toLocal8Bit();
return ent;
}
inline QString nameToString(const Key &name) const
{
- const QString sname = QString::fromLocal8Bit(name.key.constData());
+ const QString sname = QString::fromLocal8Bit(name.constData());
nameMap[sname] = name;
return sname;
}
QProcessEnvironmentPrivate::Hash::ConstIterator it = environment.constBegin();
const QProcessEnvironmentPrivate::Hash::ConstIterator end = environment.constEnd();
for ( ; it != end; ++it) {
- QByteArray key = it.key().key;
+ QByteArray key = it.key();
QByteArray value = it.value().bytes();
key.reserve(key.length() + 1 + value.length());
key.append('=');