]> cloud.milkyroute.net Git - dolphin.git/commitdiff
[PlacesItemModelTest] Revert last two commits
authorElvis Angelaccio <elvis.angelaccio@kde.org>
Sat, 13 Oct 2018 16:49:35 +0000 (18:49 +0200)
committerElvis Angelaccio <elvis.angelaccio@kde.org>
Sat, 13 Oct 2018 20:06:32 +0000 (22:06 +0200)
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.

src/panels/places/placesitemmodel.cpp
src/panels/places/placesitemmodel.h
src/tests/placesitemmodeltest.cpp

index e21c25a0e25269dac98ded389a62034c38c1fe9d..f7fe5587c7fa3cd2c5ce855982aad8e93fe83925 100644 (file)
@@ -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);
index 33760f2176473680a4f49cba596bd0af7b1836c0..c4ff7e2ddd97b549da74df073d084db5b940a56e 100644 (file)
@@ -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<int> &roles = QVector<int>());
 
 protected:
     void onItemInserted(int index) override;
index 73204954b9ffbad71ec708d1f6f89437ffa559c5..40ee47cbc9beb514eb71a0cb327cc67e3da6feed 100644 (file)
@@ -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()