diff options
author | Vitaly Stakhovsky <vvs31415@gitlab.org> | 2020-03-17 16:00:00 (GMT) |
---|---|---|
committer | Vitaly Stakhovsky <vvs31415@gitlab.org> | 2020-03-17 16:09:20 (GMT) |
commit | bd891335432a5797a0415ebf35a6f22adba96684 (patch) | |
tree | 9d142b17e1750641d311d9f7fe2f11a4b7a52913 /Source/CursesDialog | |
parent | bee0100396d4b0dad7204125606e6baf26b79e38 (diff) | |
download | CMake-bd891335432a5797a0415ebf35a6f22adba96684.zip CMake-bd891335432a5797a0415ebf35a6f22adba96684.tar.gz CMake-bd891335432a5797a0415ebf35a6f22adba96684.tar.bz2 |
cmState::GetCacheEntryValue: return cmProp
Diffstat (limited to 'Source/CursesDialog')
-rw-r--r-- | Source/CursesDialog/cmCursesCacheEntryComposite.cxx | 12 | ||||
-rw-r--r-- | Source/CursesDialog/cmCursesMainForm.cxx | 16 |
2 files changed, 14 insertions, 14 deletions
diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx index 4d3131b..9a0d966 100644 --- a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx +++ b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx @@ -48,25 +48,25 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( this->IsNewLabel = cm::make_unique<cmCursesLabelWidget>(1, 1, 1, 1, " "); } - const char* value = state->GetCacheEntryValue(key); + cmProp value = state->GetCacheEntryValue(key); assert(value); switch (state->GetCacheEntryType(key)) { case cmStateEnums::BOOL: { auto bw = cm::make_unique<cmCursesBoolWidget>(this->EntryWidth, 1, 1, 1); - bw->SetValueAsBool(cmIsOn(value)); + bw->SetValueAsBool(cmIsOn(*value)); this->Entry = std::move(bw); break; } case cmStateEnums::PATH: { auto pw = cm::make_unique<cmCursesPathWidget>(this->EntryWidth, 1, 1, 1); - pw->SetString(value); + pw->SetString(*value); this->Entry = std::move(pw); break; } case cmStateEnums::FILEPATH: { auto fpw = cm::make_unique<cmCursesFilePathWidget>(this->EntryWidth, 1, 1, 1); - fpw->SetString(value); + fpw->SetString(*value); this->Entry = std::move(fpw); break; } @@ -78,12 +78,12 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( for (std::string const& opt : cmExpandedList(stringsProp)) { ow->AddOption(opt); } - ow->SetOption(value); + ow->SetOption(*value); this->Entry = std::move(ow); } else { auto sw = cm::make_unique<cmCursesStringWidget>(this->EntryWidth, 1, 1, 1); - sw->SetString(value); + sw->SetString(*value); this->Entry = std::move(sw); } break; diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index 2c92835..9670595 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -161,7 +161,7 @@ void cmCursesMainForm::RePost() // If normal mode, count only non-advanced entries this->NumberOfVisibleEntries = 0; for (cmCursesCacheEntryComposite& entry : this->Entries) { - const char* existingValue = + cmProp existingValue = this->CMakeInstance->GetState()->GetCacheEntryValue(entry.GetValue()); bool advanced = this->CMakeInstance->GetState()->GetCacheEntryPropertyAsBool( @@ -182,7 +182,7 @@ void cmCursesMainForm::RePost() // Assign fields for (cmCursesCacheEntryComposite& entry : this->Entries) { - const char* existingValue = + cmProp existingValue = this->CMakeInstance->GetState()->GetCacheEntryValue(entry.GetValue()); bool advanced = this->CMakeInstance->GetState()->GetCacheEntryPropertyAsBool( @@ -241,7 +241,7 @@ void cmCursesMainForm::Render(int left, int top, int width, int height) // If normal, display only non-advanced entries this->NumberOfVisibleEntries = 0; for (cmCursesCacheEntryComposite& entry : this->Entries) { - const char* existingValue = + cmProp existingValue = this->CMakeInstance->GetState()->GetCacheEntryValue(entry.GetValue()); bool advanced = this->CMakeInstance->GetState()->GetCacheEntryPropertyAsBool( @@ -259,7 +259,7 @@ void cmCursesMainForm::Render(int left, int top, int width, int height) bool isNewPage; int i = 0; for (cmCursesCacheEntryComposite& entry : this->Entries) { - const char* existingValue = + cmProp existingValue = this->CMakeInstance->GetState()->GetCacheEntryValue(entry.GetValue()); bool advanced = this->CMakeInstance->GetState()->GetCacheEntryPropertyAsBool( @@ -405,7 +405,7 @@ void cmCursesMainForm::UpdateStatusBar(cm::optional<std::string> message) // Get the help string of the current entry // and add it to the help string auto cmakeState = this->CMakeInstance->GetState(); - const char* existingValue = cmakeState->GetCacheEntryValue(labelValue); + cmProp existingValue = cmakeState->GetCacheEntryValue(labelValue); if (existingValue) { auto help = cmakeState->GetCacheEntryProperty(labelValue, "HELPSTRING"); if (help) { @@ -616,10 +616,10 @@ void cmCursesMainForm::FillCacheManagerFromUI() { for (cmCursesCacheEntryComposite& entry : this->Entries) { const std::string& cacheKey = entry.Key; - const char* existingValue = + cmProp existingValue = this->CMakeInstance->GetState()->GetCacheEntryValue(cacheKey); if (existingValue) { - std::string oldValue = existingValue; + std::string oldValue = *existingValue; std::string newValue = entry.Entry->GetValue(); std::string fixedOldValue; std::string fixedNewValue; @@ -804,7 +804,7 @@ void cmCursesMainForm::HandleInput() const char* curField = lbl->GetValue(); const char* helpString = nullptr; - const char* existingValue = + cmProp existingValue = this->CMakeInstance->GetState()->GetCacheEntryValue(curField); if (existingValue) { helpString = this->CMakeInstance->GetState()->GetCacheEntryProperty( |