MCPcopy Create free account
hub / github.com/Kitware/CMake / FillCacheManagerFromUI

Method FillCacheManagerFromUI

Source/CursesDialog/cmCursesMainForm.cxx:623–648  ·  view source on GitHub ↗

copy from the list box to the cache manager

Source from the content-addressed store, hash-verified

621
622// copy from the list box to the cache manager
623void cmCursesMainForm::FillCacheManagerFromUI()
624{
625 for (cmCursesCacheEntryComposite& entry : this->Entries) {
626 std::string const& cacheKey = entry.Key;
627 cmValue existingValue =
628 this->CMakeInstance->GetState()->GetCacheEntryValue(cacheKey);
629 if (existingValue) {
630 std::string const& oldValue = *existingValue;
631 std::string newValue = entry.Entry->GetValue();
632 std::string fixedOldValue;
633 std::string fixedNewValue;
634 cmStateEnums::CacheEntryType t =
635 this->CMakeInstance->GetState()->GetCacheEntryType(cacheKey);
636 this->FixValue(t, oldValue, fixedOldValue);
637 this->FixValue(t, newValue, fixedNewValue);
638
639 if (!(fixedOldValue == fixedNewValue)) {
640 // The user has changed the value. Mark it as modified.
641 this->CMakeInstance->GetState()->SetCacheEntryBoolProperty(
642 cacheKey, "MODIFIED", true);
643 this->CMakeInstance->GetState()->SetCacheEntryValue(cacheKey,
644 fixedNewValue);
645 }
646 }
647 }
648}
649
650void cmCursesMainForm::FixValue(cmStateEnums::CacheEntryType type,
651 std::string const& in, std::string& out) const

Callers 1

WriteMethod · 0.95

Calls 7

FixValueMethod · 0.95
GetCacheEntryValueMethod · 0.45
GetStateMethod · 0.45
GetValueMethod · 0.45
GetCacheEntryTypeMethod · 0.45
SetCacheEntryValueMethod · 0.45

Tested by

no test coverage detected