summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-05-23 18:38:45 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-05-23 21:33:19 -0700
commitecbcd4db4721c9e4a6b4253a5f45f43fa9e80fc7 (patch)
tree7074fbf17e3fbe467a11a0613737c423e9f92926
parent641db88a2c6b50ccbb2df1546de42b779541bf0c (diff)
downloadsubsurface-ecbcd4db4721c9e4a6b4253a5f45f43fa9e80fc7.tar.gz
Enable the weightsystem info and move the declarations to dive.h
Having the tank_info declared in models.cpp seemed unintuitive. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--dive.h13
-rw-r--r--equipment.c7
-rw-r--r--qt-ui/models.cpp2
3 files changed, 13 insertions, 9 deletions
diff --git a/dive.h b/dive.h
index a1febdd16..70459f931 100644
--- a/dive.h
+++ b/dive.h
@@ -726,9 +726,9 @@ void get_gas_string(int o2, int he, char *buf, int len);
struct event *get_next_event(struct event *event, char *name);
-/* this struct holds the information that
- * describes the cylinders of air.
- * it is a global variable initialized in equipment.c
+/* these structs holds the information that
+ * describes the cylinders / weight systems.
+ * they are global variables initialized in equipment.c
* used to fill the combobox in the add/edit cylinder
* dialog
*/
@@ -737,6 +737,13 @@ struct tank_info {
const char *name;
int cuft, ml, psi, bar;
};
+extern struct tank_info tank_info[100];
+
+struct ws_info {
+ const char *name;
+ int grams;
+};
+extern struct ws_info ws_info[100];
extern bool cylinder_nodata(cylinder_t *cyl);
extern bool cylinder_none(void *_data);
diff --git a/equipment.c b/equipment.c
index 2c17b985e..cd3984c86 100644
--- a/equipment.c
+++ b/equipment.c
@@ -909,15 +909,13 @@ bad_tank_info:
fprintf(stderr, "Bad tank info for '%s'\n", info->name);
}
}
+#endif /* USE_GTK_UI */
/*
* We hardcode the most common weight system types
* This is a bit odd as the weight system types don't usually encode weight
*/
-static struct ws_info {
- const char *name;
- int grams;
-} ws_info[100] = {
+struct ws_info ws_info[100] = {
{ N_("integrated"), 0 },
{ N_("belt"), 0 },
{ N_("ankle"), 0 },
@@ -925,6 +923,7 @@ static struct ws_info {
{ N_("clip-on"), 0 },
};
+#if USE_GTK_UI
static void fill_ws_list(GtkListStore *store)
{
GtkTreeIter iter;
diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp
index 0ef054533..5809fa55b 100644
--- a/qt-ui/models.cpp
+++ b/qt-ui/models.cpp
@@ -14,8 +14,6 @@
#include <QFont>
#include <QIcon>
-extern struct tank_info tank_info[100];
-
CylindersModel::CylindersModel(QObject* parent): QAbstractTableModel(parent), current(0), rows(0)
{
}