diff options
author | Robert C. Helling <helling@atdotde.de> | 2020-03-11 11:30:51 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-03-11 08:26:30 -0700 |
commit | 285fa8acbceebf5dc87c5c3befe42a2917a3b844 (patch) | |
tree | 142efc52856b5f4bded40867a917800c241ebfb6 | |
parent | cb28158b9abe10f08142f12f11ddbb5d23686fd5 (diff) | |
download | subsurface-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>
26 files changed, 88 insertions, 88 deletions
diff --git a/Documentation/make_PO_to_ASCIIDOC.sh b/Documentation/make_PO_to_ASCIIDOC.sh index 2aae388e2..2aa22a4e5 100755 --- a/Documentation/make_PO_to_ASCIIDOC.sh +++ b/Documentation/make_PO_to_ASCIIDOC.sh @@ -7,7 +7,7 @@ # - 2015-01-14: Initial release # # Known bugs: -# - Some list item indexes are lost during PO to ASCII conversion (see asciidoc warning messages) +# - Some list item indices are lost during PO to ASCII conversion (see asciidoc warning messages) # # Package deps: - po4a (for po4a-translate) # - git (for git sync) diff --git a/commands/command_edit.cpp b/commands/command_edit.cpp index 753c67891..6a5e165be 100644 --- a/commands/command_edit.cpp +++ b/commands/command_edit.cpp @@ -1041,18 +1041,18 @@ EditWeightBase::EditWeightBase(int index, bool currentDiveOnly) : // For that purpose, we will determine the indices of the same weightsystem. std::vector<dive *> divesNew; divesNew.reserve(dives.size()); - indexes.reserve(dives.size()); + indices.reserve(dives.size()); for (dive *d: dives) { if (d == current) { divesNew.push_back(d); - indexes.push_back(index); + indices.push_back(index); continue; } int idx = find_weightsystem_index(d, ws); if (idx >= 0) { divesNew.push_back(d); - indexes.push_back(idx); + indices.push_back(idx); } } dives = std::move(divesNew); @@ -1081,16 +1081,16 @@ RemoveWeight::RemoveWeight(int index, bool currentDiveOnly) : void RemoveWeight::undo() { for (size_t i = 0; i < dives.size(); ++i) { - add_to_weightsystem_table(&dives[i]->weightsystems, indexes[i], clone_weightsystem(ws)); - emit diveListNotifier.weightAdded(dives[i], indexes[i]); + add_to_weightsystem_table(&dives[i]->weightsystems, indices[i], clone_weightsystem(ws)); + emit diveListNotifier.weightAdded(dives[i], indices[i]); } } void RemoveWeight::redo() { for (size_t i = 0; i < dives.size(); ++i) { - remove_weightsystem(dives[i], indexes[i]); - emit diveListNotifier.weightRemoved(dives[i], indexes[i]); + remove_weightsystem(dives[i], indices[i]); + emit diveListNotifier.weightRemoved(dives[i], indices[i]); } } @@ -1138,8 +1138,8 @@ EditWeight::~EditWeight() void EditWeight::redo() { for (size_t i = 0; i < dives.size(); ++i) { - set_weightsystem(dives[i], indexes[i], new_ws); - emit diveListNotifier.weightEdited(dives[i], indexes[i]); + set_weightsystem(dives[i], indices[i], new_ws); + emit diveListNotifier.weightEdited(dives[i], indices[i]); } std::swap(ws, new_ws); } diff --git a/commands/command_edit.h b/commands/command_edit.h index aeecc0bab..6a5b8230f 100644 --- a/commands/command_edit.h +++ b/commands/command_edit.h @@ -353,7 +353,7 @@ protected: ~EditWeightBase(); weightsystem_t ws; - std::vector<int> indexes; // An index for each dive in the dives vector. + std::vector<int> indices; // An index for each dive in the dives vector. bool workToBeDone() override; }; diff --git a/core/dive.c b/core/dive.c index 71b1038ec..ffdf91ae3 100644 --- a/core/dive.c +++ b/core/dive.c @@ -43,10 +43,10 @@ const char *divemode_text[] = {"OC", "CCR", "PSCR", "Freedive"}; * We try to keep the same sensor index for the same sensor, so that even * if the dive computer doesn't give pressure information for every sample, * we don't move pressure information around between the different sensor - * indexes. + * indices. * * The "prepare_sample()" function will always copy the sensor indices - * from the previous sample, so the indexes are pre-populated (but the + * from the previous sample, so the indices are pre-populated (but the * pressures obviously are not) */ void add_sample_pressure(struct sample *sample, int sensor, int mbar) @@ -83,7 +83,7 @@ void add_sample_pressure(struct sample *sample, int sensor, int mbar) * "o2pressure" that is fixed to the Oxygen sensor for a CCR dive. * * For more complex pressure data, we have to use explicit - * cylinder indexes for each sample. + * cylinder indices for each sample. * * This function returns a negative number for "no legacy mode", * or a non-negative number that indicates the o2 sensor index. @@ -2049,11 +2049,11 @@ static void dc_cylinder_renumber(struct dive *dive, struct divecomputer *dc, con int i; struct event *ev; - /* Remap or delete the sensor indexes */ + /* Remap or delete the sensor indices */ for (i = 0; i < dc->samples; i++) sample_renumber(dc->sample + i, i, mapping); - /* Remap the gas change indexes */ + /* Remap the gas change indices */ for (ev = dc->events; ev; ev = ev->next) event_renumber(ev, mapping); @@ -2063,8 +2063,8 @@ static void dc_cylinder_renumber(struct dive *dive, struct divecomputer *dc, con } /* - * If the cylinder indexes change (due to merging dives or deleting - * cylinders in the middle), we need to change the indexes in the + * If the cylinder indices change (due to merging dives or deleting + * cylinders in the middle), we need to change the indices in the * dive computer data for this dive. * * Also note that we assume that the initial cylinder is cylinder 0, diff --git a/core/profile.c b/core/profile.c index b79236151..88b48d1cd 100644 --- a/core/profile.c +++ b/core/profile.c @@ -217,7 +217,7 @@ static void analyze_plot_info_minmax(struct plot_info *pi, int entry_index) p--; } - // indexes to the min/max entries + // indices to the min/max entries min = max = entry_index; /* Then go forward until we hit an entry past the time */ @@ -314,7 +314,7 @@ struct plot_info *analyze_plot_info(struct plot_info *pi) * we return that. If it doesn't, we return the best * match based on the gasmix. * - * Some dive computers give cylinder indexes, some + * Some dive computers give cylinder indices, some * give just the gas mix. */ int get_cylinder_index(const struct dive *dive, const struct event *ev) diff --git a/core/save-xml.c b/core/save-xml.c index 3dde176bd..53d7a3af6 100644 --- a/core/save-xml.c +++ b/core/save-xml.c @@ -408,7 +408,7 @@ static void save_samples(struct membuffer *b, struct dive *dive, struct divecomp struct sample *s; struct sample dummy = { .bearing.degrees = -1, .ndl.seconds = -1 }; - /* Set up default pressure sensor indexes */ + /* Set up default pressure sensor indices */ o2sensor = legacy_format_o2pressures(dive, dc); if (o2sensor >= 0) { dummy.sensor[0] = !o2sensor; diff --git a/desktop-widgets/divelistview.cpp b/desktop-widgets/divelistview.cpp index 29dabfa36..1f3a20455 100644 --- a/desktop-widgets/divelistview.cpp +++ b/desktop-widgets/divelistview.cpp @@ -199,11 +199,11 @@ void DiveListView::reset() } // If items were selected, inform the selection model -void DiveListView::diveSelectionChanged(const QVector<QModelIndex> &indexes) +void DiveListView::diveSelectionChanged(const QVector<QModelIndex> &indices) { clearSelection(); QItemSelectionModel *s = selectionModel(); - for (const QModelIndex &index: indexes) { + for (const QModelIndex &index: indices) { s->select(index, QItemSelectionModel::Rows | QItemSelectionModel::Select); // If an item of a not-yet expanded trip is selected, expand the trip. @@ -420,7 +420,7 @@ void DiveListView::sortIndicatorChanged(int i, Qt::SortOrder order) if (currentLayout == newLayout) { sortByColumn(i, order); } else { - // clear the model, repopulate with new indexes. + // clear the model, repopulate with new indices. std::vector<int> expandedRows; if(currentLayout == DiveTripModelBase::TREE) expandedRows = backupExpandedRows(); diff --git a/desktop-widgets/divelistview.h b/desktop-widgets/divelistview.h index b31d8039e..275e26779 100644 --- a/desktop-widgets/divelistview.h +++ b/desktop-widgets/divelistview.h @@ -60,7 +60,7 @@ slots: void shiftTimes(); void loadImages(); void loadWebImages(); - void diveSelectionChanged(const QVector<QModelIndex> &indexes); + void diveSelectionChanged(const QVector<QModelIndex> &indices); void currentDiveChanged(QModelIndex index); void tripChanged(dive_trip *trip, TripField); private: diff --git a/desktop-widgets/divelogimportdialog.cpp b/desktop-widgets/divelogimportdialog.cpp index e0d24fd92..ceae878c6 100644 --- a/desktop-widgets/divelogimportdialog.cpp +++ b/desktop-widgets/divelogimportdialog.cpp @@ -362,7 +362,7 @@ DiveLogImportDialog::DiveLogImportDialog(QStringList fn, QWidget *parent) : QDia hw = ""; txtLog = false; - /* Add indexes of XSLTs requiring special handling to the list */ + /* Add indices of XSLTs requiring special handling to the list */ specialCSV << SENSUS; specialCSV << SUBSURFACE; specialCSV << DL7; diff --git a/desktop-widgets/tab-widgets/TabDivePhotos.cpp b/desktop-widgets/tab-widgets/TabDivePhotos.cpp index 775308e3b..921511de4 100644 --- a/desktop-widgets/tab-widgets/TabDivePhotos.cpp +++ b/desktop-widgets/tab-widgets/TabDivePhotos.cpp @@ -69,11 +69,11 @@ QVector<QString> TabDivePhotos::getSelectedFilenames() const QVector<QString> selectedPhotos; if (!ui->photosView->selectionModel()->hasSelection()) return selectedPhotos; - QModelIndexList indexes = ui->photosView->selectionModel()->selectedRows(); - if (indexes.count() == 0) - indexes = ui->photosView->selectionModel()->selectedIndexes(); - selectedPhotos.reserve(indexes.count()); - for (const auto &photo: indexes) { + QModelIndexList indices = ui->photosView->selectionModel()->selectedRows(); + if (indices.count() == 0) + indices = ui->photosView->selectionModel()->selectedIndexes(); + selectedPhotos.reserve(indices.count()); + for (const auto &photo: indices) { if (photo.isValid()) { QString fileUrl = photo.data(Qt::DisplayPropertyRole).toString(); if (!fileUrl.isEmpty()) @@ -114,11 +114,11 @@ void TabDivePhotos::saveSubtitles() QVector<QString> selectedPhotos; if (!ui->photosView->selectionModel()->hasSelection()) return; - QModelIndexList indexes = ui->photosView->selectionModel()->selectedRows(); - if (indexes.count() == 0) - indexes = ui->photosView->selectionModel()->selectedIndexes(); - selectedPhotos.reserve(indexes.count()); - for (const auto &photo: indexes) { + QModelIndexList indices = ui->photosView->selectionModel()->selectedRows(); + if (indices.count() == 0) + indices = ui->photosView->selectionModel()->selectedIndexes(); + selectedPhotos.reserve(indices.count()); + for (const auto &photo: indices) { if (photo.isValid()) { QString fileUrl = photo.data(Qt::DisplayPropertyRole).toString(); if (!fileUrl.isEmpty()) { diff --git a/desktop-widgets/tab-widgets/TabDiveSite.cpp b/desktop-widgets/tab-widgets/TabDiveSite.cpp index 0059c1051..87bed8f92 100644 --- a/desktop-widgets/tab-widgets/TabDiveSite.cpp +++ b/desktop-widgets/tab-widgets/TabDiveSite.cpp @@ -107,10 +107,10 @@ void TabDiveSite::on_filterText_textChanged(const QString &text) QVector<dive_site *> TabDiveSite::selectedDiveSites() { - const QModelIndexList indexes = ui.diveSites->view()->selectionModel()->selectedRows(); + const QModelIndexList indices = ui.diveSites->view()->selectionModel()->selectedRows(); QVector<dive_site *> sites; - sites.reserve(indexes.size()); - for (const QModelIndex &idx: indexes) { + sites.reserve(indices.size()); + for (const QModelIndex &idx: indices) { struct dive_site *ds = model.getDiveSite(idx); sites.append(ds); } diff --git a/map-widget/qmlmapwidgethelper.cpp b/map-widget/qmlmapwidgethelper.cpp index ff5f47f35..b2017aa49 100644 --- a/map-widget/qmlmapwidgethelper.cpp +++ b/map-widget/qmlmapwidgethelper.cpp @@ -178,7 +178,7 @@ void MapWidgetHelper::selectVisibleLocations() QMetaObject::invokeMethod(m_map, "fromCoordinate", Q_RETURN_ARG(QPointF, point), Q_ARG(QGeoCoordinate, dsCoord)); if (!qIsNaN(point.x())) -#ifndef SUBSURFACE_MOBILE // indexes on desktop +#ifndef SUBSURFACE_MOBILE // indices on desktop selectedDiveIds.append(idx); } #else // use id on mobile instead of index diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index 4dd8de98c..c0723a240 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -2123,7 +2123,7 @@ void QMLManager::setFilter(const QString filterText, int index) QString f = filterText.trimmed(); FilterData data; if (!f.isEmpty()) { - // This is ugly - the indexes of the mode are hardcoded! + // This is ugly - the indices of the mode are hardcoded! switch(index) { default: case 0: data.mode = FilterData::Mode::FULLTEXT; break; diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp index 8b1260f9c..a162f8782 100644 --- a/profile-widget/profilewidget2.cpp +++ b/profile-widget/profilewidget2.cpp @@ -2036,14 +2036,14 @@ void ProfileWidget2::keyDeleteAction() DivePlannerPointsModel *plannerModel = DivePlannerPointsModel::instance(); int selCount = scene()->selectedItems().count(); if (selCount) { - QVector<int> selectedIndexes; + QVector<int> selectedIndices; Q_FOREACH (QGraphicsItem *i, scene()->selectedItems()) { if (DiveHandler *handler = qgraphicsitem_cast<DiveHandler *>(i)) { - selectedIndexes.push_back(handles.indexOf(handler)); + selectedIndices.push_back(handles.indexOf(handler)); handler->hide(); } } - plannerModel->removeSelectedPoints(selectedIndexes); + plannerModel->removeSelectedPoints(selectedIndices); } } 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; diff --git a/smtk-import/smartrak.c b/smtk-import/smartrak.c index 5054297ab..a23cbc00d 100644 --- a/smtk-import/smartrak.c +++ b/smtk-import/smartrak.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 /* * An .slg file is composed of a main table (Dives), a bunch of tables directly - * linked to Dives by their indexes (Site, Suit, Tank, etc) and another group of + * linked to Dives by their indices (Site, Suit, Tank, etc) and another group of * independent tables (Activity, Type, Gear, Fish ...) which connect with the dives * via a related group of tables (ActivityRelation, TypeRelation ...) that contain * just the dive index number and the related table index number. diff --git a/tests/testparse.cpp b/tests/testparse.cpp index 93054674e..06c110acb 100644 --- a/tests/testparse.cpp +++ b/tests/testparse.cpp @@ -357,7 +357,7 @@ int TestParse::parseCSVmanual(int units, std::string file) params[pnr++] = intdup(21); params[pnr++] = strdup("tagsField"); params[pnr++] = intdup(22); - // Numbers are indexes of possible options + // Numbers are indices of possible options params[pnr++] = strdup("separatorIndex"); params[pnr++] = intdup(0); params[pnr++] = strdup("datefmt"); @@ -410,7 +410,7 @@ int TestParse::parseCSVprofile(int units, std::string file) params[pnr++] = intdup(5); params[pnr++] = strdup("pressureField"); params[pnr++] = intdup(6); - // Numbers are indexes of possible options + // Numbers are indices of possible options params[pnr++] = strdup("datefmt"); params[pnr++] = intdup(2); params[pnr++] = strdup("units"); diff --git a/theme/list_lib.js b/theme/list_lib.js index 05ac98d2a..4761e2bb5 100644 --- a/theme/list_lib.js +++ b/theme/list_lib.js @@ -1,9 +1,9 @@ -var itemsToShow = new Array(); //list of indexes to all dives to view +var itemsToShow = new Array(); //list of indices to all dives to view var items = new Array(); var start; //index of first element viewed in itemsToShow var sizeofpage; //size of viewed page var numberofwords = 0; //just for stats -var olditemstoshow; //to reference the indexes to all dives if changed +var olditemstoshow; //to reference the indices to all dives if changed ////////////////////////////////// // // // View Model // @@ -40,8 +40,8 @@ function viewInPage() } /** -*addHTML this Method puts the HTML of items of given indexes -*@param {array} indexes array of indexes to put in HTML +*addHTML this Method puts the HTML of items of given indices +*@param {array} indices array of indices to put in HTML */ function updateView(start, end) { @@ -56,17 +56,17 @@ function updateView(start, end) } /** -*addHTML this Method puts the HTML of items of given indexes -*@param {array} indexes array of indexes to put in HTML +*addHTML this Method puts the HTML of items of given indices +*@param {array} indices array of indices to put in HTML */ -function addHTML(indexes) +function addHTML(indices) { var divelist = document.getElementById('diveslist'); divelist.innerHTML = ""; - for (var i = 0; i < indexes.length; i++) { - divelist.innerHTML += '<ul id="' + indexes[i] + '" onclick="toggleExpansion(event, this)"></ul>'; - expand(document.getElementById(indexes[i])); - itemsToShow[indexes[i]].expanded = true; + for (var i = 0; i < indices.length; i++) { + divelist.innerHTML += '<ul id="' + indices[i] + '" onclick="toggleExpansion(event, this)"></ul>'; + expand(document.getElementById(indices[i])); + itemsToShow[indices[i]].expanded = true; }; } |