summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2012-06-18 12:08:16 +0200
committerQt by Nokia <qt-info@nokia.com>2012-06-19 02:55:50 +0200
commit28f193ab5368bf647d7169abefd2d34af537e18d (patch)
treed575294847e707828ed2816892adebcc3fd78de9
parentccf988e51087cee521b32df646de4ce3ef291de1 (diff)
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 <thiago.macieira@intel.com>
-rw-r--r--src/corelib/kernel/qcoreevent.cpp20
1 files changed, 8 insertions, 12 deletions
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");
}