From: Elvis Angelaccio Date: Sat, 13 Oct 2018 16:49:35 +0000 (+0200) Subject: [PlacesItemModelTest] Revert last two commits X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/277700425e7d77345de74ff0c6dc58fb0aca193c [PlacesItemModelTest] Revert last two commits Commit c527dc2172 proves that on the CI sometimes the `QAbstractItemModel::dataChanged` signal is not being emitted at all (build #208 failed because the test timed out). KFilePlacesModel emits `dataChanged()` in the `_k_reloadBookmarks()` slot only when it's called after the KBookmarkManager emits the `changed()` signal. And the `changed()` signal is emitted after KDirWatch emits the `created` signal. On the CI server kdirwatch is probably not reliable, which would explain why the test randomly fails. --- diff --git a/src/panels/places/placesitemmodel.cpp b/src/panels/places/placesitemmodel.cpp index e21c25a0e..f7fe5587c 100644 --- a/src/panels/places/placesitemmodel.cpp +++ b/src/panels/places/placesitemmodel.cpp @@ -68,7 +68,6 @@ PlacesItemModel::PlacesItemModel(QObject* parent) : connect(m_sourceModel, &KFilePlacesModel::rowsInserted, this, &PlacesItemModel::onSourceModelRowsInserted); connect(m_sourceModel, &KFilePlacesModel::rowsAboutToBeRemoved, this, &PlacesItemModel::onSourceModelRowsAboutToBeRemoved); - connect(m_sourceModel, &KFilePlacesModel::dataChanged, this, &PlacesItemModel::sourceModelDataChanged); connect(m_sourceModel, &KFilePlacesModel::dataChanged, this, &PlacesItemModel::onSourceModelDataChanged); connect(m_sourceModel, &KFilePlacesModel::rowsAboutToBeMoved, this, &PlacesItemModel::onSourceModelRowsAboutToBeMoved); connect(m_sourceModel, &KFilePlacesModel::rowsMoved, this, &PlacesItemModel::onSourceModelRowsMoved); diff --git a/src/panels/places/placesitemmodel.h b/src/panels/places/placesitemmodel.h index 33760f217..c4ff7e2dd 100644 --- a/src/panels/places/placesitemmodel.h +++ b/src/panels/places/placesitemmodel.h @@ -145,7 +145,6 @@ signals: void storageSetupDone(int index, bool success); void storageTearDownRequested(const QString& mountPath); void storageTearDownExternallyRequested(const QString& mountPath); - void sourceModelDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector &roles = QVector()); protected: void onItemInserted(int index) override; diff --git a/src/tests/placesitemmodeltest.cpp b/src/tests/placesitemmodeltest.cpp index 73204954b..40ee47cbc 100644 --- a/src/tests/placesitemmodeltest.cpp +++ b/src/tests/placesitemmodeltest.cpp @@ -735,13 +735,10 @@ void PlacesItemModelTest::testRefresh() QVERIFY(item->text() != sameItem->text()); // propagate change - QEventLoop eventLoop; - connect(m_model, &PlacesItemModel::sourceModelDataChanged, &eventLoop, &QEventLoop::quit); m_model->refresh(); - eventLoop.exec(); // item must be equal - QCOMPARE(item->text(), sameItem->text()); + QTRY_COMPARE(item->text(), sameItem->text()); } void PlacesItemModelTest::testIcons_data()