on xenial help sign in
comment the if
commitd831ee86fa3709bcbf8d260a69a4765b63595d6e authorAlbert Astals <albert.astals@canonical.com> dateTue 7 Jan 2014, 15:51 (13 years ago) parent5387384
2 files changed+7−1
plugins/DashViews/abstractjournal.cpp+7 plugins/DashViews/listviewwithpageheader.cpp−1
plugins/DashViews/abstractjournal.cpp+7
@@ -211,6 +211,7 @@ void AbstractJournal::refill()
211211
212212 if (added || removed) {
213213 m_implicitHeightDirty = true;
214+ polish();
214215 }
215216}
216217
@@ -311,6 +312,12 @@ void AbstractJournal::itemCreated(int modelIndex, QObject *object)
311312 }
312313#endif
313314 item->setParentItem(this);
315+
316+ // We only need to call createItem if we are here because of an asynchronous generation
317+ // otherwise we are in this slot because createItem is creating the item sync
318+ // and thus we don't need to call createItem again, nor need to set m_implicitHeightDirty
319+ // and call polish because the sync createItem was called from addVisibleItems that
320+ // is called from refill that will already do those if an item was added
314321 if (modelIndex == m_asyncRequestedIndex) {
315322 createItem(modelIndex, false);
316323 m_implicitHeightDirty = true;
plugins/DashViews/listviewwithpageheader.cpp−1
@@ -871,7 +871,6 @@ void ListViewWithPageHeader::itemCreated(int modelIndex, QObject *object)
871871 QQmlContext *context = QQmlEngine::contextForObject(item)->parentContext();
872872 context->setContextProperty(QLatin1String("ListViewWithPageHeader"), this);
873873 context->setContextProperty(QLatin1String("heightToClip"), QVariant::fromValue<int>(0));
874− Q_ASSERT (modelIndex == m_asyncRequestedIndex);
875874 if (modelIndex == m_asyncRequestedIndex) {
876875 createItem(modelIndex, false);
877876 refill();