From d28f4d534771ea64ec6e00ca3aaea1b3f9e92c41 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Wed, 4 Aug 2021 09:11:32 +0200 Subject: [PATCH] profile: don't compile ProfileWidget2 on mobile Since there (currently) is no interactive widget on mobile, there is no point in compiling it. This was a bit more complicated than expected, since there were other source files (divehandler.cpp and ruleritem.cpp) which reference ProfileWidget2 and therefore need to be removed. Otherwise, the dreadful MOC produces unresolved references. We could now remove all the conditional compiles in profilewidget2.cpp, but let's keep them for now. We might have to readd a number of them later, when making the mobile-profile interactive. Signed-off-by: Berthold Stoeger --- Subsurface-mobile.pro | 6 ------ commands/command_divelist.cpp | 1 - profile-widget/CMakeLists.txt | 16 ++++++++++------ 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/Subsurface-mobile.pro b/Subsurface-mobile.pro index 178f1eeba..3de851336 100644 --- a/Subsurface-mobile.pro +++ b/Subsurface-mobile.pro @@ -169,14 +169,11 @@ SOURCES += subsurface-mobile-main.cpp \ profile-widget/divecartesianaxis.cpp \ profile-widget/diveeventitem.cpp \ profile-widget/diveprofileitem.cpp \ - profile-widget/profilewidget2.cpp \ profile-widget/profilescene.cpp \ - profile-widget/ruleritem.cpp \ profile-widget/animationfunctions.cpp \ profile-widget/divepixmapitem.cpp \ profile-widget/divetooltipitem.cpp \ profile-widget/tankitem.cpp \ - profile-widget/divehandler.cpp \ profile-widget/divelineitem.cpp \ profile-widget/diverectitem.cpp \ profile-widget/divetextitem.cpp @@ -325,15 +322,12 @@ HEADERS += \ qt-models/filterpresetmodel.h \ profile-widget/qmlprofile.h \ profile-widget/diveprofileitem.h \ - profile-widget/profilewidget2.h \ profile-widget/profilescene.h \ - profile-widget/ruleritem.h \ profile-widget/diveeventitem.h \ profile-widget/divetooltipitem.h \ profile-widget/tankitem.h \ profile-widget/animationfunctions.h \ profile-widget/divecartesianaxis.h \ - profile-widget/divehandler.h \ profile-widget/divelineitem.h \ profile-widget/divepixmapitem.h \ profile-widget/diverectitem.h \ diff --git a/commands/command_divelist.cpp b/commands/command_divelist.cpp index f7e6b8f71..6236dd438 100644 --- a/commands/command_divelist.cpp +++ b/commands/command_divelist.cpp @@ -6,7 +6,6 @@ #include "core/selection.h" #include "core/subsurface-qt/divelistnotifier.h" #include "qt-models/filtermodels.h" -#include "../profile-widget/profilewidget2.h" #include "core/divefilter.h" #include diff --git a/profile-widget/CMakeLists.txt b/profile-widget/CMakeLists.txt index 403f05930..e7a21b12b 100644 --- a/profile-widget/CMakeLists.txt +++ b/profile-widget/CMakeLists.txt @@ -6,8 +6,6 @@ set(SUBSURFACE_PROFILE_LIB_SRCS divecartesianaxis.h diveeventitem.cpp diveeventitem.h - divehandler.cpp - divehandler.h divelineitem.cpp divelineitem.h divepixmapitem.cpp @@ -20,12 +18,8 @@ set(SUBSURFACE_PROFILE_LIB_SRCS divetextitem.h divetooltipitem.cpp divetooltipitem.h - profilewidget2.cpp - profilewidget2.h profilescene.cpp profilescene.h - ruleritem.cpp - ruleritem.h tankitem.cpp tankitem.h ) @@ -35,6 +29,16 @@ set(SUBSURFACE_PROFILE_LIB_SRCS qmlprofile.cpp qmlprofile.h ) +else () +set(SUBSURFACE_PROFILE_LIB_SRCS + ${SUBSURFACE_PROFILE_LIB_SRCS} + divehandler.cpp + divehandler.h + profilewidget2.cpp + profilewidget2.h + ruleritem.cpp + ruleritem.h +) endif () source_group("Subsurface Profile" FILES ${SUBSURFACE_PROFILE_LIB_SRCS})