aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2016-07-22 08:27:02 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2016-07-22 15:41:16 +0000
commit8b60bfd13f80588adab2c4778bc8de08832ecb7b (patch)
tree3eff6a95dbfc9edf3f3864f1417a1a36493d0c14 /src/quicktemplates2
parentb85a3da164bbe87832f92038175a52909701bbf1 (diff)
QQuickTumbler: change asserts to if-checks
The asserts made qmlplugindump crash when run for QtQuick.Templates. Change-Id: Ic18424555963640af806050f1e243e3b9bcfe993 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2')
-rw-r--r--src/quicktemplates2/qquicktumbler.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/quicktemplates2/qquicktumbler.cpp b/src/quicktemplates2/qquicktumbler.cpp
index f2c548bb..82188df8 100644
--- a/src/quicktemplates2/qquicktumbler.cpp
+++ b/src/quicktemplates2/qquicktumbler.cpp
@@ -184,8 +184,7 @@ void QQuickTumblerPrivate::_q_updateItemWidths()
void QQuickTumblerPrivate::_q_onViewCurrentIndexChanged()
{
Q_Q(QQuickTumbler);
- if (!ignoreCurrentIndexChanges) {
- Q_ASSERT(view);
+ if (view && !ignoreCurrentIndexChanges) {
const int oldCurrentIndex = currentIndex;
currentIndex = view->property("currentIndex").toInt();
if (oldCurrentIndex != currentIndex)
@@ -495,15 +494,14 @@ void QQuickTumbler::contentItemChange(QQuickItem *newItem, QQuickItem *oldItem)
void QQuickTumblerPrivate::disconnectFromView()
{
Q_Q(QQuickTumbler);
- if (!view && contentItem && !q->isComponentComplete()) {
+ if (!view) {
// If a custom content item is declared, it can happen that
// the original contentItem exists without the view etc. having been
// determined yet, and then this is called when the custom content item
- // is eventually set. In all other cases, a view should exist.
+ // is eventually set.
return;
}
- Q_ASSERT(view);
QObject::disconnect(view, SIGNAL(currentIndexChanged()), q, SLOT(_q_onViewCurrentIndexChanged()));
QObject::disconnect(view, SIGNAL(currentItemChanged()), q, SIGNAL(currentItemChanged()));
QObject::disconnect(view, SIGNAL(countChanged()), q, SLOT(_q_onViewCountChanged()));