diff options
author | Clinton Stimpson <clinton@elemtech.com> | 2007-11-08 15:17:37 (GMT) |
---|---|---|
committer | Clinton Stimpson <clinton@elemtech.com> | 2007-11-08 15:17:37 (GMT) |
commit | 9f676df3c6daddc0d6d2d8d2907b2ce707ceebaf (patch) | |
tree | 5409c6b3d32eca167ddfe312cb3a9c1df02b7215 /Source/QtDialog/QCMake.cxx | |
parent | e3572607f4097fbc07bebbfbfe333adc16e43195 (diff) | |
download | CMake-9f676df3c6daddc0d6d2d8d2907b2ce707ceebaf.zip CMake-9f676df3c6daddc0d6d2d8d2907b2ce707ceebaf.tar.gz CMake-9f676df3c6daddc0d6d2d8d2907b2ce707ceebaf.tar.bz2 |
ENH: add context menu for deleting, ignoring, and getting help for cache entries.
ENH: add delete cache button
ENH: add information string above configure/generate buttons
ENH: change search to search both columns, and from regex to plain string search
ENH: add buddy info in cache entry view, so double clicking in the left column
starts editing the associated value.
BUG: fix file path editor so it goes away when focus is lost
Diffstat (limited to 'Source/QtDialog/QCMake.cxx')
-rw-r--r-- | Source/QtDialog/QCMake.cxx | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx index 0621aaf..bfa5af9 100644 --- a/Source/QtDialog/QCMake.cxx +++ b/Source/QtDialog/QCMake.cxx @@ -150,22 +150,45 @@ void QCMake::generate() void QCMake::setProperties(const QCMakeCachePropertyList& props) { + QStringList toremove; cmCacheManager *cachem = this->CMakeInstance->GetCacheManager(); - cmCacheManager::CacheIterator it = cachem->NewIterator(); - foreach(QCMakeCacheProperty prop, props) + for(cmCacheManager::CacheIterator i = cachem->NewIterator(); + !i.IsAtEnd(); i.Next()) { - if ( it.Find(prop.Key.toAscii().data()) ) + + if(i.GetType() == cmCacheManager::INTERNAL || + i.GetType() == cmCacheManager::STATIC) + { + continue; + } + + QCMakeCacheProperty prop; + prop.Key = i.GetName(); + int idx = props.indexOf(prop); + if(idx == -1) { + toremove.append(i.GetName()); + } + else + { + prop = props[idx]; if(prop.Value.type() == QVariant::Bool) { - it.SetValue(prop.Value.toBool() ? "ON" : "OFF"); + i.SetValue(prop.Value.toBool() ? "ON" : "OFF"); } else { - it.SetValue(prop.Value.toString().toAscii().data()); + i.SetValue(prop.Value.toString().toAscii().data()); } } + } + + foreach(QString s, toremove) + { + cachem->RemoveCacheEntry(s.toAscii().data()); + } + cachem->SaveCache(this->BinaryDirectory.toAscii().data()); } |