[Cmake-commits] [cmake-commits] clinton committed QCMakeCacheView.cxx 1.29 1.30
cmake-commits at cmake.org
cmake-commits at cmake.org
Tue Jun 10 18:53:27 EDT 2008
Update of /cvsroot/CMake/CMake/Source/QtDialog
In directory public:/mounts/ram/cvs-serv13700
Modified Files:
QCMakeCacheView.cxx
Log Message:
ENH: group together items with no prefix and items that won't be
grouped with others.
Index: QCMakeCacheView.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/QtDialog/QCMakeCacheView.cxx,v
retrieving revision 1.29
retrieving revision 1.30
diff -C 2 -d -r1.29 -r1.30
*** QCMakeCacheView.cxx 10 Jun 2008 04:17:00 -0000 1.29
--- QCMakeCacheView.cxx 10 Jun 2008 22:53:22 -0000 1.30
***************
*** 212,215 ****
--- 212,219 ----
{
QString prefix = s.section('_', 0, 0);
+ if(prefix == s)
+ {
+ prefix = QString();
+ }
return prefix;
}
***************
*** 218,232 ****
QMap<QString, QCMakePropertyList>& result)
{
// return a map of properties grouped by prefixes, and sorted
foreach(QCMakeProperty p, props)
{
QString prefix = QCMakeCacheModel::prefix(p.Key);
! result[prefix].append(p);
}
QMap<QString, QCMakePropertyList>::iterator iter;
! for(iter = result.begin(); iter != result.end(); ++iter)
{
! qSort(*iter);
}
}
--- 222,253 ----
QMap<QString, QCMakePropertyList>& result)
{
+ QMap<QString, QCMakePropertyList> tmp;
// return a map of properties grouped by prefixes, and sorted
foreach(QCMakeProperty p, props)
{
QString prefix = QCMakeCacheModel::prefix(p.Key);
! tmp[prefix].append(p);
}
+ // sort it and re-org any properties with only one sub item
+ QCMakePropertyList reorgProps;
QMap<QString, QCMakePropertyList>::iterator iter;
! for(iter = tmp.begin(); iter != tmp.end();)
{
! if(iter->count() == 1)
! {
! reorgProps.append((*iter)[0]);
! iter = tmp.erase(iter);
! }
! else
! {
! qSort(*iter);
! ++iter;
! }
! }
! if(reorgProps.count())
! {
! tmp[QCMakeCacheModel::prefix("NOPREFIX")] += reorgProps;
}
+ result = tmp;
}
More information about the Cmake-commits
mailing list