mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-01 01:53:24 +00:00
Cleanup: rename newCurrentDive signal to currentDiveChanged
This is more consistent with the rest of the signals. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
ae753f4c4d
commit
86f384f932
3 changed files with 11 additions and 11 deletions
|
@ -87,7 +87,7 @@ void DiveListView::resetModel()
|
||||||
// If the model was reset, we have to reconnect the signals and tell
|
// If the model was reset, we have to reconnect the signals and tell
|
||||||
// the filter model to update its source model.
|
// the filter model to update its source model.
|
||||||
connect(DiveTripModelBase::instance(), &DiveTripModelBase::selectionChanged, this, &DiveListView::diveSelectionChanged);
|
connect(DiveTripModelBase::instance(), &DiveTripModelBase::selectionChanged, this, &DiveListView::diveSelectionChanged);
|
||||||
connect(DiveTripModelBase::instance(), &DiveTripModelBase::newCurrentDive, this, &DiveListView::currentDiveChanged);
|
connect(DiveTripModelBase::instance(), &DiveTripModelBase::currentDiveChanged, this, &DiveListView::currentDiveChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DiveListView::calculateInitialColumnWidth(int col)
|
void DiveListView::calculateInitialColumnWidth(int col)
|
||||||
|
|
|
@ -1185,7 +1185,7 @@ void DiveTripModelTree::divesSelected(const QVector<dive *> &dives, dive *curren
|
||||||
|
|
||||||
// The current dive has changed. Transform the current dive into an index and pass it on to the view.
|
// The current dive has changed. Transform the current dive into an index and pass it on to the view.
|
||||||
if (!current) {
|
if (!current) {
|
||||||
emit newCurrentDive(QModelIndex()); // No current dive -> tell view to clear current index with an invalid index
|
emit currentDiveChanged(QModelIndex()); // No current dive -> tell view to clear current index with an invalid index
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1196,26 +1196,26 @@ void DiveTripModelTree::divesSelected(const QVector<dive *> &dives, dive *curren
|
||||||
if (idx < 0) {
|
if (idx < 0) {
|
||||||
// We don't know this dive. Something is wrong. Warn and bail.
|
// We don't know this dive. Something is wrong. Warn and bail.
|
||||||
qWarning() << "DiveTripModelTree::diveSelected(): unknown top-level dive";
|
qWarning() << "DiveTripModelTree::diveSelected(): unknown top-level dive";
|
||||||
emit newCurrentDive(QModelIndex());
|
emit currentDiveChanged(QModelIndex());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
emit newCurrentDive(createIndex(idx, 0, noParent));
|
emit currentDiveChanged(createIndex(idx, 0, noParent));
|
||||||
} else {
|
} else {
|
||||||
int idx = findTripIdx(trip);
|
int idx = findTripIdx(trip);
|
||||||
if (idx < 0) {
|
if (idx < 0) {
|
||||||
// We don't know the trip - this shouldn't happen. Warn and bail.
|
// We don't know the trip - this shouldn't happen. Warn and bail.
|
||||||
qWarning() << "DiveTripModelTree::diveSelected(): unknown trip";
|
qWarning() << "DiveTripModelTree::diveSelected(): unknown trip";
|
||||||
emit newCurrentDive(QModelIndex());
|
emit currentDiveChanged(QModelIndex());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int diveIdx = findDiveInTrip(idx, current);
|
int diveIdx = findDiveInTrip(idx, current);
|
||||||
if (diveIdx < 0) {
|
if (diveIdx < 0) {
|
||||||
// We don't know this dive. Something is wrong. Warn and bail.
|
// We don't know this dive. Something is wrong. Warn and bail.
|
||||||
qWarning() << "DiveTripModelTree::diveSelected(): unknown dive";
|
qWarning() << "DiveTripModelTree::diveSelected(): unknown dive";
|
||||||
emit newCurrentDive(QModelIndex());
|
emit currentDiveChanged(QModelIndex());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
emit newCurrentDive(createIndex(diveIdx, 0, idx));
|
emit currentDiveChanged(createIndex(diveIdx, 0, idx));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1443,7 +1443,7 @@ void DiveTripModelList::divesSelected(const QVector<dive *> &dives, dive *curren
|
||||||
|
|
||||||
// Transform the current dive into an index and pass it on to the view.
|
// Transform the current dive into an index and pass it on to the view.
|
||||||
if (!current) {
|
if (!current) {
|
||||||
emit newCurrentDive(QModelIndex()); // No current dive -> tell view to clear current index with an invalid index
|
emit currentDiveChanged(QModelIndex()); // No current dive -> tell view to clear current index with an invalid index
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1451,10 +1451,10 @@ void DiveTripModelList::divesSelected(const QVector<dive *> &dives, dive *curren
|
||||||
if (it == items.end()) {
|
if (it == items.end()) {
|
||||||
// We don't know this dive. Something is wrong. Warn and bail.
|
// We don't know this dive. Something is wrong. Warn and bail.
|
||||||
qWarning() << "DiveTripModelList::divesSelected(): unknown dive";
|
qWarning() << "DiveTripModelList::divesSelected(): unknown dive";
|
||||||
emit newCurrentDive(QModelIndex());
|
emit currentDiveChanged(QModelIndex());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
emit newCurrentDive(createIndex(it - items.begin(), 0));
|
emit currentDiveChanged(createIndex(it - items.begin(), 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Simple sorting helper for sorting against a criterium and if
|
// Simple sorting helper for sorting against a criterium and if
|
||||||
|
|
|
@ -95,7 +95,7 @@ signals:
|
||||||
// indexes into local indexes according to current sorting/filtering and instructs the QSelectionModel to
|
// indexes into local indexes according to current sorting/filtering and instructs the QSelectionModel to
|
||||||
// perform the appropriate actions.
|
// perform the appropriate actions.
|
||||||
void selectionChanged(const QVector<QModelIndex> &indexes);
|
void selectionChanged(const QVector<QModelIndex> &indexes);
|
||||||
void newCurrentDive(QModelIndex index);
|
void currentDiveChanged(QModelIndex index);
|
||||||
protected:
|
protected:
|
||||||
// Access trip and dive data
|
// Access trip and dive data
|
||||||
static QVariant diveData(const struct dive *d, int column, int role);
|
static QVariant diveData(const struct dive *d, int column, int role);
|
||||||
|
|
Loading…
Add table
Reference in a new issue