IPC: Un-deprecate the "legacy" key API
This the API that has been around since Qt 4.5. We decided not to deprecate them individually. Instead, we'll deprecate the whole class. Pick-to: 6.6 Change-Id: Ia930b1a2ed1e465a826ffffd179a1b7b3250fd89 Reviewed-by: Topi Reiniö <topi.reinio@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
parent
b09168740b
commit
905593a40b
@ -125,23 +125,17 @@ QSharedMemory::QSharedMemory(const QNativeIpcKey &key, QObject *parent)
|
|||||||
setNativeKey(key);
|
setNativeKey(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if QT_DEPRECATED_SINCE(6, 10)
|
|
||||||
/*!
|
/*!
|
||||||
\deprecated
|
|
||||||
|
|
||||||
Constructs a shared memory object with the given \a parent and with
|
Constructs a shared memory object with the given \a parent and with
|
||||||
the legacy key set to \a key. Because its key is set, its create() and
|
the legacy key set to \a key. Because its key is set, its create() and
|
||||||
attach() functions can be called.
|
attach() functions can be called.
|
||||||
|
|
||||||
Legacy keys are deprecated. See \l{Native IPC Keys} for more information.
|
|
||||||
|
|
||||||
\sa setKey(), create(), attach()
|
\sa setKey(), create(), attach()
|
||||||
*/
|
*/
|
||||||
QSharedMemory::QSharedMemory(const QString &key, QObject *parent)
|
QSharedMemory::QSharedMemory(const QString &key, QObject *parent)
|
||||||
: QSharedMemory(legacyNativeKey(key), parent)
|
: QSharedMemory(legacyNativeKey(key), parent)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
The destructor clears the key, which forces the shared memory object
|
The destructor clears the key, which forces the shared memory object
|
||||||
@ -160,9 +154,7 @@ QSharedMemory::~QSharedMemory()
|
|||||||
d->cleanHandle();
|
d->cleanHandle();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if QT_DEPRECATED_SINCE(6, 10)
|
|
||||||
/*!
|
/*!
|
||||||
\deprecated
|
|
||||||
\overload
|
\overload
|
||||||
|
|
||||||
Sets the legacy \a key for this shared memory object. If \a key is the same
|
Sets the legacy \a key for this shared memory object. If \a key is the same
|
||||||
@ -186,7 +178,6 @@ void QSharedMemory::setKey(const QString &key)
|
|||||||
{
|
{
|
||||||
setNativeKey(legacyNativeKey(key));
|
setNativeKey(legacyNativeKey(key));
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\since 4.8
|
\since 4.8
|
||||||
@ -298,9 +289,7 @@ bool QSharedMemoryPrivate::initKey(SemaphoreAccessMode mode)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if QT_DEPRECATED_SINCE(6, 10)
|
|
||||||
/*!
|
/*!
|
||||||
\deprecated
|
|
||||||
Returns the legacy key assigned with setKey() to this shared memory, or a null key
|
Returns the legacy key assigned with setKey() to this shared memory, or a null key
|
||||||
if no key has been assigned, or if the segment is using a nativeKey(). The
|
if no key has been assigned, or if the segment is using a nativeKey(). The
|
||||||
key is the identifier used by Qt applications to identify the shared memory
|
key is the identifier used by Qt applications to identify the shared memory
|
||||||
@ -316,7 +305,6 @@ QString QSharedMemory::key() const
|
|||||||
Q_D(const QSharedMemory);
|
Q_D(const QSharedMemory);
|
||||||
return QNativeIpcKeyPrivate::legacyKey(d->nativeKey);
|
return QNativeIpcKeyPrivate::legacyKey(d->nativeKey);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\since 4.8
|
\since 4.8
|
||||||
|
@ -50,14 +50,9 @@ public:
|
|||||||
QSharedMemory(const QNativeIpcKey &key, QObject *parent = nullptr);
|
QSharedMemory(const QNativeIpcKey &key, QObject *parent = nullptr);
|
||||||
~QSharedMemory();
|
~QSharedMemory();
|
||||||
|
|
||||||
#if QT_DEPRECATED_SINCE(6, 10)
|
|
||||||
QT_DEPRECATED_VERSION_X_6_10("Please refer to 'Native IPC Key' documentation")
|
|
||||||
QSharedMemory(const QString &key, QObject *parent = nullptr);
|
QSharedMemory(const QString &key, QObject *parent = nullptr);
|
||||||
QT_DEPRECATED_VERSION_X_6_10("Please refer to 'Native IPC Key' documentation")
|
|
||||||
void setKey(const QString &key);
|
void setKey(const QString &key);
|
||||||
QT_DEPRECATED_VERSION_X_6_10("Please refer to 'Native IPC Key' documentation")
|
|
||||||
QString key() const;
|
QString key() const;
|
||||||
#endif
|
|
||||||
|
|
||||||
void setNativeKey(const QNativeIpcKey &key);
|
void setNativeKey(const QNativeIpcKey &key);
|
||||||
void setNativeKey(const QString &key, QNativeIpcKey::Type type = QNativeIpcKey::legacyDefaultTypeForOs())
|
void setNativeKey(const QString &key, QNativeIpcKey::Type type = QNativeIpcKey::legacyDefaultTypeForOs())
|
||||||
|
@ -68,24 +68,13 @@ inline void QSystemSemaphorePrivate::destructBackend()
|
|||||||
\sa {Inter-Process Communication}, QSharedMemory, QSemaphore
|
\sa {Inter-Process Communication}, QSharedMemory, QSemaphore
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if QT_DEPRECATED_SINCE(6, 10)
|
|
||||||
/*!
|
/*!
|
||||||
\deprecated
|
Requests a system semaphore identified by the legacy key \a key.
|
||||||
|
|
||||||
Requests a system semaphore identified by the legacy key \a key. This
|
|
||||||
constructor does the same as:
|
|
||||||
|
|
||||||
\code
|
|
||||||
QSystemSemaphore(QSystemSemaphore::legacyNativeKey(key), initialValue, mode)
|
|
||||||
\endcode
|
|
||||||
|
|
||||||
except that it stores the legacy native key to retrieve using key().
|
|
||||||
*/
|
*/
|
||||||
QSystemSemaphore::QSystemSemaphore(const QString &key, int initialValue, AccessMode mode)
|
QSystemSemaphore::QSystemSemaphore(const QString &key, int initialValue, AccessMode mode)
|
||||||
: QSystemSemaphore(legacyNativeKey(key), initialValue, mode)
|
: QSystemSemaphore(legacyNativeKey(key), initialValue, mode)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Requests a system semaphore for the specified \a key. The parameters
|
Requests a system semaphore for the specified \a key. The parameters
|
||||||
@ -226,9 +215,7 @@ QNativeIpcKey QSystemSemaphore::nativeIpcKey() const
|
|||||||
return d->nativeKey;
|
return d->nativeKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if QT_DEPRECATED_SINCE(6, 10)
|
|
||||||
/*!
|
/*!
|
||||||
\deprecated
|
|
||||||
This function works the same as the constructor. It reconstructs
|
This function works the same as the constructor. It reconstructs
|
||||||
this QSystemSemaphore object. If the new \a key is different from
|
this QSystemSemaphore object. If the new \a key is different from
|
||||||
the old key, calling this function is like calling the destructor of
|
the old key, calling this function is like calling the destructor of
|
||||||
@ -244,7 +231,6 @@ void QSystemSemaphore::setKey(const QString &key, int initialValue, AccessMode m
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\deprecated
|
|
||||||
Returns the legacy key assigned to this system semaphore. The key is the
|
Returns the legacy key assigned to this system semaphore. The key is the
|
||||||
name by which the semaphore can be accessed from other processes.
|
name by which the semaphore can be accessed from other processes.
|
||||||
|
|
||||||
@ -254,7 +240,6 @@ QString QSystemSemaphore::key() const
|
|||||||
{
|
{
|
||||||
return QNativeIpcKeyPrivate::legacyKey(d->nativeKey);
|
return QNativeIpcKeyPrivate::legacyKey(d->nativeKey);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Acquires one of the resources guarded by this semaphore, if there is
|
Acquires one of the resources guarded by this semaphore, if there is
|
||||||
|
@ -47,14 +47,9 @@ public:
|
|||||||
{ setNativeKey({ key, type }, initialValue, mode); }
|
{ setNativeKey({ key, type }, initialValue, mode); }
|
||||||
QNativeIpcKey nativeIpcKey() const;
|
QNativeIpcKey nativeIpcKey() const;
|
||||||
|
|
||||||
#if QT_DEPRECATED_SINCE(6, 10)
|
|
||||||
QT_DEPRECATED_VERSION_X_6_10("Please refer to 'Native IPC Key' documentation")
|
|
||||||
QSystemSemaphore(const QString &key, int initialValue = 0, AccessMode mode = Open);
|
QSystemSemaphore(const QString &key, int initialValue = 0, AccessMode mode = Open);
|
||||||
QT_DEPRECATED_VERSION_X_6_10("Please refer to 'Native IPC Key' documentation")
|
|
||||||
void setKey(const QString &key, int initialValue = 0, AccessMode mode = Open);
|
void setKey(const QString &key, int initialValue = 0, AccessMode mode = Open);
|
||||||
QT_DEPRECATED_VERSION_X_6_10("Please refer to 'Native IPC Key' documentation")
|
|
||||||
QString key() const;
|
QString key() const;
|
||||||
#endif
|
|
||||||
|
|
||||||
bool acquire();
|
bool acquire();
|
||||||
bool release(int n = 1);
|
bool release(int n = 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user