From 5a8db978198682734cdecc69a480d21a16775d4a Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 14 Nov 2020 19:21:16 -0800 Subject: build-system: add models and shared backends to the downloader We'll need this in order to be able to actually open dive files and download things from a dive computer. Signed-off-by: Dirk Hohndel --- qt-models/CMakeLists.txt | 3 +++ qt-models/maplocationmodel.cpp | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'qt-models') diff --git a/qt-models/CMakeLists.txt b/qt-models/CMakeLists.txt index b42b6063b..dc115c554 100644 --- a/qt-models/CMakeLists.txt +++ b/qt-models/CMakeLists.txt @@ -73,4 +73,7 @@ elseif (SUBSURFACE_TARGET_EXECUTABLE MATCHES "MobileExecutable") add_library(subsurface_models_mobile STATIC ${SUBSURFACE_GENERIC_MODELS_LIB_SRCS} ${SUBSURFACE_MOBILE_MODELS_LIB_SRCS}) target_link_libraries(subsurface_models_mobile ${QT_LIBRARIES}) +elseif (SUBSURFACE_TARGET_EXECUTABLE MATCHES "DownloaderExecutable") + add_library(subsurface_models_downloader STATIC ${SUBSURFACE_GENERIC_MODELS_LIB_SRCS}) + target_link_libraries(subsurface_models_downloader ${QT_LIBRARIES}) endif() diff --git a/qt-models/maplocationmodel.cpp b/qt-models/maplocationmodel.cpp index c123b19c5..b92d1385e 100644 --- a/qt-models/maplocationmodel.cpp +++ b/qt-models/maplocationmodel.cpp @@ -3,7 +3,7 @@ #include "divelocationmodel.h" #include "core/divesite.h" #include "core/divefilter.h" -#ifndef SUBSURFACE_MOBILE +#if !defined(SUBSURFACE_MOBILE) && !defined(SUBSURFACE_DOWNLOADER) #include "qt-models/filtermodels.h" #include "desktop-widgets/mapwidget.h" #endif @@ -20,7 +20,7 @@ MapLocation::MapLocation(struct dive_site *dsIn, QGeoCoordinate coordIn, QString // Simplify this! static bool inEditMode() { -#ifdef SUBSURFACE_MOBILE +#if defined(SUBSURFACE_MOBILE) || defined(SUBSURFACE_DOWNLOADER) return false; #else return MapWidget::instance()->editMode(); @@ -127,7 +127,7 @@ void MapLocationModel::reload(QObject *map) QMap locationNameMap; -#ifdef SUBSURFACE_MOBILE +#if defined(SUBSURFACE_MOBILE) || defined(SUBSURFACE_DOWNLOADER) bool diveSiteMode = false; #else // In dive site mode (that is when either editing a dive site or on -- cgit v1.2.3-70-g09d2