diff options
Diffstat (limited to 'mobile-widgets/qmlmanager.cpp')
-rw-r--r-- | mobile-widgets/qmlmanager.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index 4f16cf1d0..06d93ce2c 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -264,6 +264,11 @@ QMLManager::QMLManager() : m_locationServiceEnabled(false), what.tags = true; what.cylinders = true; what.weights = true; + + // monitor when dives changed - but only in verbose mode + // careful - changing verbose at runtime isn't enough (of course that could be added if we want it) + if (verbose) + connect(&diveListNotifier, &DiveListNotifier::divesChanged, this, &QMLManager::divesChanged); } void QMLManager::applicationStateChanged(Qt::ApplicationState state) @@ -2189,3 +2194,13 @@ void QMLManager::setOldStatus(const qPrefCloudStorage::cloud_status value) emit oldStatusChanged(); } } + +void QMLManager::divesChanged(const QVector<dive *> &dives, DiveField field) +{ + Q_UNUSED(field) + for (struct dive *d: dives) { + qDebug() << "dive #" << d->number << "changed, cache is" << (dive_cache_is_valid(d) ? "valid" : "invalidated"); + // a brute force way to deal with that would of course be to call + // invalidate_dive_cache(d); + } +} |