summaryrefslogtreecommitdiffstats
path: root/qt-models
diff options
context:
space:
mode:
authorGravatar Robert C. Helling <helling@atdotde.de>2020-03-11 11:30:51 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-03-11 08:26:30 -0700
commit285fa8acbceebf5dc87c5c3befe42a2917a3b844 (patch)
tree142efc52856b5f4bded40867a917800c241ebfb6 /qt-models
parentcb28158b9abe10f08142f12f11ddbb5d23686fd5 (diff)
downloadsubsurface-285fa8acbceebf5dc87c5c3befe42a2917a3b844.tar.gz
Grammar: replaces 'indexes' by 'indices'
Grammar-nazi ran git grep -l 'indexes' | xargs sed -i '' -e 's/indexes/indices/g' to prevent future wincing when reading the source code. Unfortunatly, Qt itself is infected as in QModelIndexList QItemSelection::indexes() const Signed-off-by: Robert C. Helling <helling@atdotde.de>
Diffstat (limited to 'qt-models')
-rw-r--r--qt-models/cylindermodel.cpp4
-rw-r--r--qt-models/diveimportedmodel.cpp2
-rw-r--r--qt-models/diveimportedmodel.h2
-rw-r--r--qt-models/divetripmodel.cpp24
-rw-r--r--qt-models/divetripmodel.h4
-rw-r--r--qt-models/filtermodels.cpp16
-rw-r--r--qt-models/filtermodels.h4
-rw-r--r--qt-models/mobilelistmodel.cpp2
-rw-r--r--qt-models/mobilelistmodel.h2
9 files changed, 30 insertions, 30 deletions
diff --git a/qt-models/cylindermodel.cpp b/qt-models/cylindermodel.cpp
index 641fe3f18..da8b2eb1e 100644
--- a/qt-models/cylindermodel.cpp
+++ b/qt-models/cylindermodel.cpp
@@ -512,7 +512,7 @@ void CylindersModel::remove(QModelIndex index)
changed = true;
endRemoveRows();
- // Create a mapping of cylinder indexes:
+ // Create a mapping of cylinder indices:
// 1) Fill mapping[0]..mapping[index-1] with 0..index
// 2) Set mapping[index] to -1
// 3) Fill mapping[index+1]..mapping[end] with index..
@@ -537,7 +537,7 @@ void CylindersModel::moveAtFirst(int cylid)
memmove(get_cylinder(&displayed_dive, i + 1), get_cylinder(&displayed_dive, i), sizeof(temp_cyl));
memmove(get_cylinder(&displayed_dive, 0), &temp_cyl, sizeof(temp_cyl));
- // Create a mapping of cylinder indexes:
+ // Create a mapping of cylinder indices:
// 1) Fill mapping[0]..mapping[cyl] with 0..index
// 2) Set mapping[cyl] to 0
// 3) Fill mapping[cyl+1]..mapping[end] with cyl..
diff --git a/qt-models/diveimportedmodel.cpp b/qt-models/diveimportedmodel.cpp
index 393e220d6..902d2099a 100644
--- a/qt-models/diveimportedmodel.cpp
+++ b/qt-models/diveimportedmodel.cpp
@@ -153,7 +153,7 @@ std::pair<struct dive_table, struct dive_site_table> DiveImportedModel::consumeT
move_dive_table(&diveTable, &dives);
move_dive_site_table(&sitesTable, &sites);
- // Reset indexes
+ // Reset indices
checkStates.clear();
endResetModel();
diff --git a/qt-models/diveimportedmodel.h b/qt-models/diveimportedmodel.h
index 58d073e37..920bd57c6 100644
--- a/qt-models/diveimportedmodel.h
+++ b/qt-models/diveimportedmodel.h
@@ -18,7 +18,7 @@ public:
int rowCount(const QModelIndex& index = QModelIndex()) const;
QVariant data(const QModelIndex& index, int role) const;
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
- void setImportedDivesIndexes(int first, int last);
+ void setImportedDivesIndices(int first, int last);
Qt::ItemFlags flags(const QModelIndex &index) const;
Q_INVOKABLE void clearTable();
QHash<int, QByteArray> roleNames() const;
diff --git a/qt-models/divetripmodel.cpp b/qt-models/divetripmodel.cpp
index 1eee924f8..754d5e633 100644
--- a/qt-models/divetripmodel.cpp
+++ b/qt-models/divetripmodel.cpp
@@ -1412,19 +1412,19 @@ void DiveTripModelTree::divesSelected(const QVector<dive *> &divesIn, dive *curr
// We got a number of dives that have been selected. Turn this into QModelIndexes and
// emit a signal, so that views can change the selection.
- QVector<QModelIndex> indexes;
- indexes.reserve(dives.count());
+ QVector<QModelIndex> indices;
+ indices.reserve(dives.count());
- processByTrip(dives, [this, &indexes] (dive_trip *trip, const QVector<dive *> &divesInTrip)
- { divesSelectedTrip(trip, divesInTrip, indexes); });
+ processByTrip(dives, [this, &indices] (dive_trip *trip, const QVector<dive *> &divesInTrip)
+ { divesSelectedTrip(trip, divesInTrip, indices); });
- emit selectionChanged(indexes);
+ emit selectionChanged(indices);
// The current dive has changed. Transform the current dive into an index and pass it on to the view.
currentChanged();
}
-void DiveTripModelTree::divesSelectedTrip(dive_trip *trip, const QVector<dive *> &dives, QVector<QModelIndex> &indexes)
+void DiveTripModelTree::divesSelectedTrip(dive_trip *trip, const QVector<dive *> &dives, QVector<QModelIndex> &indices)
{
if (!trip) {
// This is at the top level.
@@ -1436,7 +1436,7 @@ void DiveTripModelTree::divesSelectedTrip(dive_trip *trip, const QVector<dive *>
++j;
if (j >= (int)items.size())
break;
- indexes.append(createIndex(j, 0, noParent));
+ indices.append(createIndex(j, 0, noParent));
}
} else {
// Find the trip.
@@ -1457,7 +1457,7 @@ void DiveTripModelTree::divesSelectedTrip(dive_trip *trip, const QVector<dive *>
++j;
if (j >= (int)entry.dives.size())
break;
- indexes.append(createIndex(j, 0, idx));
+ indices.append(createIndex(j, 0, idx));
}
}
}
@@ -1672,8 +1672,8 @@ void DiveTripModelList::divesSelected(const QVector<dive *> &divesIn, dive *curr
// We got a number of dives that have been selected. Turn this into QModelIndexes and
// emit a signal, so that views can change the selection.
- QVector<QModelIndex> indexes;
- indexes.reserve(dives.count());
+ QVector<QModelIndex> indices;
+ indices.reserve(dives.count());
// Since both lists are sorted, we can do this linearly. Perhaps a binary search
// would be better?
@@ -1683,10 +1683,10 @@ void DiveTripModelList::divesSelected(const QVector<dive *> &divesIn, dive *curr
++j;
if (j >= (int)items.size())
break;
- indexes.append(createIndex(j, 0, noParent));
+ indices.append(createIndex(j, 0, noParent));
}
- emit selectionChanged(indexes);
+ emit selectionChanged(indices);
// The current dive has changed. Transform the current dive into an index and pass it on to the view.
currentChanged();
diff --git a/qt-models/divetripmodel.h b/qt-models/divetripmodel.h
index 49fc3ce69..4be678e27 100644
--- a/qt-models/divetripmodel.h
+++ b/qt-models/divetripmodel.h
@@ -83,9 +83,9 @@ signals:
// Commands/DiveListNotifier ---(dive */dive_trip *)---> DiveTripModel ---(QModelIndex)---> DiveListView
// i.e. The command objects send changes in terms of pointer-to-dives, which the DiveTripModel transforms
// into QModelIndexes according to the current view (tree/list). Finally, the DiveListView transforms these
- // indexes into local indexes according to current sorting/filtering and instructs the QSelectionModel to
+ // indices into local indices according to current sorting/filtering and instructs the QSelectionModel to
// perform the appropriate actions.
- void selectionChanged(const QVector<QModelIndex> &indexes);
+ void selectionChanged(const QVector<QModelIndex> &indices);
void currentDiveChanged(QModelIndex index);
protected:
dive *oldCurrent;
diff --git a/qt-models/filtermodels.cpp b/qt-models/filtermodels.cpp
index 8d3cb800a..2d081e6e6 100644
--- a/qt-models/filtermodels.cpp
+++ b/qt-models/filtermodels.cpp
@@ -36,20 +36,20 @@ void MultiFilterSortModel::clear()
model->clear();
}
-// Translate selection into local indexes and re-emit signal
-void MultiFilterSortModel::selectionChangedSlot(const QVector<QModelIndex> &indexes)
+// Translate selection into local indices and re-emit signal
+void MultiFilterSortModel::selectionChangedSlot(const QVector<QModelIndex> &indices)
{
- QVector<QModelIndex> indexesLocal;
- indexesLocal.reserve(indexes.size());
- for (const QModelIndex &index: indexes) {
+ QVector<QModelIndex> indicesLocal;
+ indicesLocal.reserve(indices.size());
+ for (const QModelIndex &index: indices) {
QModelIndex local = mapFromSource(index);
if (local.isValid())
- indexesLocal.push_back(local);
+ indicesLocal.push_back(local);
}
- emit selectionChanged(indexesLocal);
+ emit selectionChanged(indicesLocal);
}
-// Translate current dive into local indexes and re-emit signal
+// Translate current dive into local indices and re-emit signal
void MultiFilterSortModel::currentDiveChangedSlot(QModelIndex index)
{
QModelIndex local = mapFromSource(index);
diff --git a/qt-models/filtermodels.h b/qt-models/filtermodels.h
index 33d17791b..588bfe2b5 100644
--- a/qt-models/filtermodels.h
+++ b/qt-models/filtermodels.h
@@ -19,10 +19,10 @@ public:
void resetModel(DiveTripModelBase::Layout layout);
void clear();
signals:
- void selectionChanged(const QVector<QModelIndex> &indexes);
+ void selectionChanged(const QVector<QModelIndex> &indices);
void currentDiveChanged(QModelIndex index);
private slots:
- void selectionChangedSlot(const QVector<QModelIndex> &indexes);
+ void selectionChangedSlot(const QVector<QModelIndex> &indices);
void currentDiveChangedSlot(QModelIndex index);
private:
MultiFilterSortModel(QObject *parent = 0);
diff --git a/qt-models/mobilelistmodel.cpp b/qt-models/mobilelistmodel.cpp
index c98c37e6a..43b805833 100644
--- a/qt-models/mobilelistmodel.cpp
+++ b/qt-models/mobilelistmodel.cpp
@@ -94,7 +94,7 @@ MobileListModel::MobileListModel(DiveTripModelBase *source) : MobileListModelBas
}
// We want to show the newest dives first. Therefore, we have to invert
-// the indexes with respect to the source model. To avoid mental gymnastics
+// the indices with respect to the source model. To avoid mental gymnastics
// in the rest of the code, we do this right before sending to the
// source model and just after recieving from the source model, respectively.
QModelIndex MobileListModel::sourceIndex(int row, int col, int parentRow) const
diff --git a/qt-models/mobilelistmodel.h b/qt-models/mobilelistmodel.h
index c289684bd..23ed83028 100644
--- a/qt-models/mobilelistmodel.h
+++ b/qt-models/mobilelistmodel.h
@@ -136,7 +136,7 @@ private:
mutable QModelIndex cacheSourceParent;
mutable int cacheSourceRow = -1;
- // Translate indexes from/to source
+ // Translate indices from/to source
int topLevelRowCountInSource(int sourceRow) const;
QModelIndex mapToSource(const QModelIndex &index) const;
int mapTopLevelFromSource(int row) const;