Index: sources/model/settings/MSettings.cpp =================================================================== diff -u -r27cc308ff5113a9386899d3c8f8b29962a8498e1 -r5605f930ab5cd1a62b96347f4b4300ef30a830ee --- sources/model/settings/MSettings.cpp (.../MSettings.cpp) (revision 27cc308ff5113a9386899d3c8f8b29962a8498e1) +++ sources/model/settings/MSettings.cpp (.../MSettings.cpp) (revision 5605f930ab5cd1a62b96347f4b4300ef30a830ee) @@ -77,6 +77,22 @@ } /*! + * \brief MSettings::value + * \details returns value of a key for the given group + * \param vGroup - the group to look for the value + * \param vKey - the key to look for the value + * \return the values in QString for the group vGroup + */ +QVariant MSettings::value(const QString &vGroup, const QString &vKey) +{ + QMutexLocker locker(&_mutex); + int index = _settings[vGroup].keys.indexOf(vKey); + if ( index >= 0 ) + return _settings[vGroup].values.at(index); + return QVariant(); +} + +/*! * \brief MSettings::location * \details The locations where the settings have been read for the group vGroup * \param vGroup - the group to look for the location @@ -132,3 +148,18 @@ mGroup.values += vValue ; _settings[vGroup] = mGroup; } + +/********** The common helper functions **********/ + +/*! + * \brief Settings::getDatetimeFormat + * \details Get the date time format + * \return The String output of the data/time format. + */ +void MSettings::datetimeFormat() +{ + QVariant dateFotmat = _Settings.value("DateTime", "Date Format"); + QVariant timeFotmat = _Settings.value("DateTime", "Time Format"); + if (dateFotmat.isValid() && timeFotmat.isValid()) + _datetimeFormat = dateFotmat.toString() + " " + timeFotmat.toString(); +}