mobile/UI: provide more structured debug output for dive edit

Instead of always showing info about the location, allow all data to be
captured in a more structured format - but only when the app is in
verbose mode.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2020-12-30 12:36:16 -08:00
parent 9d12ad2308
commit 2e26051bd6

View file

@ -961,7 +961,6 @@ bool QMLManager::checkLocation(DiveSiteChange &res, struct dive *d, QString loca
struct dive_site *ds = get_dive_site_for_dive(d);
bool changed = false;
QString oldLocation = get_dive_location(d);
qDebug() << "checkLocation" << location << "gps" << gps << "dive had" << oldLocation << "gps" << formatDiveGPS(d);
if (oldLocation != location) {
ds = get_dive_site_by_name(qPrintable(location), &dive_site_table);
if (!ds && !location.isEmpty()) {
@ -1069,6 +1068,22 @@ void QMLManager::commitChanges(QString diveId, QString number, QString date, QSt
appendTextToLog("cannot commit changes: no dive");
return;
}
if (verbose) {
qDebug().noquote() << QStringLiteral("diveId :'%1'\n").arg(diveId) <<
QStringLiteral("number :'%1'\n").arg(number) <<
QStringLiteral("date :'%1'\n").arg(date) <<
QStringLiteral("location:'%1'\n").arg(location) <<
QStringLiteral("gps :'%1'\n").arg(gps) <<
QStringLiteral("duration:'%1'\n").arg(duration) <<
QStringLiteral("depth :'%1'\n").arg(depth) <<
QStringLiteral("airtemp :'%1'\n").arg(airtemp) <<
QStringLiteral("watertmp:'%1'\n").arg(watertemp) <<
QStringLiteral("suit :'%1'\n").arg(suit) <<
QStringLiteral("buddy :'%1'\n").arg(buddy) <<
QStringLiteral("diveMstr:'%1'\n").arg(diveMaster) <<
QStringLiteral("weight :'%1'\n").arg(weight) <<
QStringLiteral("state :'%1'\n").arg(state);
}
Command::OwningDivePtr d_ptr(alloc_dive()); // Automatically delete dive if we exit early!
dive *d = d_ptr.get();