summaryrefslogtreecommitdiffstats
path: root/Source/QtDialog/QCMakeCacheView.cxx
diff options
context:
space:
mode:
authorClinton Stimpson <clinton@elemtech.com>2007-11-03 23:48:59 (GMT)
committerClinton Stimpson <clinton@elemtech.com>2007-11-03 23:48:59 (GMT)
commit8770969464008b9f1ceb04bb7ea5784cd2000a9f (patch)
treee9456eb4d045fbff8ba4a5f6774a9a6bae532ee4 /Source/QtDialog/QCMakeCacheView.cxx
parent3135561227dc7ee9980e5badc1fae1e86e672a44 (diff)
downloadCMake-8770969464008b9f1ceb04bb7ea5784cd2000a9f.zip
CMake-8770969464008b9f1ceb04bb7ea5784cd2000a9f.tar.gz
CMake-8770969464008b9f1ceb04bb7ea5784cd2000a9f.tar.bz2
ENH: Allow working with empty build directories.
Make output window a bit smaller compared to cache view. Prompt on X'ing window as well as hitting cancel. Color new cache values red, and put them first.
Diffstat (limited to 'Source/QtDialog/QCMakeCacheView.cxx')
-rw-r--r--Source/QtDialog/QCMakeCacheView.cxx27
1 files changed, 25 insertions, 2 deletions
diff --git a/Source/QtDialog/QCMakeCacheView.cxx b/Source/QtDialog/QCMakeCacheView.cxx
index e14b322..4003c2f 100644
--- a/Source/QtDialog/QCMakeCacheView.cxx
+++ b/Source/QtDialog/QCMakeCacheView.cxx
@@ -88,7 +88,7 @@ QModelIndex QCMakeCacheView::moveCursor(CursorAction act,
}
QCMakeCacheModel::QCMakeCacheModel(QObject* p)
- : QAbstractTableModel(p), IsDirty(false)
+ : QAbstractTableModel(p), NewCount(0), IsDirty(false)
{
}
@@ -101,9 +101,28 @@ bool QCMakeCacheModel::isDirty() const
return this->IsDirty;
}
+static uint qHash(const QCMakeCacheProperty& p)
+{
+ return qHash(p.Key);
+}
+
void QCMakeCacheModel::setProperties(const QCMakeCachePropertyList& props)
{
- this->Properties = props;
+ QSet<QCMakeCacheProperty> newProps = props.toSet();
+ QSet<QCMakeCacheProperty> oldProps = this->Properties.toSet();
+
+ oldProps.intersect(newProps);
+ newProps.subtract(oldProps);
+
+ this->NewCount = newProps.count();
+ this->Properties.clear();
+
+ this->Properties = newProps.toList();
+ qSort(this->Properties);
+ QCMakeCachePropertyList tmp = oldProps.toList();
+ qSort(tmp);
+ this->Properties += tmp;
+
this->reset();
this->IsDirty = false;
}
@@ -155,6 +174,10 @@ QVariant QCMakeCacheModel::data (const QModelIndex& index, int role) const
{
return this->Properties[index.row()].Advanced;
}
+ else if(role == Qt::BackgroundRole && index.row()+1 <= this->NewCount)
+ {
+ return QBrush(QColor(255,100,100));
+ }
return QVariant();
}