From 634152ae43f37a62a67de5a5d5fc4e6b02829ce0 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Wed, 13 May 2020 15:34:25 +0200 Subject: filter: add filter constraint object to the core Adds a filter constraint object to the core, which represents one constraint the user can filter dives with. The plan is to write these constraints to the XML and git logs. Therefore, this code is written in C-style except when it comes to handling strings and dates, which is just too painful in plain C. There is one pointer to QStringList in the class, though when compiled with C, this is simply transformed into a pointer to void. Granted, that smells of an ugly hack. However it's more pragmatic than self-flaggelation with C string and list handling. A filter constraint is supposed to be a very general thing, which can filter for strings, multiple-choice lists, numerical ranges and date ranges. Range constraints have a range mode: less-or-equal, greater-or-equal or in-range. Text constraints have a string mode: startswith, substring or exact. All the data are accessed via setter and getter functions for at least basic levels of isolation, despite being written with a C-interface in mind. Signed-off-by: Berthold Stoeger --- packaging/ios/Subsurface-mobile.pro | 2 ++ 1 file changed, 2 insertions(+) (limited to 'packaging/ios') diff --git a/packaging/ios/Subsurface-mobile.pro b/packaging/ios/Subsurface-mobile.pro index 322e2b9a2..68fc0ac4c 100644 --- a/packaging/ios/Subsurface-mobile.pro +++ b/packaging/ios/Subsurface-mobile.pro @@ -54,6 +54,7 @@ SOURCES += ../../subsurface-mobile-main.cpp \ ../../core/device.cpp \ ../../core/dive.c \ ../../core/divefilter.cpp \ + ../../core/filterconstraint.cpp \ ../../core/divelist.c \ ../../core/gas-model.c \ ../../core/gaspressures.c \ @@ -217,6 +218,7 @@ HEADERS += \ ../../core/deco.h \ ../../core/display.h \ ../../core/divefilter.h \ + ../../core/filterconstraint.h \ ../../core/divelist.h \ ../../core/divelogexportlogic.h \ ../../core/divesitehelpers.h \ -- cgit v1.2.3-70-g09d2