From 28f193ab5368bf647d7169abefd2d34af537e18d Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Mon, 18 Jun 2012 12:08:16 +0200 Subject: QEvent: Don't give DeferredDelete special treatment After commit 9b07fd0d5cae6846f0eaccf3dc51bc9e78559a05, Qt no longer keeps the loop-level in QEvent's d-pointer. This means we no longer need to special case this event type in the QEvent copy constructor, assignment operator, and destructor. Change-Id: Iff71713d38303674f4517fdfa169cc448ed41dd4 Reviewed-by: Thiago Macieira --- src/corelib/kernel/qcoreevent.cpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/corelib/kernel/qcoreevent.cpp b/src/corelib/kernel/qcoreevent.cpp index 5231f813f4..f2ee41d0e7 100644 --- a/src/corelib/kernel/qcoreevent.cpp +++ b/src/corelib/kernel/qcoreevent.cpp @@ -294,11 +294,9 @@ QEvent::QEvent(const QEvent &other) : d(other.d), t(other.t), posted(other.posted), spont(other.spont), m_accept(other.m_accept) { - if (t != QEvent::DeferredDelete) { - // if QEventPrivate becomes available, make sure to implement a - // virtual QEventPrivate *clone() const; function so we can copy here - Q_ASSERT_X(!d, "QEvent", "Impossible, this can't happen: QEventPrivate isn't defined anywhere"); - } + // if QEventPrivate becomes available, make sure to implement a + // virtual QEventPrivate *clone() const; function so we can copy here + Q_ASSERT_X(!d, "QEvent", "Impossible, this can't happen: QEventPrivate isn't defined anywhere"); } /*! @@ -310,11 +308,10 @@ QEvent::QEvent(const QEvent &other) */ QEvent &QEvent::operator=(const QEvent &other) { - if (t != QEvent::DeferredDelete) { - // if QEventPrivate becomes available, make sure to implement a - // virtual QEventPrivate *clone() const; function so we can copy here - Q_ASSERT_X(!other.d, "QEvent", "Impossible, this can't happen: QEventPrivate isn't defined anywhere"); - } + // if QEventPrivate becomes available, make sure to implement a + // virtual QEventPrivate *clone() const; function so we can copy here + Q_ASSERT_X(!other.d, "QEvent", "Impossible, this can't happen: QEventPrivate isn't defined anywhere"); + t = other.t; posted = other.posted; spont = other.spont; @@ -331,8 +328,7 @@ QEvent::~QEvent() { if (posted && QCoreApplication::instance()) QCoreApplicationPrivate::removePostedEvent(this); - if (t != QEvent::DeferredDelete) - Q_ASSERT_X(!d, "QEvent", "Impossible, this can't happen: QEventPrivate isn't defined anywhere"); + Q_ASSERT_X(!d, "QEvent", "Impossible, this can't happen: QEventPrivate isn't defined anywhere"); } -- cgit v1.2.3