Index: sources/view/hd/data/VTreatmentRanges.cpp =================================================================== diff -u -r16a8f25568b4636ebc31e76c86a8031940cc4ad7 -r53ec19e12772f2a73190323438106dc93e4a12df --- sources/view/hd/data/VTreatmentRanges.cpp (.../VTreatmentRanges.cpp) (revision 16a8f25568b4636ebc31e76c86a8031940cc4ad7) +++ sources/view/hd/data/VTreatmentRanges.cpp (.../VTreatmentRanges.cpp) (revision 53ec19e12772f2a73190323438106dc93e4a12df) @@ -54,19 +54,44 @@ */ void View::VTreatmentRanges::doSaveAcidConcentrate (const QString &vOption) { - QString mCategory = ::Settings_Category_DataList; + QString mCategory = Storage::Settings_Category_DataList; _Settings.add(mCategory, "Acid Concentrate Options", vOption, - QVariant(), + QVariant("temp"), // set temp string to know to remove later false ); // update -// emit acidConcentrateOptionsChanged(); acidConcentrateOptions ( _Settings.keys(mCategory, "Acid Concentrate Options" )); } +/** + * \brief VTreatmentRanges::doClearAcidConcentrate + * \param vSet - Bool to only clear options list if combobox is active + * \details Clear any custum Acid Concentrate entered by user + */ +void View::VTreatmentRanges::doClearAcidConcentrate (const bool &vSet) +{ + if ( ! vSet ) { return; } + + QString mCategory = Storage::Settings_Category_DataList; + int size = _Settings.keys(mCategory, "Acid Concentrate Options" ).size(); + + for ( int i = size - 1; i >= 0; --i ) { + // remove any populated values. The original from .config are empty strings + if ( ! _Settings.values(mCategory, "Acid Concentrate Options" )[i].toString().isEmpty() ) { + _Settings.remove(mCategory, + "Acid Concentrate Options", + _Settings.keys(mCategory, "Acid Concentrate Options")[i], + _Settings.values(mCategory, "Acid Concentrate Options" )[i]); + } + } + + // update + acidConcentrateOptions ( _Settings.keys(mCategory, "Acid Concentrate Options" )); +} + /*! * \brief VTreatmentCreate::onSettingsDone * \details fills the items below, read from the settings file, when the reading is notified done by ApplicationController.