┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorElvis Angelaccio <[email protected]>2018-10-10 22:58:14 +0200
committerElvis Angelaccio <[email protected]>2018-10-10 23:03:03 +0200
commit96f7a25b3d055c90d82cdb085add7d867ddc3df7 (patch)
tree689daccd3f2f523e194e7bc3993bd6a07e369873 /src
parent105fe62eeb3ec3258a35400a1e6cb2901e01ac2d (diff)
[PlacesItemModelTest] Improve name of helper method
removePlaceAfter(index) is a bit misleading, because it seems we are going to remove the place after index `index`. This method is just scheduling the removal of the place instead. The method name should be consistent with what it actually does.
Diffstat (limited to 'src')
-rw-r--r--src/tests/placesitemmodeltest.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/tests/placesitemmodeltest.cpp b/src/tests/placesitemmodeltest.cpp
index 432c6077c..40ee47cbc 100644
--- a/src/tests/placesitemmodeltest.cpp
+++ b/src/tests/placesitemmodeltest.cpp
@@ -96,7 +96,7 @@ private:
QStringList placesUrls(PlacesItemModel *model = nullptr) const;
QStringList initialUrls() const;
void createPlaceItem(const QString &text, const QUrl &url, const QString &icon);
- void removePlaceAfter(int index);
+ void schedulePlaceRemoval(int index);
void cancelPlaceRemoval(int index);
void removeTestUserData();
QMimeData *createMimeData(const QList<int> &indexes) const;
@@ -190,7 +190,7 @@ void PlacesItemModelTest::createPlaceItem(const QString &text, const QUrl &url,
m_model->createPlacesItem(text, url, icon);
}
-void PlacesItemModelTest::removePlaceAfter(int index)
+void PlacesItemModelTest::schedulePlaceRemoval(int index)
{
m_tobeRemoved.insert(index);
}
@@ -563,7 +563,7 @@ void PlacesItemModelTest::testSystemItems()
QTRY_COMPARE(itemsInsertedSpy.count(), 1);
// make sure the new place get removed
- removePlaceAfter(tempDirIndex);
+ schedulePlaceRemoval(tempDirIndex);
QList<QVariant> args = itemsInsertedSpy.takeFirst();
KItemRangeList range = args.at(0).value<KItemRangeList>();
@@ -602,7 +602,7 @@ void PlacesItemModelTest::testEditBookmark()
createPlaceItem(QStringLiteral("Temporary Dir"), QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::TempLocation)), QString());
// make sure that the new item will be removed later
- removePlaceAfter(tempDirIndex + 2);
+ schedulePlaceRemoval(tempDirIndex + 2);
QSignalSpy itemsChangedSply(m_model, &PlacesItemModel::itemsChanged);
@@ -646,7 +646,7 @@ void PlacesItemModelTest::testEditAfterCreation()
QTRY_COMPARE(model->count(), m_model->count());
// make sure that the new item will be removed later
- removePlaceAfter(tempDirIndex + 2);
+ schedulePlaceRemoval(tempDirIndex + 2);
// modify place text
PlacesItem *item = m_model->placesItem(tempDirIndex);
@@ -684,7 +684,7 @@ void PlacesItemModelTest::testEditMetadata()
QTRY_COMPARE(model->count(), m_model->count());
// make sure that the new item will be removed later
- removePlaceAfter(tempDirIndex + 2);
+ schedulePlaceRemoval(tempDirIndex + 2);
// modify place metadata
PlacesItem *item = m_model->placesItem(tempDirIndex);
@@ -722,7 +722,7 @@ void PlacesItemModelTest::testRefresh()
QTRY_COMPARE(model->count(), m_model->count());
// make sure that the new item will be removed later
- removePlaceAfter(tempDirIndex);
+ schedulePlaceRemoval(tempDirIndex);
PlacesItem *item = m_model->placesItem(tempDirIndex);
PlacesItem *sameItem = model->placesItem(tempDirIndex);
@@ -913,7 +913,7 @@ void PlacesItemModelTest::renameAfterCreation()
urls.insert(tempDirIndex + 2, tempUrl.toLocalFile());
// make sure that the new item will be removed later
- removePlaceAfter(tempDirIndex + 2);
+ schedulePlaceRemoval(tempDirIndex + 2);
CHECK_PLACES_URLS(urls);
QCOMPARE(model->count(), m_model->count());