diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2017-04-27 20:24:14 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-05-27 08:07:35 -0700 |
commit | a55efcf7d88e0521d754508b7ff9f0e89692950a (patch) | |
tree | 60e407cdbc9e38c077c0469d89cae12b413992c0 /core/downloadfromdcthread.h | |
parent | dec47e11cd3aa1f4c6333a69c72df4c4d5e0628f (diff) | |
download | subsurface-a55efcf7d88e0521d754508b7ff9f0e89692950a.tar.gz |
Move the fill_computer_list() out of widgets
fill_computer_list() creates a Qt friendly
structure that contains all of the necessary
information about dive computers and it's
devices, and it's needed both in Qml and Widgets
to allow the user to download their dives.
This patch makes it possible to use the code
in QML without duplication.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/downloadfromdcthread.h')
-rw-r--r-- | core/downloadfromdcthread.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/core/downloadfromdcthread.h b/core/downloadfromdcthread.h index ab21db0aa..23522b4d4 100644 --- a/core/downloadfromdcthread.h +++ b/core/downloadfromdcthread.h @@ -2,6 +2,9 @@ #define DOWNLOADFROMDCTHREAD_H #include <QThread> +#include <QMap> +#include <QHash> + #include "dive.h" #include "libdivecomputer.h" @@ -18,4 +21,32 @@ private: device_data_t *data; }; +struct product { + const char *product; + dc_descriptor_t *descriptor; + struct product *next; +}; + +struct vendor { + const char *vendor; + struct product *productlist; + struct vendor *next; +}; + +struct mydescriptor { + const char *vendor; + const char *product; + dc_family_t type; + unsigned int model; +}; + +/* This fills the vendor list QStringList and related members. +* this code needs to be reworked to be less ugly, but it will +* stay like this for now. +*/ +void fill_computer_list(); +extern QStringList vendorList; +extern QHash<QString, QStringList> productList; +extern QMap<QString, dc_descriptor_t *> descriptorLookup; + #endif |