summaryrefslogtreecommitdiffstats
path: root/qt-models
diff options
context:
space:
mode:
Diffstat (limited to 'qt-models')
-rw-r--r--qt-models/CMakeLists.txt29
-rw-r--r--qt-models/completionmodels.cpp3
-rw-r--r--qt-models/diveplotdatamodel.cpp2
-rw-r--r--qt-models/filtermodels.cpp15
-rw-r--r--qt-models/models.h6
5 files changed, 47 insertions, 8 deletions
diff --git a/qt-models/CMakeLists.txt b/qt-models/CMakeLists.txt
new file mode 100644
index 000000000..c9bcf5c3d
--- /dev/null
+++ b/qt-models/CMakeLists.txt
@@ -0,0 +1,29 @@
+# the data models that will interface
+# with the views.
+set(SUBSURFACE_MODELS_LIB_SRCS
+ cleanertablemodel.cpp
+ cylindermodel.cpp
+ diveplannermodel.cpp
+ models.cpp
+ filtermodels.cpp
+ tankinfomodel.cpp
+ weigthsysteminfomodel.cpp
+ weightmodel.cpp
+ divecomputermodel.cpp
+ treemodel.cpp
+ tableprintmodel.cpp
+ yearlystatisticsmodel.cpp
+ divetripmodel.cpp
+ divecomputerextradatamodel.cpp
+ completionmodels.cpp
+ profileprintmodel.cpp
+ divepicturemodel.cpp
+ diveplotdatamodel.cpp
+ divelocationmodel.cpp
+ divesitepicturesmodel.cpp
+ ssrfsortfilterproxymodel.cpp
+)
+
+source_group("Subsurface Models" FILES ${SUBSURFACE_MODELS})
+add_library(subsurface_models STATIC ${SUBSURFACE_MODELS_LIB_SRCS})
+target_link_libraries(subsurface_models ${QT_LIBRARIES}) \ No newline at end of file
diff --git a/qt-models/completionmodels.cpp b/qt-models/completionmodels.cpp
index 838d239d2..a8b61aed5 100644
--- a/qt-models/completionmodels.cpp
+++ b/qt-models/completionmodels.cpp
@@ -1,6 +1,7 @@
#include "completionmodels.h"
#include "dive.h"
-#include "mainwindow.h"
+#include <QSet>
+#include <QString>
#define CREATE_UPDATE_METHOD(Class, diveStructMember) \
void Class::updateModel() \
diff --git a/qt-models/diveplotdatamodel.cpp b/qt-models/diveplotdatamodel.cpp
index f219947ac..de156bfac 100644
--- a/qt-models/diveplotdatamodel.cpp
+++ b/qt-models/diveplotdatamodel.cpp
@@ -1,8 +1,8 @@
#include "diveplotdatamodel.h"
#include "dive.h"
#include "profile.h"
-#include "graphicsview-common.h"
#include "divelist.h"
+#include "subsurface-core/color.h"
DivePlotDataModel::DivePlotDataModel(QObject *parent) :
QAbstractTableModel(parent),
diff --git a/qt-models/filtermodels.cpp b/qt-models/filtermodels.cpp
index 80ed0cfd5..f56f4be1c 100644
--- a/qt-models/filtermodels.cpp
+++ b/qt-models/filtermodels.cpp
@@ -1,8 +1,9 @@
#include "filtermodels.h"
-#include "mainwindow.h"
#include "models.h"
-#include "divelistview.h"
#include "display.h"
+#include "divetripmodel.h"
+
+#include <QDebug>
#define CREATE_INSTANCE_METHOD( CLASS ) \
CLASS *CLASS::instance() \
@@ -355,9 +356,16 @@ bool MultiFilterSortModel::filterAcceptsRow(int source_row, const QModelIndex &s
void MultiFilterSortModel::myInvalidate()
{
+ //WARNING:
+ //TODO:
+ // THIS CODE BELOW IS COMPLETELY BROKEN. I KNOW, I WROTE IT.
+ // REMOVE THIS, MAKE IT SANE.
+ // GRRRRR.
+
+#if 0
int i;
struct dive *d;
- DiveListView *dlv = MainWindow::instance()->dive_list();
+ // DiveListView *dlv = MainWindow::instance()->dive_list();
divesDisplayed = 0;
@@ -395,6 +403,7 @@ void MultiFilterSortModel::myInvalidate()
if (curr_dive_site) {
dlv->expandAll();
}
+#endif
}
void MultiFilterSortModel::addFilterModel(MultiFilterInterface *model)
diff --git a/qt-models/models.h b/qt-models/models.h
index c9212195e..f152af469 100644
--- a/qt-models/models.h
+++ b/qt-models/models.h
@@ -15,9 +15,9 @@
#include "metrics.h"
-#include "../dive.h"
-#include "../divelist.h"
-#include "../divecomputer.h"
+#include "subsurface-core/dive.h"
+#include "subsurface-core/divelist.h"
+#include "subsurface-core/divecomputer.h"
#include "cleanertablemodel.h"
#include "treemodel.h"