copy from the list box to the cache manager
| 621 | |
| 622 | // copy from the list box to the cache manager |
| 623 | void 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 | |
| 650 | void cmCursesMainForm::FixValue(cmStateEnums::CacheEntryType type, |
| 651 | std::string const& in, std::string& out) const |
no test coverage detected