Remove QT_JAMBI_BUILD code

Change-Id: Ic9231b11293af4352f11cf075893175f0c9a471f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Bradley T. Hughes 2011-12-13 13:15:28 +01:00 committed by Qt by Nokia
parent 0501c9d8f1
commit 2561ab5841
5 changed files with 4 additions and 82 deletions

View File

@ -61,7 +61,7 @@ Qt {
Q_OBJECT
#endif
#if (defined(Q_MOC_RUN) || defined(QT_JAMBI_RUN))
#if defined(Q_MOC_RUN)
// NOTE: Generally, do not add Q_ENUMS if a corresponding Q_FLAGS exists.
Q_ENUMS(ScrollBarPolicy FocusPolicy ContextMenuPolicy)
Q_ENUMS(ArrowType ToolButtonStyle PenStyle PenCapStyle PenJoinStyle BrushStyle)
@ -97,7 +97,7 @@ Qt {
Q_ENUMS(GestureType)
#endif
Q_ENUMS(CursorMoveStyle)
#endif // (defined(Q_MOC_RUN) || defined(QT_JAMBI_RUN))
#endif // defined(Q_MOC_RUN)
#if defined(Q_MOC_RUN)
public:

View File

@ -802,26 +802,7 @@ bool QCoreApplication::notifyInternal(QObject *receiver, QEvent *event)
QObjectPrivate *d = receiver->d_func();
QThreadData *threadData = d->threadData;
QScopedLoopLevelCounter loopLevelCounter(threadData);
#ifdef QT_JAMBI_BUILD
int deleteWatch = 0;
int *oldDeleteWatch = QObjectPrivate::setDeleteWatch(d, &deleteWatch);
bool inEvent = d->inEventHandler;
d->inEventHandler = true;
#endif
bool returnValue;
returnValue = notify(receiver, event);
#ifdef QT_JAMBI_BUILD
// Restore the previous state if the object was not deleted..
if (!deleteWatch) {
d->inEventHandler = inEvent;
}
QObjectPrivate::resetDeleteWatch(d, oldDeleteWatch, deleteWatch);
#endif
return returnValue;
return notify(receiver, event);
}

View File

@ -172,10 +172,6 @@ QObjectPrivate::QObjectPrivate(int version)
extraData = 0;
connectedSignals[0] = connectedSignals[1] = 0;
inThreadChangeEvent = false;
#ifdef QT_JAMBI_BUILD
inEventHandler = false;
deleteWatch = 0;
#endif
metaObject = 0;
isWindow = false;
}
@ -194,10 +190,6 @@ QObjectPrivate::~QObjectPrivate()
threadData->deref();
delete static_cast<QAbstractDynamicMetaObject*>(metaObject);
#ifdef QT_JAMBI_BUILD
if (deleteWatch)
*deleteWatch = 1;
#endif
#ifndef QT_NO_USERDATA
if (extraData)
qDeleteAll(extraData->userData);
@ -205,25 +197,6 @@ QObjectPrivate::~QObjectPrivate()
#endif
}
#ifdef QT_JAMBI_BUILD
int *QObjectPrivate::setDeleteWatch(QObjectPrivate *d, int *w) {
int *old = d->deleteWatch;
d->deleteWatch = w;
return old;
}
void QObjectPrivate::resetDeleteWatch(QObjectPrivate *d, int *oldWatch, int deleteWatch) {
if (!deleteWatch)
d->deleteWatch = oldWatch;
if (oldWatch)
*oldWatch = deleteWatch;
}
#endif
/*!\internal
For a given metaobject, compute the signal offset, and the method offset (including signals)
*/
@ -837,13 +810,6 @@ QObject::~QObject()
if (d->parent) // remove it from parent object
d->setParent_helper(0);
#ifdef QT_JAMBI_BUILD
if (d->inEventHandler) {
qWarning("QObject: Do not delete object, '%s', during its event handler!",
objectName().isNull() ? "unnamed" : qPrintable(objectName()));
}
#endif
}
QObjectPrivate::Connection::~Connection()
@ -1031,9 +997,6 @@ bool QObject::event(QEvent *e)
case QEvent::MetaCall:
{
#ifdef QT_JAMBI_BUILD
d_func()->inEventHandler = false;
#endif
QMetaCallEvent *mce = static_cast<QMetaCallEvent*>(e);
QConnectionSenderSwitcher sw(this, const_cast<QObject*>(mce->sender()), mce->signalId());
@ -1338,15 +1301,6 @@ void QObjectPrivate::setThreadData_helper(QThreadData *currentData, QThreadData
currentSender->ref = 0;
currentSender = 0;
#ifdef QT_JAMBI_BUILD
// the current event thread also shouldn't restore the delete watch
inEventHandler = false;
if (deleteWatch)
*deleteWatch = 1;
deleteWatch = 0;
#endif
// set new thread data
targetData->ref();
threadData->deref();
@ -3891,11 +3845,6 @@ QDebug operator<<(QDebug dbg, const QObject *o) {
void qDeleteInEventHandler(QObject *o)
{
#ifdef QT_JAMBI_BUILD
if (!o)
return;
QObjectPrivate::get(o)->inEventHandler = false;
#endif
delete o;
}

View File

@ -103,10 +103,9 @@ public:
uint ownObjectName : 1;
uint sendChildEvents : 1;
uint receiveChildEvents : 1;
uint inEventHandler : 1; //only used if QT_JAMBI_BUILD
uint inThreadChangeEvent : 1;
uint isWindow : 1; //for QWindow
uint unused : 21;
uint unused : 22;
int postedEvents;
QMetaObject *metaObject; // assert dynamic
};

View File

@ -179,10 +179,6 @@ public:
static inline void resetCurrentSender(QObject *receiver,
Sender *currentSender,
Sender *previousSender);
#ifdef QT_JAMBI_BUILD
static int *setDeleteWatch(QObjectPrivate *d, int *newWatch);
static void resetDeleteWatch(QObjectPrivate *d, int *oldWatch, int deleteWatch);
#endif
static QObjectPrivate *get(QObject *o) {
return o->d_func();
@ -211,9 +207,6 @@ public:
// these objects are all used to indicate that a QObject was deleted
// plus QPointer, which keeps a separate list
QAtomicPointer<QtSharedPointer::ExternalRefCountData> sharedRefcount;
#ifdef QT_JAMBI_BUILD
int *deleteWatch;
#endif
};