Changeset 5066 in ntrip for trunk/BNC/src/bncsettings.cpp
- Timestamp:
- Mar 30, 2013, 11:31:00 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/bncsettings.cpp
r5064 r5066 27 27 QMutexLocker locker(&_mutex); 28 28 29 #ifdef GNSSCENTER_PLUGIN30 _bncApp = 0;31 return;32 #else33 _bncApp = static_cast<bncApp*>(qApp);34 #endif35 36 29 // First fill the options 37 30 // ---------------------- 38 if ( _bncApp->_settings.size() == 0) {31 if (PGM_CORE->_settings.size() == 0) { 39 32 reRead(); 40 33 } … … 50 43 void bncSettings::reRead() { 51 44 52 _bncApp->_settings.clear();53 54 QSettings settings( _bncApp->confFileName(), QSettings::IniFormat);45 PGM_CORE->_settings.clear(); 46 47 QSettings settings(PGM_CORE->confFileName(), QSettings::IniFormat); 55 48 56 49 // Read from File … … 60 53 while (it.hasNext()) { 61 54 QString key = it.next(); 62 _bncApp->_settings[key] = settings.value(key);55 PGM_CORE->_settings[key] = settings.value(key); 63 56 } 64 57 } … … 225 218 QMutexLocker locker(&_mutex); 226 219 227 if ( _bncApp && _bncApp->_settings.contains(key)) {228 return _bncApp->_settings[key];220 if (PGM_CORE->_settings.contains(key)) { 221 return PGM_CORE->_settings[key]; 229 222 } 230 223 else { … … 243 236 //////////////////////////////////////////////////////////////////////////// 244 237 void bncSettings::setValue_p(const QString &key, const QVariant& value) { 245 _bncApp->_settings[key] = value;238 PGM_CORE->_settings[key] = value; 246 239 } 247 240 … … 250 243 void bncSettings::remove(const QString& key ) { 251 244 QMutexLocker locker(&_mutex); 252 _bncApp->_settings.remove(key);245 PGM_CORE->_settings.remove(key); 253 246 } 254 247 … … 257 250 void bncSettings::sync() { 258 251 QMutexLocker locker(&_mutex); 259 QSettings settings( _bncApp->confFileName(), QSettings::IniFormat);252 QSettings settings(PGM_CORE->confFileName(), QSettings::IniFormat); 260 253 settings.clear(); 261 QMapIterator<QString, QVariant> it( _bncApp->_settings);254 QMapIterator<QString, QVariant> it(PGM_CORE->_settings); 262 255 while (it.hasNext()) { 263 256 it.next();
Note:
See TracChangeset
for help on using the changeset viewer.