debug: try to capture changes that don't invalidate git cache

At least in those cases where we are sending a divesChanged signal we can
easily check if the cache was properly invalidated. Of course this won't help
in cases where we don't notify the dive list about changes, either.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2020-02-17 17:16:11 -08:00
parent 45d37fd51b
commit 7d9e907681
5 changed files with 34 additions and 3 deletions

View file

@ -37,8 +37,6 @@
#include "core/settings/qPrefPartialPressureGas.h"
#include "core/settings/qPrefTechnicalDetails.h"
#include "core/subsurface-qt/divelistnotifier.h"
#include "desktop-widgets/about.h"
#include "desktop-widgets/divecomputermanagementdialog.h"
#include "desktop-widgets/divelistview.h"
@ -218,6 +216,11 @@ MainWindow::MainWindow() : QMainWindow(),
connect(&windowTitleUpdate, &WindowTitleUpdate::updateTitle, this, &MainWindow::setAutomaticTitle);
connect(&diveListNotifier, &DiveListNotifier::numShownChanged, this, &MainWindow::setAutomaticTitle);
// 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, &MainWindow::divesChanged);
#ifdef NO_PRINTING
plannerDetails->printPlan()->hide();
ui.menuFile->removeAction(ui.actionPrint);
@ -1944,3 +1947,13 @@ void MainWindow::unsetProfTissues()
ui.profTissues->setChecked(false);
qPrefTechnicalDetails::set_percentagegraph(false);
}
void MainWindow::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);
}
}