Index: sources/view/settings/VSettings.cpp =================================================================== diff -u -r627b97843f87f5ca8fbd731c6c4a6d9fae4352ce -r6f2622be80fcaee8d71baf78404627381157970c --- sources/view/settings/VSettings.cpp (.../VSettings.cpp) (revision 627b97843f87f5ca8fbd731c6c4a6d9fae4352ce) +++ sources/view/settings/VSettings.cpp (.../VSettings.cpp) (revision 6f2622be80fcaee8d71baf78404627381157970c) @@ -49,66 +49,67 @@ { // TODO: this function needs to be moved to the controller, to execute in settings thread not the main thread. // it should then send the output here to update the specific properties defined. - QVariantMap mSettings; - QVariantMap mData; + QVariantMap mInstructions; QStringList mCategorys = _Settings.categorys(); for (const auto &category : mCategorys) { QStringList groups = _Settings.groups(category); for (const auto &group : groups) { - QVariantMap details; QStringList keys = _Settings.keys (group); QVariantList values = _Settings.values (group); - QString location = _Settings.location (group); - // DEBUG : - // qDebug() << " ##### " - // << group - // << keys - // << values - // << location ; - details["location"] = location; - details["keys" ] = keys ; - details["values" ] = values ; + if ( Storage::Settings::isCategoryInstructions( category ) ) { + // DEBUG : + // qDebug() << " ##### " + // << group + // << keys + // << values + // << location ; + QVariantMap details; + QString location = _Settings.location (group); + details["location"] = location; + details["keys" ] = keys ; + details["values" ] = values ; - mSettings[group] = details; - for (const auto &key : keys) { - QVariantMap keyValue; - if ( isservicePass (category, group, key) ) { - QString mServicePass; - mServicePass = _Settings.value(group, key).toString (); - keyValue[key] = mServicePass ; - servicePass ( mServicePass); + mInstructions[group] = details; + } + else { //TODO: Since it is global system settings, move this to the settings controller so the C++ backend can also use it. like Date/Time formats. + for (const auto &key : keys) { + QVariantMap keyValue; + if ( isservicePass (category, group, key) ) { + QString mServicePass; + mServicePass = _Settings.value(group, key).toString (); + keyValue[key] = mServicePass ; + servicePass ( mServicePass); + } + else if ( isalarmVolume (category, group, key) ) { + quint8 mAlarmVolume; + mAlarmVolume = _Settings.value(group, key).toInt (); // returns 0 if fails, so no error checking needed. + keyValue[key] = mAlarmVolume ; + alarmVolume ( mAlarmVolume); + } + else if ( isnoCANBus (category, group, key) ) { + bool mNoCANBus; + mNoCANBus = _Settings.value(group, key).toBool (); // returns 0/false if fails, so no error checking needed. + keyValue[key] = mNoCANBus ; + noCANBus ( mNoCANBus); + } + else { + keyValue[key] = _Settings.value(group, key); + } + QVariantMap groups; + groups [group] = keyValue; } - else if ( isalarmVolume (category, group, key) ) { - quint8 mAlarmVolume; - mAlarmVolume = _Settings.value(group, key).toInt (); // returns 0 if fails, so no error checking needed. - keyValue[key] = mAlarmVolume ; - alarmVolume ( mAlarmVolume); - } - else if ( isnoCANBus (category, group, key) ) { - bool mNoCANBus; - mNoCANBus = _Settings.value(group, key).toBool (); // returns 0/false if fails, so no error checking needed. - keyValue[key] = mNoCANBus ; - noCANBus ( mNoCANBus); - } - else { - keyValue[key] = _Settings.value(group, key); - } - QVariantMap groups; - groups [group] = keyValue; - mData [category] = groups; } } } - categorys(mCategorys); - settings(mSettings); - data(mData); + categorys (mCategorys); + instructions(mInstructions); // If the configuration exits, then it has been set, and this call internally will be neutral, // otherwise will use the default value and will notify the update. - servicePass( _servicePass ); - alarmVolume( _alarmVolume ); - // noCANBus ( _noCANBus ); // This line has been put here to remind developers that it is intentionally removed, to not to add a default value. + servicePass ( _servicePass ); + alarmVolume ( _alarmVolume ); + // noCANBus ( _noCANBus ); // This line has been put here to remind developers that it is intentionally removed, to not to add a default value. adjustment(true); }