diff options
Diffstat (limited to 'src/corelib/ipc/qtipccommon_p.h')
-rw-r--r-- | src/corelib/ipc/qtipccommon_p.h | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/src/corelib/ipc/qtipccommon_p.h b/src/corelib/ipc/qtipccommon_p.h index bdcdaabd53..72762c5ba7 100644 --- a/src/corelib/ipc/qtipccommon_p.h +++ b/src/corelib/ipc/qtipccommon_p.h @@ -28,6 +28,37 @@ QT_BEGIN_NAMESPACE +class QNativeIpcKeyPrivate +{ +public: + QString legacyKey_; + + static QString legacyKey(const QNativeIpcKey &key) + { + if (key.isSlowPath()) + return key.d->legacyKey_; + return QString(); + } + static void setLegacyKey(QNativeIpcKey &key, const QString &legacyKey) + { + QNativeIpcKeyPrivate::makeExtended(key)->legacyKey_ = legacyKey; + } + static void setNativeAndLegacyKeys(QNativeIpcKey &key, const QString &nativeKey, + const QString &legacyKey) + { + key.setNativeKey(nativeKey); + setLegacyKey(key, legacyKey); + } + +private: + static QNativeIpcKeyPrivate *makeExtended(QNativeIpcKey &key) + { + if (!key.isSlowPath()) + key.d = new QNativeIpcKeyPrivate; + return key.d; + } +}; + namespace QtIpcCommon { enum class IpcType { SharedMemory, @@ -113,10 +144,8 @@ public: } }; -Q_AUTOTEST_EXPORT QString -legacyPlatformSafeKey(const QString &key, IpcType ipcType, - QNativeIpcKey::Type type = QNativeIpcKey::legacyDefaultTypeForOs()); -Q_AUTOTEST_EXPORT QString platformSafeKey(const QString &key, IpcType ipcType, QNativeIpcKey::Type type); +QNativeIpcKey legacyPlatformSafeKey(const QString &key, IpcType ipcType, QNativeIpcKey::Type type); +QNativeIpcKey platformSafeKey(const QString &key, IpcType ipcType, QNativeIpcKey::Type type); #ifdef Q_OS_UNIX // Convenience function to create the file if needed |