forked from qt-creator/qt-creator
CMake: Hide INTERNAL and STATIC configuration entries in Project UI
Task-number: QTCREATORBUG-18403 Change-Id: I6b69305ff0dc337da1d8b20e0321be5ce1b1f595 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -280,7 +280,9 @@ QList<ConfigModel::DataItem> CMakeBuildConfiguration::completeCMakeConfiguration
|
|||||||
j.values = i.values;
|
j.values = i.values;
|
||||||
j.inCMakeCache = i.inCMakeCache;
|
j.inCMakeCache = i.inCMakeCache;
|
||||||
|
|
||||||
j.isAdvanced = i.isAdvanced || i.type == CMakeConfigItem::INTERNAL;
|
j.isAdvanced = i.isAdvanced;
|
||||||
|
j.isHidden = i.type == CMakeConfigItem::INTERNAL || i.type == CMakeConfigItem::STATIC;
|
||||||
|
|
||||||
switch (i.type) {
|
switch (i.type) {
|
||||||
case CMakeConfigItem::FILEPATH:
|
case CMakeConfigItem::FILEPATH:
|
||||||
j.type = ConfigModel::DataItem::FILE;
|
j.type = ConfigModel::DataItem::FILE;
|
||||||
|
|||||||
@@ -257,7 +257,9 @@ void ConfigModel::setConfiguration(const QList<ConfigModel::DataItem> &config)
|
|||||||
|
|
||||||
QList<InternalDataItem> result;
|
QList<InternalDataItem> result;
|
||||||
while (newIt != newEndIt && oldIt != oldEndIt) {
|
while (newIt != newEndIt && oldIt != oldEndIt) {
|
||||||
if (newIt->key < oldIt->key) {
|
if (newIt->isHidden) {
|
||||||
|
++newIt;
|
||||||
|
} else if (newIt->key < oldIt->key) {
|
||||||
// Add new entry:
|
// Add new entry:
|
||||||
result << InternalDataItem(*newIt);
|
result << InternalDataItem(*newIt);
|
||||||
++newIt;
|
++newIt;
|
||||||
@@ -279,8 +281,11 @@ void ConfigModel::setConfiguration(const QList<ConfigModel::DataItem> &config)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add remaining new entries:
|
// Add remaining new entries:
|
||||||
for (; newIt != newEndIt; ++newIt)
|
for (; newIt != newEndIt; ++newIt) {
|
||||||
|
if (newIt->isHidden)
|
||||||
|
continue;
|
||||||
result << InternalDataItem(*newIt);
|
result << InternalDataItem(*newIt);
|
||||||
|
}
|
||||||
|
|
||||||
beginResetModel();
|
beginResetModel();
|
||||||
m_configuration = result;
|
m_configuration = result;
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ public:
|
|||||||
|
|
||||||
QString key;
|
QString key;
|
||||||
Type type = STRING;
|
Type type = STRING;
|
||||||
|
bool isHidden = false;
|
||||||
bool isAdvanced = false;
|
bool isAdvanced = false;
|
||||||
bool inCMakeCache = false;
|
bool inCMakeCache = false;
|
||||||
QString value;
|
QString value;
|
||||||
|
|||||||
Reference in New Issue
Block a user