QSharedMemory: remove QT_NO_QOBJECT

This was only needed for bootstrapped builds, but QSharedMemory is no
longer part of it since commit 75082c9f20.

Change-Id: If4c23ea3719947d790d4fffd171522c0d5f9aafb
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
bb10
Thiago Macieira 2022-09-15 13:30:48 -07:00
parent 469dbe5c6d
commit de25c1d27d
5 changed files with 4 additions and 51 deletions

View File

@ -174,17 +174,11 @@ QSharedMemoryPrivate::makePlatformSafeKey(const QString &key,
\sa setKey()
*/
#ifndef QT_NO_QOBJECT
QSharedMemory::QSharedMemory(QObject *parent)
: QObject(*new QSharedMemoryPrivate, parent)
{
}
#else
QSharedMemory::QSharedMemory()
: d_ptr(new QSharedMemoryPrivate)
{
}
#endif
/*!
Constructs a shared memory object with the given \a parent and with
its key set to \a key. Because its key is set, its create() and
@ -192,19 +186,11 @@ QSharedMemory::QSharedMemory()
\sa setKey(), create(), attach()
*/
#ifndef QT_NO_QOBJECT
QSharedMemory::QSharedMemory(const QString &key, QObject *parent)
: QObject(*new QSharedMemoryPrivate, parent)
{
setKey(key);
}
#else
QSharedMemory::QSharedMemory(const QString &key)
: d_ptr(new QSharedMemoryPrivate)
{
setKey(key);
}
#endif
/*!
The destructor clears the key, which forces the shared memory object
@ -642,6 +628,4 @@ QString QSharedMemory::errorString() const
QT_END_NAMESPACE
#ifndef QT_NO_QOBJECT
#include "moc_qsharedmemory.cpp"
#endif

View File

@ -19,14 +19,9 @@ QT_BEGIN_NAMESPACE
class QSharedMemoryPrivate;
class Q_CORE_EXPORT QSharedMemory
#ifndef QT_NO_QOBJECT
: public QObject
#endif
class Q_CORE_EXPORT QSharedMemory : public QObject
{
#ifndef QT_NO_QOBJECT
Q_OBJECT
#endif
Q_DECLARE_PRIVATE(QSharedMemory)
public:
@ -49,17 +44,8 @@ public:
UnknownError
};
#ifndef QT_NO_QOBJECT
QSharedMemory(QObject *parent = nullptr);
QSharedMemory(const QString &key, QObject *parent = nullptr);
#else
QSharedMemory();
QSharedMemory(const QString &key);
static QString tr(const char * str)
{
return QString::fromLatin1(str);
}
#endif
~QSharedMemory();
void setKey(const QString &key);
@ -88,9 +74,6 @@ public:
private:
Q_DISABLE_COPY(QSharedMemory)
#ifdef QT_NO_QOBJECT
QScopedPointer<QSharedMemoryPrivate> d_ptr;
#endif
};
#endif // QT_CONFIG(sharedmemory)

View File

@ -37,10 +37,7 @@ QT_END_NAMESPACE
#else
#include "qsystemsemaphore.h"
#ifndef QT_NO_QOBJECT
# include "private/qobject_p.h"
#endif
#include "private/qobject_p.h"
#if !defined(Q_OS_WIN) && !defined(Q_OS_ANDROID) && !defined(Q_OS_INTEGRITY) && !defined(Q_OS_RTEMS)
# include <sys/sem.h>
@ -80,14 +77,9 @@ private:
};
#endif // QT_CONFIG(systemsemaphore)
class Q_AUTOTEST_EXPORT QSharedMemoryPrivate
#ifndef QT_NO_QOBJECT
: public QObjectPrivate
#endif
class Q_AUTOTEST_EXPORT QSharedMemoryPrivate : public QObjectPrivate
{
#ifndef QT_NO_QOBJECT
Q_DECLARE_PUBLIC(QSharedMemory)
#endif
public:
QSharedMemoryPrivate();

View File

@ -29,9 +29,6 @@
QT_BEGIN_NAMESPACE
QSharedMemoryPrivate::QSharedMemoryPrivate() :
#ifndef QT_NO_QOBJECT
QObjectPrivate(),
#endif
memory(nullptr), size(0), error(QSharedMemory::NoError),
#if QT_CONFIG(systemsemaphore)
systemSemaphore(QString()), lockedByMe(false),

View File

@ -14,9 +14,6 @@ using namespace Qt::StringLiterals;
#if QT_CONFIG(sharedmemory)
QSharedMemoryPrivate::QSharedMemoryPrivate() :
#ifndef QT_NO_QOBJECT
QObjectPrivate(),
#endif
memory(0), size(0), error(QSharedMemory::NoError),
systemSemaphore(QString()), lockedByMe(false), hand(0)
{