From 2353f5e7875a8cbbba9b90bf94a40abce7476f75 Mon Sep 17 00:00:00 2001 From: Ken Martin Date: Wed, 21 Aug 2002 15:37:49 -0400 Subject: minor fixes for new cache api --- Source/CursesDialog/cmCursesMainForm.cxx | 33 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index ab6a4b3..0d0c464 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -93,23 +93,19 @@ bool cmCursesMainForm::LookForCacheEntry(const char* key) // Create new cmCursesCacheEntryComposite entries from the cache void cmCursesMainForm::InitializeUI() { - - // Get the cache entries. - const cmCacheManager::CacheEntryMap &cache = - cmCacheManager::GetInstance()->GetCacheMap(); - // Create a vector of cmCursesCacheEntryComposite's // which contain labels, entries and new entry markers std::vector* newEntries = new std::vector; - newEntries->reserve(cache.size()); + newEntries->reserve(cmCacheManager::GetInstance()->GetSize()); // Count non-internal and non-static entries int count=0; - for(cmCacheManager::CacheEntryMap::const_iterator i = cache.begin(); - i != cache.end(); ++i) + for(cmCacheManager::CacheIterator i = + cmCacheManager::GetInstance()->NewIterator(); + !i.IsAtEnd(); i.Next()) { - const cmCacheManager::CacheEntry& value = i->second; + const cmCacheManager::CacheEntry& value = i.GetEntry(); if ( value.m_Type != cmCacheManager::INTERNAL && value.m_Type != cmCacheManager::STATIC ) { @@ -133,11 +129,12 @@ void cmCursesMainForm::InitializeUI() // Create the composites. // First add entries which are new - for(cmCacheManager::CacheEntryMap::const_iterator i = cache.begin(); - i != cache.end(); ++i) + for(cmCacheManager::CacheIterator i = + cmCacheManager::GetInstance()->NewIterator(); + !i.IsAtEnd(); i.Next()) { - const char* key = i->first.c_str(); - const cmCacheManager::CacheEntry& value = i->second; + const char* key = i.GetName(); + const cmCacheManager::CacheEntry& value = i.GetEntry(); if ( value.m_Type == cmCacheManager::INTERNAL || value.m_Type == cmCacheManager::STATIC ) { @@ -154,11 +151,12 @@ void cmCursesMainForm::InitializeUI() } // then add entries which are old - for(cmCacheManager::CacheEntryMap::const_iterator i = cache.begin(); - i != cache.end(); ++i) + for(cmCacheManager::CacheIterator i = + cmCacheManager::GetInstance()->NewIterator(); + !i.IsAtEnd(); i.Next()) { - const char* key = i->first.c_str(); - const cmCacheManager::CacheEntry& value = i->second; + const char* key = i.GetName(); + const cmCacheManager::CacheEntry& value = i.GetEntry(); if ( value.m_Type == cmCacheManager::INTERNAL || value.m_Type == cmCacheManager::STATIC ) { @@ -615,7 +613,6 @@ void cmCursesMainForm::FillCacheManagerFromUI() { std::string tmpString; - cmCacheManager::GetInstance()->GetCacheMap(); int size = m_Entries->size(); for(int i=0; i < size; i++) { -- cgit v0.12