cleanup: hide DiveComputerList implementation details

Remove the declaration of helper functions needed only in
core/device.cpp. To this goal, turn the member functions
into free functions.

Cosmetics: turn the DiveComputer[Node|List] "class"es into
"struct"s, since all members were public anyway.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2020-09-14 14:20:37 +02:00 committed by Dirk Hohndel
parent d183e93bad
commit 2b557f567a
2 changed files with 11 additions and 17 deletions

View file

@ -26,8 +26,7 @@ extern void clear_device_nodes();
#include <QString>
#include <QVector>
class DiveComputerNode {
public:
struct DiveComputerNode {
bool operator==(const DiveComputerNode &a) const;
bool operator!=(const DiveComputerNode &a) const;
bool operator<(const DiveComputerNode &a) const;
@ -39,12 +38,7 @@ public:
QString nickName;
};
class DiveComputerList {
public:
const DiveComputerNode *getExact(const QString &m, uint32_t d);
const DiveComputerNode *get(const QString &m);
void addDC(QString m, uint32_t d, QString n = QString(), QString s = QString(), QString f = QString());
struct DiveComputerList {
// Keep the dive computers in a vector sorted by (model, deviceId)
QVector<DiveComputerNode> dcs;
};