Increasing the timeout from 5 to 10 seconds didn't work.
Let's see if an eventloop does the job.
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);
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;
#define KDE_ROOT_PATH "/"
#endif
-namespace
-{
- constexpr int TIMEOUT = 10000;
-}
-
static QString bookmarksFile()
{
return QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/user-places.xbel";
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
- QTRY_COMPARE_WITH_TIMEOUT(item->text(), sameItem->text(), TIMEOUT);
+ QCOMPARE(item->text(), sameItem->text());
}
void PlacesItemModelTest::testIcons_data()