diff options
Diffstat (limited to 'core/divecomputer.cpp')
-rw-r--r-- | core/divecomputer.cpp | 21 |
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)); } } |