diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2020-10-03 11:18:42 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-10-03 10:53:26 -0700 |
commit | 5bc6f5d36c491b305f66a03c8400666ccda0b044 (patch) | |
tree | 05dc2aadb40aaede4501b393677e506d04d72aec /core/device.h | |
parent | 90ca6353167071af57028975dc650cd027605372 (diff) | |
download | subsurface-5bc6f5d36c491b305f66a03c8400666ccda0b044.tar.gz |
cleanup: make device code more consistent with core
We keep track of device, i.e. distinct dive computers with id in the core.
The corresponding code stuck out like a sore thumb. Firstly, because it
is C++. But more importantly, because it used inconsistent nameing conventions.
Notably it defined a "DiveComputerNode" when this is something very different
from "struct dive_computer", the latter being the dive-computer related
data of a single dive.
Since the whole thing is defined in "device.h" and the function to create
such an entry is called "create_device_node", call the structure "device".
Use snake_case for consistency with the other core structures.
Moreover, call the collection of devices "device_table" in analogy
with "dive_table", etc.
Overall, this should make the core code more consistent style-wise.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/device.h')
-rw-r--r-- | core/device.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/core/device.h b/core/device.h index ba2a882ee..910c77b90 100644 --- a/core/device.h +++ b/core/device.h @@ -26,10 +26,10 @@ extern void clear_device_nodes(); #include <QString> #include <QVector> -struct DiveComputerNode { - bool operator==(const DiveComputerNode &a) const; - bool operator!=(const DiveComputerNode &a) const; - bool operator<(const DiveComputerNode &a) const; +struct device { + bool operator==(const device &a) const; + bool operator!=(const device &a) const; + bool operator<(const device &a) const; void showchanges(const QString &n, const QString &s, const QString &f) const; QString model; uint32_t deviceId; @@ -38,13 +38,13 @@ struct DiveComputerNode { QString nickName; }; -struct DiveComputerList { +struct device_table { // Keep the dive computers in a vector sorted by (model, deviceId) - QVector<DiveComputerNode> dcs; + QVector<device> devices; }; QString get_dc_nickname(const struct divecomputer *dc); -extern DiveComputerList dcList; +extern struct device_table device_table; #endif |