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.
connect(m_sourceModel, &KFilePlacesModel::rowsInserted, this, &PlacesItemModel::onSourceModelRowsInserted);
connect(m_sourceModel, &KFilePlacesModel::rowsAboutToBeRemoved, this, &PlacesItemModel::onSourceModelRowsAboutToBeRemoved);
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);
connect(m_sourceModel, &KFilePlacesModel::dataChanged, this, &PlacesItemModel::onSourceModelDataChanged);
connect(m_sourceModel, &KFilePlacesModel::rowsAboutToBeMoved, this, &PlacesItemModel::onSourceModelRowsAboutToBeMoved);
connect(m_sourceModel, &KFilePlacesModel::rowsMoved, this, &PlacesItemModel::onSourceModelRowsMoved);
void storageSetupDone(int index, bool success);
void storageTearDownRequested(const QString& mountPath);
void storageTearDownExternallyRequested(const QString& mountPath);
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;
protected:
void onItemInserted(int index) override;
QVERIFY(item->text() != sameItem->text());
// propagate change
QVERIFY(item->text() != sameItem->text());
// propagate change
- QEventLoop eventLoop;
- connect(m_model, &PlacesItemModel::sourceModelDataChanged, &eventLoop, &QEventLoop::quit);
- QCOMPARE(item->text(), sameItem->text());
+ QTRY_COMPARE(item->text(), sameItem->text());
}
void PlacesItemModelTest::testIcons_data()
}
void PlacesItemModelTest::testIcons_data()