Index: sources/model/settings/MSettings.cpp =================================================================== diff -u -r6f2622be80fcaee8d71baf78404627381157970c -r35db01154f90ebfdb6174033a66f5c20af82e14d --- sources/model/settings/MSettings.cpp (.../MSettings.cpp) (revision 6f2622be80fcaee8d71baf78404627381157970c) +++ sources/model/settings/MSettings.cpp (.../MSettings.cpp) (revision 35db01154f90ebfdb6174033a66f5c20af82e14d) @@ -136,21 +136,26 @@ * \param vLocation - the location of the setting data if is different will be set. * \param vLocation - the category of the setting data which by default is the base location if has extra folder + filename. */ -void MSettings::add(const QString &vGroup, const QString &vKey, const QVariant &vValue, const QString &vLocation, const QString &vCategory) +void MSettings::add(const QString &vGroup, const QString &vKey, const QVariant &vValue, const QString &vLocation, const QString &vCategory, bool vEnableDuplicateKeys) { QMutexLocker locker(&_mutex); if ( ! _category[vCategory].contains(vGroup) ) _category[vCategory] += vGroup; KeyValue mGroup = _settings[vGroup]; if ( mGroup.location != vLocation ) mGroup.location = vLocation; if ( mGroup.category != vCategory ) mGroup.category = vCategory; - if ( mGroup.keys.contains(vKey)) { - int index = mGroup.keys.indexOf(vKey); - mGroup.values[index] = vValue; - } - else { + if ( vEnableDuplicateKeys ) { mGroup.keys += vKey ; mGroup.values += vValue ; + } else { + if ( mGroup.keys.contains(vKey)) { + int index = mGroup.keys.indexOf(vKey); + mGroup.values[index] = vValue; + } + else { + mGroup.keys += vKey ; + mGroup.values += vValue ; + } } _settings[vGroup] = mGroup; }