summaryrefslogtreecommitdiffstats
path: root/Source/QtDialog/QCMakeCacheView.cxx
diff options
context:
space:
mode:
authorClinton Stimpson <clinton@elemtech.com>2011-01-28 15:50:56 (GMT)
committerClinton Stimpson <clinton@elemtech.com>2011-01-28 15:50:56 (GMT)
commitb1f52b1fd8dd13d22138b7b9c0701e699dbeb43c (patch)
tree4e647f5084f6e11be645b957aa517cd5e1098c00 /Source/QtDialog/QCMakeCacheView.cxx
parent6744616fb2c6397893c5b41bb4473fa8d420a57b (diff)
downloadCMake-b1f52b1fd8dd13d22138b7b9c0701e699dbeb43c.zip
CMake-b1f52b1fd8dd13d22138b7b9c0701e699dbeb43c.tar.gz
CMake-b1f52b1fd8dd13d22138b7b9c0701e699dbeb43c.tar.bz2
Fix grouping bug where "Ungrouped Entries" showed up as a child.
Diffstat (limited to 'Source/QtDialog/QCMakeCacheView.cxx')
-rw-r--r--Source/QtDialog/QCMakeCacheView.cxx14
1 files changed, 10 insertions, 4 deletions
diff --git a/Source/QtDialog/QCMakeCacheView.cxx b/Source/QtDialog/QCMakeCacheView.cxx
index 562396d..72e9b24 100644
--- a/Source/QtDialog/QCMakeCacheView.cxx
+++ b/Source/QtDialog/QCMakeCacheView.cxx
@@ -293,6 +293,8 @@ void QCMakeCacheModel::setProperties(const QCMakePropertyList& props)
parentItems.append(new QStandardItem());
parentItems[0]->setData(QBrush(QColor(255,100,100)), Qt::BackgroundColorRole);
parentItems[1]->setData(QBrush(QColor(255,100,100)), Qt::BackgroundColorRole);
+ parentItems[0]->setData(1, GroupRole);
+ parentItems[1]->setData(1, GroupRole);
root->appendRow(parentItems);
int num = props2.size();
@@ -314,6 +316,7 @@ void QCMakeCacheModel::setProperties(const QCMakePropertyList& props)
QStandardItem* parentItem =
new QStandardItem(key.isEmpty() ? tr("Ungrouped Entries") : key);
root->appendRow(parentItem);
+ parentItem->setData(1, GroupRole);
int num = props2.size();
for(int i=0; i<num; i++)
@@ -478,10 +481,13 @@ QCMakePropertyList QCMakeCacheModel::properties() const
}
else
{
- // get data
- QCMakeProperty prop;
- this->getPropertyData(idx, prop);
- props.append(prop);
+ if(!data(idx, GroupRole).toInt())
+ {
+ // get data
+ QCMakeProperty prop;
+ this->getPropertyData(idx, prop);
+ props.append(prop);
+ }
// go to the next in the tree
while(!idxs.isEmpty() && !idxs.last().sibling(idxs.last().row()+1, 0).isValid())