Changeset 65690 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Feb 8, 2017 4:21:23 PM (8 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/settings
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDefs.h
r63315 r65690 63 63 /* Returns the NON-modifiable REFERENCE to the current cached data: */ 64 64 const CacheData& data() const { return m_value.second; } 65 /* Returns the modifiable REFERENCE to the current cached data: */ 66 CacheData &data() { return m_value.second; } 65 67 66 68 /* We assume that old cache item was removed if -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsExtension.cpp
r65682 r65690 263 263 void UIGlobalSettingsExtension::getFromCache() 264 264 { 265 /* Get old /newdata from cache: */266 m_data = m_cache.base();265 /* Get old data from cache: */ 266 const UIDataSettingsGlobalExtension &oldData = m_cache.base(); 267 267 268 268 /* Load old data from cache: */ 269 for (int i = 0; i < m_data.m_items.size(); ++i)270 new UIExtensionPackageItem(m_pPackagesTree, m_data.m_items[i]);269 for (int i = 0; i < oldData.m_items.size(); ++i) 270 new UIExtensionPackageItem(m_pPackagesTree, oldData.m_items.at(i)); 271 271 /* If at least one item present: */ 272 272 if (m_pPackagesTree->topLevelItemCount()) … … 378 378 { 379 379 /* Remove it from the cache. */ 380 for (int i = 0; i < m_data.m_items.size(); i++) 381 if (!strExtPackName.compare(m_data.m_items[i].m_strName, Qt::CaseInsensitive)) 380 for (int i = 0; i < m_cache.data().m_items.size(); ++i) 381 { 382 if (!strExtPackName.compare(m_cache.data().m_items.at(i).m_strName, Qt::CaseInsensitive)) 382 383 { 383 m_ data.m_items.removeAt(i);384 m_cache.data().m_items.removeAt(i); 384 385 break; 385 386 } 387 } 386 388 387 389 /* Remove it from the tree. */ … … 402 404 if (package.isOk()) 403 405 { 404 m_ data.m_items << fetchData(package);405 406 UIExtensionPackageItem *pItem = new UIExtensionPackageItem(m_pPackagesTree, m_ data.m_items.last());406 m_cache.data().m_items << fetchData(package); 407 408 UIExtensionPackageItem *pItem = new UIExtensionPackageItem(m_pPackagesTree, m_cache.data().m_items.last()); 407 409 m_pPackagesTree->setCurrentItem(pItem); 408 410 m_pPackagesTree->sortByColumn(1, Qt::AscendingOrder); … … 445 447 { 446 448 /* Remove selected package from cache: */ 447 for (int i = 0; i < m_ data.m_items.size(); ++i)449 for (int i = 0; i < m_cache.data().m_items.size(); ++i) 448 450 { 449 if (!strSelectedPackageName.compare(m_ data.m_items[i].m_strName, Qt::CaseInsensitive))451 if (!strSelectedPackageName.compare(m_cache.data().m_items.at(i).m_strName, Qt::CaseInsensitive)) 450 452 { 451 m_ data.m_items.removeAt(i);453 m_cache.data().m_items.removeAt(i); 452 454 break; 453 455 } -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsExtension.h
r65682 r65690 152 152 /* Cache: */ 153 153 UISettingsCacheGlobalExtension m_cache; 154 UIDataSettingsGlobalExtension m_data;155 154 }; 156 155
Note:
See TracChangeset
for help on using the changeset viewer.