summaryrefslogtreecommitdiffstats
path: root/core/divecomputer.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2018-07-25 18:43:55 -0700
committerGravatar Lubomir I. Ivanov <neolit123@gmail.com>2018-07-26 16:32:51 +0300
commitc7f0e65b12ec99804db60ea9c2439a0a6ade4367 (patch)
treedb9cb2b810924011aba3886dafa37ae2f8bf6082 /core/divecomputer.cpp
parent0e6c3db24c77331f52d17fd22494565dbafc6f84 (diff)
downloadsubsurface-c7f0e65b12ec99804db60ea9c2439a0a6ade4367.tar.gz
Whitespace cleanup core divecomputer handling
Not entirely script based because of two odd issues where the script creates bogus indentation. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/divecomputer.cpp')
-rw-r--r--core/divecomputer.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/core/divecomputer.cpp b/core/divecomputer.cpp
index 5a6353f1f..978074e62 100644
--- a/core/divecomputer.cpp
+++ b/core/divecomputer.cpp
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: GPL-2.0
#include "divecomputer.h"
#include "dive.h"
-#include "subsurface-string.h"
#include "subsurface-qt/SettingsObjectWrapper.h"
+#include "subsurface-string.h"
DiveComputerList dcList;
@@ -38,13 +38,13 @@ bool DiveComputerNode::changesValues(const DiveComputerNode &b) const
const DiveComputerNode *DiveComputerList::getExact(const QString &m, uint32_t d)
{
- auto it = std::lower_bound(dcs.begin(), dcs.end(), DiveComputerNode { m, d , {}, {}, {} } );
+ auto it = std::lower_bound(dcs.begin(), dcs.end(), DiveComputerNode{m, d, {}, {}, {}});
return it != dcs.end() && it->model == m && it->deviceId == d ? &*it : NULL;
}
const DiveComputerNode *DiveComputerList::get(const QString &m)
{
- auto it = std::lower_bound(dcs.begin(), dcs.end(), DiveComputerNode { m, 0 , {}, {}, {} } );
+ auto it = std::lower_bound(dcs.begin(), dcs.end(), DiveComputerNode{m, 0, {}, {}, {}});
return it != dcs.end() && it->model == m ? &*it : NULL;
}
@@ -62,7 +62,7 @@ void DiveComputerList::addDC(QString m, uint32_t d, QString n, QString s, QStrin
{
if (m.isEmpty() || d == 0)
return;
- auto it = std::lower_bound(dcs.begin(), dcs.end(), DiveComputerNode { m, d , {}, {}, {} } );
+ auto it = std::lower_bound(dcs.begin(), dcs.end(), DiveComputerNode{m, d, {}, {}, {}});
if (it != dcs.end() && it->model == m && it->deviceId == d) {
// debugging: show changes
if (verbose)
@@ -75,7 +75,7 @@ void DiveComputerList::addDC(QString m, uint32_t d, QString n, QString s, QStrin
if (!f.isEmpty())
it->firmware = f;
} else {
- dcs.insert(it, DiveComputerNode { m, d, s, f, n });
+ dcs.insert(it, DiveComputerNode{m, d, s, f, n});
}
}
@@ -89,13 +89,12 @@ static bool compareDCById(const DiveComputerNode &a, const DiveComputerNode &b)
return a.deviceId < b.deviceId;
}
-extern "C" void call_for_each_dc (void *f, void (*callback)(void *, const char *, uint32_t,
- const char *, const char *, const char *),
- bool select_only)
+extern "C" void call_for_each_dc (void *f, void (*callback)(void *, const char *, uint32_t, const char *, const char *, const char *),
+ bool select_only)
{
QVector<DiveComputerNode> values = dcList.dcs;
std::sort(values.begin(), values.end(), compareDCById);
- for (const DiveComputerNode &node: values) {
+ for (const DiveComputerNode &node : values) {
bool found = false;
if (select_only) {
int j;
@@ -104,7 +103,7 @@ extern "C" void call_for_each_dc (void *f, void (*callback)(void *, const char *
struct divecomputer *dc;
if (!d->selected)
continue;
- for_each_dc(d, dc) {
+ for_each_dc (d, dc) {
if (dc->deviceid == node.deviceId) {
found = true;
break;
@@ -117,7 +116,7 @@ extern "C" void call_for_each_dc (void *f, void (*callback)(void *, const char *
found = true;
}
if (found)
- callback(f, qPrintable(node.model), node.deviceId, qPrintable(node.nickName),
+ callback(f, qPrintable(node.model), node.deviceId, qPrintable(node.nickName),
qPrintable(node.serialNumber), qPrintable(node.firmware));
}
}