From 0eb14828b5214146d47079806a863ff3d729606c Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sun, 11 Aug 2019 09:11:06 -0700 Subject: [PATCH] Mobile: use a default weight name when adding weight system Signed-off-by: Dirk Hohndel --- mobile-widgets/qmlmanager.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index fc8f12a20..605525d67 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -487,7 +487,7 @@ void QMLManager::saveCloudCredentials() } cloudCredentialsChanged |= !same_string(prefs.cloud_storage_password, - qPrintable(QMLPrefs::instance()->cloudPassword())); + qPrintable(QMLPrefs::instance()->cloudPassword())); if (QMLPrefs::instance()->credentialStatus() != qPrefCloudStorage::CS_NOCLOUD && !cloudCredentialsChanged) { @@ -1045,8 +1045,8 @@ void QMLManager::commitChanges(QString diveId, QString date, QString location, Q // not sure what we'd do if there was more than one weight system // defined - for now just ignore that case if (d->weightsystems.nr == 0) { - weightsystem_t ws = { { parseWeightToGrams(weight) } , "" }; - add_cloned_weightsystem(&d->weightsystems, ws); + weightsystem_t ws = { { parseWeightToGrams(weight) } , strdup(qPrintable(tr("weight"))) }; + add_to_weightsystem_table(&d->weightsystems, 0, ws); // takes ownership of the string } else if (d->weightsystems.nr == 1) { d->weightsystems.weightsystems[0].weight.grams = parseWeightToGrams(weight); }