Add signal testing of all variables
this commit contains all qPref* that work directly
followup commit will do changes to qPref* to make signals work
Signed-off-by: Jan Iversen <jani@apache.org>
QML is quite special, the variables needs to start with lower case in C++
and are used starting with upper case in QML
Signed-off-by: Jan Iversen <jani@apache.org>
In order to address the C++ object directy in qml, a different
registration is needed.
qmlRegisterType, registers the C++ class, allowing qml code to inherit
from it and make qml objects. This is needed for graphical elemnets
like profile and map
setContentProperty, registers the C++ object, thus allowing signals to be
catched.
Signed-off-by: Jan Iversen <jani@apache.org>
Instead of having all register calls in subsurface-helper.cpp let
qPref.cpp handle all qPref registration, since they also need to be
different
update subsurface-helper and testqml accordingly.
Signed-off-by: Jan Iversen <jani@apache.org>
It's a mamber of the cloud storage authentication class, used to hold the
proposed new password until the backend has accepted it.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The shadow variable causes properties only to be saved when
actual changed, therefore some test cases need update
Signed-off-by: Jan Iversen <jani@apache.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This requires the user to manually copy the large test file into the
dives directory (because I really don't want to add this to the repo);
instructions how to do that are displayed if the file is missing.
Next it uses the git version of that same file (but prefetches it to
try and remove the network speed from what is being measured).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
update testgitstorage.cpp to use qPrefProxy and qPrefCloudStorage
remove core/prefs-macros.h since it is unused
Signed-off-by: Jan Iversen <jani@apache.org>
Add class variable tooltip_position to qPrefDisplay
Add class variable lastDir to qPrefDisplay
qPrefDisplay is updated to use new qPrefPrivate functions
Adjust test cases incl. qml tests
qPrefAnimations only has 1 variable, that really is a display variable
Merge the variable into qPrefDisplay, to simplify setup (and avoid loading
extra page in qml).
correct theme to save in correct place, and make it a static
class variable
Signed-off-by: Jan Iversen <jani@apache.org>
To enable undo of divelog-importing it is crucial that parse_file()
can parse into arbitrary dive tables.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
make next_check (in qPrefUpdateManager) long instead of string
Correct test cases (compare time_t not strings)
Add test case to check time_t works as expected
Signed-off-by: Jan Iversen <jani@apache.org>
In a previous commit, the get_gasmix_* functions were changed to
return by value. For consistency, also pass gasmix by value.
Note that on common 64-bit platforms struct gasmix is the size
of a pointer [2 * 32 bit vs. 64 bit] and therefore uses the
same space on the stack. On 32-bit platforms, the stack use
is probably doubled, but in return a dereference is avoided.
Supporting arbitrary gas-mixes (H2, Ar, ...) will be such an
invasive change that going back to pointers is probably the
least of our worries.
This commit is a step in const-ifying input parameters (passing
by value is the ultimate way of signaling that the input parameter
will not be changed [unless there are references to said parameter]).
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
remove General from SettingsObjectWrapper and reference qPrefGeneral
update files using SettingsObjectWrapper/General to use qPrefGeneral
this activated qPrefGeneral and removed the similar class from
SettingsObjectWrapper.
Signed-off-by: Jan Iversen <jani@apache.org>
Remove PartialPressureGas test in testpreferences
add the same PartialPressureGas tests to testqPrefPartialPressureGas
Signed-off-by: Jan Iversen <jani@apache.org>
remove PartialPressureGas from SettingsObjectWrapper and reference qPrefPartialPressureGas
update files using SettingsObjectWrapper/PartialPressureGas to use qPrefPartialPressureGas
this activated qPrefPartialPressureGas and removed the similar class from
SettingsObjectWrapper.
Signed-off-by: Jan Iversen <jani@apache.org>
remove Geocoding from SettingsObjectWrapper and reference qPrefFacebook
update files using SettingsObjectWrapper/Geocoding to use qPrefFacebook
this activated qPrefGeocoding and removed the similar class from
SettingsObjectWrapper.
Signed-off-by: Jan Iversen <jani@apache.org>
remove Language from SettingsObjectWrapper and reference qPrefLanguage
update files using SettingsObjectWrapper/Language to use qPrefLanguage
this activated qPrefLanguage and removed the similar class from
SettingsObjectWrapper.
Signed-off-by: Jan Iversen <jani@apache.org>
Remove LocationService test in testpreferences
add the same LocationService tests to testqPrefLocationService
Signed-off-by: Jan Iversen <jani@apache.org>
remove LocationService from SettingsObjectWrapper and reference qPrefLocationService
update files using SettingsObjectWrapper/LocationService to use qPrefLocationService
this activated qPrefLocationService and removed the similar class from
SettingsObjectWrapper.
Signed-off-by: Jan Iversen <jani@apache.org>
Remove TechnicalDetails test in testpreferences
add the same TechnicalDetails tests to testqPrefTechnicalDetails
Signed-off-by: Jan Iversen <jani@apache.org>
remove TechnicalDetails from SettingsObjectWrapper and reference qPrefTechnicalDetails
update files using SettingsObjectWrapper/TechnicalDetails to use qPrefTechnicalDetails
this activated qPrefTechnicalDetails and removed the similar class from
SettingsObjectWrapper.
Signed-off-by: Jan Iversen <jani@apache.org>
remove buehlmann(), setBuehlmann(bool)
buehlmann() is really planner_deco_mode == BUEHLMANN, so no need for a function
setBuehlmann is dangerous, because buehlmann is saved on disk, but not in prefs.* and thus can lead to inconsistency between bool buehlmann and planner_deco_moce.
Signed-off-by: Jan Iversen <jani@apache.org>
remove UpdateManager from SettingsObjectWrapper and reference qPrefUpdateManager
update files using SettingsObjectWrapper/UpdateManager to use qPrefUpdateManager
this activated qPrefUpdateManager and removed the similar class from
SettingsObjectWrapper.
Signed-off-by: Jan Iversen <jani@apache.org>
remove DivePlanner from SettingsObjectWrapper and reference qPrefDivePlanner
update files using SettingsObjectWrapper/DivePlanner to use qPrefDivePlanner
this activated qPrefDivePlanner and removed the similar class from
SettingsObjectWrapper.
Signed-off-by: Jan Iversen <jani@apache.org>
remove Units from SettingsObjectWrapper and reference qPrefUnits
update files using SettingsObjectWrapper/Units to use qPrefUnits
this activated qPrefUnits and removed the similar class from
SettingsObjectWrapper.
Signed-off-by: Jan Iversen <jani@apache.org>
remove Proxy from SettingsObjectWrapper and reference qPrefProxy
update files using SettingsObjectWrapper/Proxy to use qPrefProxy
this activated qPrefProxy and removed the similar class from
SettingsObjectWrapper.
Signed-off-by: Jan Iversen <jani@apache.org>
remove Facebook from SettingsObjectWrapper and reference qPrefFacebook
update files using SettingsObjectWrapper/Facebook to use qPrefFacebook
this activated qPrefFacebook and removed the similar class from
SettingsObjectWrapper.
Signed-off-by: Jan Iversen <jani@apache.org>
remove DiveComputer from SettingsObjectWrapper and reference qPrefDiveComputer
update files using SettingsObjectWrapper/DiveComputer to use qPrefDiveComputer
this activated qPrefDiveComputer and removed the similar class from
SettingsObjectWrapper.
Signed-off-by: Jan Iversen <jani@apache.org>
remove CloudStorage from SettingsObjectWrapper and reference qPrefCloudStorage
update files using SettingsObjectWrapper/CloudStorage to use qPrefCloudStorage
this activated qPrefCloudStorage and removed the similar class from
SettingsObjectWrapper.
Signed-off-by: Jan Iversen <jani@apache.org>
remove include of QtTest in header, becaue it is not needed,
add include of QObject in header, so moc can generate code.
add QTest in cpp file, which replaces QtTest
Signed-off-by: Jan Iversen <jani@apache.org>
remove include of QtTest in header, becaue it is not needed,
add include of QObject in header, so moc can generate code.
add QTest in cpp file, which replaces QtTest
Change content of strings to test divelist_font to a not normal
font name, to ensure less confusion by readers. Remark the old
surrounding code accept illegal font names, but correcting this
is not covered in this commit.
Signed-off-by: Jan Iversen <jani@apache.org>
Files are listed in 2 places in CMakeLists.txt, update file to
secure qPrefAnimations and qPrefDisplay are listed correctly
Signed-off-by: Jan Iversen <jani@apache.org>
add test cases to secure struct preferences and qPrefAnimations work together
remove animation tests from testpreferences
Signed-off-by: Jan Iversen <jani@apache.org>
remove test macro, split in functions and add test cases
the existing test macro does not work because
sync() does not save these variables to disk (set* does)
Signed-off-by: Jan Iversen <jani@apache.org>
add the prepared class qPrefDisplay to SettingsObjectWrapper and thereby making it active.
As a consequence of the uniform naming standard desktop-widgets/preferences_defaults.cpp and
tests/testpreferences.cpp have been updated.
Signed-off-by: Jan Iversen <jani@apache.org>
add subsurface-helper.cpp to TestQML target
remove local qmlRegisterType() and add register_qml_types() instead
Signed-off-by: Jan Iversen <jani@apache.org>
With Qt 5.11 the qml compiler is included and qmlc files created in the same
directory as the qml file (at least for the qml test harness).
ignore *.qmlc
Signed-off-by: Jan Iversen <jani@apache.org>
In the last commits, the canonical-to-local filename map was made
independent from the image hashes and the location of moved images
was based on filename not hashes. The hashes are now in principle
unused (except for conversion of old-style local filename lookups).
Therefore, remove the hashes in this commit. This makes addition
of images distinctly faster.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
The connection canonical filename to local filename was done via
two maps:
1) canonical filename -> hash
2) hash -> local filename
But the local filename was always queried from the canonical filename.
Therefore, directly index the former with the latter.
On startup, convert the old map to the new one.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>