Compare commits
1 Commits
master
...
mobileAddD
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
749182cc07 |
@ -1,4 +1,4 @@
|
|||||||
|
mobile: fix manually adding dives in the past [#2971]
|
||||||
|
|
||||||
---
|
---
|
||||||
* Always add new entries at the very top of this file above other existing entries and this note.
|
* Always add new entries at the very top of this file above other existing entries and this note.
|
||||||
|
|||||||
@ -1414,7 +1414,7 @@ void QMLManager::selectDive(int id)
|
|||||||
amount_selected++;
|
amount_selected++;
|
||||||
}
|
}
|
||||||
if (amount_selected == 0)
|
if (amount_selected == 0)
|
||||||
qWarning("QManager::selectDive() called with unknown id");
|
qWarning("QManager::selectDive() called with unknown id %d",id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QMLManager::deleteDive(int id)
|
void QMLManager::deleteDive(int id)
|
||||||
|
|||||||
@ -538,9 +538,6 @@ static ShownChange updateShownAll()
|
|||||||
|
|
||||||
void DiveTripModelBase::currentChanged()
|
void DiveTripModelBase::currentChanged()
|
||||||
{
|
{
|
||||||
if (oldCurrent == current_dive)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// On Desktop we use a signal to forward current-dive changed, on mobile we use ROLE_CURRENT.
|
// On Desktop we use a signal to forward current-dive changed, on mobile we use ROLE_CURRENT.
|
||||||
// TODO: Unify - use the role for both.
|
// TODO: Unify - use the role for both.
|
||||||
#if defined(SUBSURFACE_MOBILE)
|
#if defined(SUBSURFACE_MOBILE)
|
||||||
@ -549,11 +546,13 @@ void DiveTripModelBase::currentChanged()
|
|||||||
QModelIndex oldIdx = diveToIdx(oldCurrent);
|
QModelIndex oldIdx = diveToIdx(oldCurrent);
|
||||||
dataChanged(oldIdx, oldIdx, roles);
|
dataChanged(oldIdx, oldIdx, roles);
|
||||||
}
|
}
|
||||||
if (current_dive) {
|
if (current_dive && oldCurrent != current_dive) {
|
||||||
QModelIndex newIdx = diveToIdx(current_dive);
|
QModelIndex newIdx = diveToIdx(current_dive);
|
||||||
dataChanged(newIdx, newIdx, roles);
|
dataChanged(newIdx, newIdx, roles);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
if (oldCurrent == current_dive)
|
||||||
|
return;
|
||||||
if (current_dive) {
|
if (current_dive) {
|
||||||
QModelIndex newIdx = diveToIdx(current_dive);
|
QModelIndex newIdx = diveToIdx(current_dive);
|
||||||
emit currentDiveChanged(newIdx);
|
emit currentDiveChanged(newIdx);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user