Changeset 5452 in ntrip for trunk/GnssCenter/main/settings.cpp


Ignore:
Timestamp:
Sep 14, 2013, 3:28:51 PM (11 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GnssCenter/main/settings.cpp

    r5001 r5452  
    7373                            const QVariant& defaultValue) const {
    7474  QMutexLocker locker(&_mutex);
    75 
    76   if (_app->_settings.contains(key)) {
    77     return _app->_settings[key];
     75  QString fullKey = _groupName.isEmpty() ? key : _groupName + '/' + key;
     76  if (_app->_settings.contains(fullKey)) {
     77    return _app->_settings[fullKey];
    7878  }
    7979  else {
     
    8686void t_settings::setValue(const QString &key, const QVariant& value) {
    8787  QMutexLocker locker(&_mutex);
    88   setValue_p(key, value);
    89 }
    90 
    91 //
    92 ////////////////////////////////////////////////////////////////////////////
    93 void t_settings::setValue_p(const QString &key, const QVariant& value) {
    94   _app->_settings[key] = value;
     88  QString fullKey = _groupName.isEmpty() ? key : _groupName + '/' + key;
     89  _app->_settings[fullKey] = value;
    9590}
    9691
     
    9994void t_settings::remove(const QString& key ) {
    10095  QMutexLocker locker(&_mutex);
    101   _app->_settings.remove(key);
     96  QString fullKey = _groupName.isEmpty() ? key : _groupName + '/' + key;
     97  _app->_settings.remove(fullKey);
    10298}
    10399
     
    115111  settings.sync();
    116112}
     113
     114//
     115////////////////////////////////////////////////////////////////////////////
     116void t_settings::beginGroup(const QString& groupName) {
     117  QMutexLocker locker(&_mutex);
     118  _groupName = groupName;
     119}
     120
     121//
     122////////////////////////////////////////////////////////////////////////////
     123void t_settings::endGroup() {
     124  QMutexLocker locker(&_mutex);
     125  _groupName.clear();
     126}
Note: See TracChangeset for help on using the changeset viewer.