Dive sites: prepare for dive site ref-counting

Add a dive site table to each dive site to keep track of dives
that have been added to a dive site. Add two functions to add
dives to / remove dives from dive sites.

Since dive sites now contain a dive table, the order of includes
had to be changed: "divesite.h" now includes "dive.h" and not
vice-versa. This caused some include churn.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2019-03-04 23:20:29 +01:00 committed by Dirk Hohndel
parent f2cdca7bcc
commit c22fd9f4fd
38 changed files with 75 additions and 29 deletions

View file

@ -4,7 +4,7 @@
#ifndef COMMAND_BASE_H
#define COMMAND_BASE_H
#include "core/dive.h"
#include "core/divesite.h"
#include <QUndoCommand>
#include <QCoreApplication> // For Q_DECLARE_TR_FUNCTIONS

View file

@ -16,7 +16,7 @@
#include "desktop-widgets/mainwindow.h"
#include "profile-widget/profilewidget2.h"
#include "core/save-profiledata.h"
#include "core/dive.h" // Allows access to helper functions in TeX export.
#include "core/divesite.h"
// Retrieves the current unit settings defined in the Subsurface preferences.
#define GET_UNIT(name, field, f, t) \

View file

@ -11,6 +11,7 @@
#include <QUndoStack>
#include <QPainter>
#include "core/qthelper.h"
#include "core/divesite.h"
#include "core/import-csv.h"
static QString subsurface_mimedata = "subsurface/csvcolumns";

View file

@ -14,6 +14,7 @@
#include "qt-models/divetripmodel.h"
#include "qt-models/divelocationmodel.h"
#include "core/qthelper.h"
#include "core/divesite.h"
#include "desktop-widgets/simplewidgets.h"
#include <QCompleter>

View file

@ -13,6 +13,7 @@
#include <QClipboard>
#include "core/file.h"
#include "core/divesite.h"
#include "desktop-widgets/mainwindow.h"
#include "core/qthelper.h"
#include "libdivecomputer/parser.h"