diff options
Diffstat (limited to 'Source/CursesDialog/cmCursesCacheEntryComposite.cxx')
-rw-r--r-- | Source/CursesDialog/cmCursesCacheEntryComposite.cxx | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx index 4f028c4..682f95f 100644 --- a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx +++ b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx @@ -18,9 +18,6 @@ #include "cmCursesFilePathWidget.h" #include "cmCursesDummyWidget.h" #include "../cmSystemTools.h" -#include "../cmake.h" - -#include <assert.h> cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( const std::string& key, @@ -35,7 +32,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( } cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( - const std::string& key, cmake *cm, bool isNew, + const std::string& key, const cmCacheManager::CacheIterator& it, bool isNew, int labelwidth, int entrywidth) : Key(key), LabelWidth(labelwidth), EntryWidth(entrywidth) { @@ -50,13 +47,11 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( } this->Entry = 0; - const char* value = cm->GetCacheManager()->GetCacheEntryValue(key); - assert(value); - switch (cm->GetCacheManager()->GetCacheEntryType(key)) + switch ( it.GetType() ) { - case cmCacheManager::BOOL: + case cmCacheManager::BOOL: this->Entry = new cmCursesBoolWidget(this->EntryWidth, 1, 1, 1); - if (cmSystemTools::IsOn(value)) + if (cmSystemTools::IsOn(it.GetValue().c_str())) { static_cast<cmCursesBoolWidget*>(this->Entry)->SetValueAsBool(true); } @@ -67,40 +62,40 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( break; case cmCacheManager::PATH: this->Entry = new cmCursesPathWidget(this->EntryWidth, 1, 1, 1); - static_cast<cmCursesPathWidget*>(this->Entry)->SetString(value); + static_cast<cmCursesPathWidget*>(this->Entry)->SetString( + it.GetValue()); break; case cmCacheManager::FILEPATH: this->Entry = new cmCursesFilePathWidget(this->EntryWidth, 1, 1, 1); - static_cast<cmCursesFilePathWidget*>(this->Entry)->SetString(value); + static_cast<cmCursesFilePathWidget*>(this->Entry)->SetString( + it.GetValue()); break; case cmCacheManager::STRING: - { - const char* stringsProp = cm->GetCacheManager() - ->GetCacheEntryProperty(key, "STRINGS"); - if(stringsProp) + if(it.PropertyExists("STRINGS")) { cmCursesOptionsWidget* ow = new cmCursesOptionsWidget(this->EntryWidth, 1, 1, 1); this->Entry = ow; std::vector<std::string> options; - cmSystemTools::ExpandListArgument(stringsProp, options); + cmSystemTools::ExpandListArgument( + std::string(it.GetProperty("STRINGS")), options); for(std::vector<std::string>::iterator si = options.begin(); si != options.end(); ++si) { ow->AddOption(*si); } - ow->SetOption(value); + ow->SetOption(it.GetValue()); } else { this->Entry = new cmCursesStringWidget(this->EntryWidth, 1, 1, 1); - static_cast<cmCursesStringWidget*>(this->Entry)->SetString(value); + static_cast<cmCursesStringWidget*>(this->Entry)->SetString( + it.GetValue()); } break; - } case cmCacheManager::UNINITIALIZED: cmSystemTools::Error("Found an undefined variable: ", - key.c_str()); + it.GetName().c_str()); break; default: // TODO : put warning message here |