summaryrefslogtreecommitdiffstats
path: root/core/divecomputer.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-09-13 19:08:41 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-09-13 13:54:59 -0700
commita01ab817139be16906c30f89e16a0a3fbbe026cd (patch)
treebd77786542d82f0a3f2fccd6079e70f1f4e118f3 /core/divecomputer.h
parentfcdb48779b0e109942ad2261670c6fc9344e2da3 (diff)
downloadsubsurface-a01ab817139be16906c30f89e16a0a3fbbe026cd.tar.gz
cleanup: fold core/divecomputer.cpp into core/device.c
core/device.h was declaring a number of functions that were related to divecomputers (dcs): creating a fake dc for manually entered dives and registering / accessing dc nicknames. On could argue whether these should be lumped together, but it is what it is. However, part of that was implemented in C++/Qt code in a separate core/divecomputer.cpp file. Some function therein where only accessible to C++ and declared in core/divecomputer.h. All in all, a big mess. Let's simply combine the files and conditionally compile the C++-only functions depending on the __cplusplus define. Yes, that means turning device.c into device.cpp. A brave soul might turn the C++/Qt code into C code if they whish later on. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/divecomputer.h')
-rw-r--r--core/divecomputer.h35
1 files changed, 0 insertions, 35 deletions
diff --git a/core/divecomputer.h b/core/divecomputer.h
deleted file mode 100644
index c92d56558..000000000
--- a/core/divecomputer.h
+++ /dev/null
@@ -1,35 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-#ifndef DIVECOMPUTER_H
-#define DIVECOMPUTER_H
-
-#include <QString>
-#include <QVector>
-#include <stdint.h>
-
-class DiveComputerNode {
-public:
- bool operator==(const DiveComputerNode &a) const;
- bool operator!=(const DiveComputerNode &a) const;
- bool operator<(const DiveComputerNode &a) const;
- void showchanges(const QString &n, const QString &s, const QString &f) const;
- QString model;
- uint32_t deviceId;
- QString serialNumber;
- QString firmware;
- 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());
-
- // Keep the dive computers in a vector sorted by (model, deviceId)
- QVector<DiveComputerNode> dcs;
-};
-
-QString get_dc_nickname(const struct divecomputer *dc);
-extern DiveComputerList dcList;
-
-#endif