From a71afd31ee66edf45c8970dcbd6514d7c4b5e9f0 Mon Sep 17 00:00:00 2001 From: jan Iversen Date: Fri, 31 Aug 2018 11:57:28 +0200 Subject: core: add auto registration to qPref* 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 --- subsurface-helper.cpp | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) (limited to 'subsurface-helper.cpp') diff --git a/subsurface-helper.cpp b/subsurface-helper.cpp index 389d47cbf..38601ddf3 100644 --- a/subsurface-helper.cpp +++ b/subsurface-helper.cpp @@ -155,21 +155,11 @@ static void register_meta_types() void register_qml_types() { int rc; - REGISTER_TYPE(qPref, "SsrfPrefs"); - REGISTER_TYPE(qPrefCloudStorage, "SsrfCloudStoragePrefs"); - REGISTER_TYPE(qPrefDisplay, "SsrfDisplayPrefs"); - REGISTER_TYPE(qPrefDiveComputer, "SsrfDiveComputerPrefs"); - REGISTER_TYPE(qPrefDivePlanner, "SsrfDivePlannerPrefs"); - REGISTER_TYPE(qPrefFacebook, "SsrfFacebookPrefs"); - REGISTER_TYPE(qPrefGeneral, "SsrfGeneralPrefs"); - REGISTER_TYPE(qPrefGeocoding, "SsrfGeocodingPrefs"); - REGISTER_TYPE(qPrefLanguage, "SsrfLanguagePrefs"); - REGISTER_TYPE(qPrefLocationService, "SsrfLocationServicePrefs"); - REGISTER_TYPE(qPrefPartialPressureGas, "SsrfPartialPressureGasPrefs"); - REGISTER_TYPE(qPrefProxy, "SsrfProxyPrefs"); - REGISTER_TYPE(qPrefTechnicalDetails, "SsrfTechnicalDetailsPrefs"); - REGISTER_TYPE(qPrefUnits, "SsrfUnitPrefs"); - REGISTER_TYPE(qPrefUpdateManager, "SsrfUpdateManagerPrefs"); + + (void)rc; + + // register qPref* + qPref::instance()->registerQML(); #ifndef SUBSURFACE_TEST_DATA #ifdef SUBSURFACE_MOBILE -- cgit v1.2.3-70-g09d2