diff options
author | Tushar Maheshwari <tushar27192@gmail.com> | 2019-09-08 05:52:38 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-09-26 15:10:20 (GMT) |
commit | 36875ff419240a5a60b1b13ff190a5824a8363a5 (patch) | |
tree | 8343cb3c3585b7f62af1cc46ca2666b36d88ca65 /Source/CursesDialog/cmCursesCacheEntryComposite.cxx | |
parent | 2b1607114985e56a7847eb6081d5656f73c230d0 (diff) | |
download | CMake-36875ff419240a5a60b1b13ff190a5824a8363a5.zip CMake-36875ff419240a5a60b1b13ff190a5824a8363a5.tar.gz CMake-36875ff419240a5a60b1b13ff190a5824a8363a5.tar.bz2 |
cmCursesMainForm: cleanup manual allocation
Diffstat (limited to 'Source/CursesDialog/cmCursesCacheEntryComposite.cxx')
-rw-r--r-- | Source/CursesDialog/cmCursesCacheEntryComposite.cxx | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx index 47fe84c..8b160a4 100644 --- a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx +++ b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx @@ -13,7 +13,6 @@ #include "cmStateTypes.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" -#include "cmake.h" #include <cassert> #include <vector> @@ -26,12 +25,11 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( { this->Label = new cmCursesLabelWidget(this->LabelWidth, 1, 1, 1, key); this->IsNewLabel = new cmCursesLabelWidget(1, 1, 1, 1, " "); - this->Entry = nullptr; this->Entry = new cmCursesStringWidget(this->EntryWidth, 1, 1, 1); } cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( - const std::string& key, cmake* cm, bool isNew, int labelwidth, + const std::string& key, cmState* state, bool isNew, int labelwidth, int entrywidth) : Key(key) , LabelWidth(labelwidth) @@ -45,9 +43,9 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( } this->Entry = nullptr; - const char* value = cm->GetState()->GetCacheEntryValue(key); + const char* value = state->GetCacheEntryValue(key); assert(value); - switch (cm->GetState()->GetCacheEntryType(key)) { + switch (state->GetCacheEntryType(key)) { case cmStateEnums::BOOL: this->Entry = new cmCursesBoolWidget(this->EntryWidth, 1, 1, 1); if (cmIsOn(value)) { @@ -65,8 +63,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( static_cast<cmCursesFilePathWidget*>(this->Entry)->SetString(value); break; case cmStateEnums::STRING: { - const char* stringsProp = - cm->GetState()->GetCacheEntryProperty(key, "STRINGS"); + const char* stringsProp = state->GetCacheEntryProperty(key, "STRINGS"); if (stringsProp) { cmCursesOptionsWidget* ow = new cmCursesOptionsWidget(this->EntryWidth, 1, 1, 1); |