| 700 | } |
| 701 | |
| 702 | void QCMakeCacheModelDelegate::recordChange(QAbstractItemModel* model, |
| 703 | QModelIndex const& index) |
| 704 | { |
| 705 | QModelIndex idx = index; |
| 706 | QAbstractItemModel* mymodel = model; |
| 707 | while (qobject_cast<QAbstractProxyModel*>(mymodel)) { |
| 708 | idx = static_cast<QAbstractProxyModel*>(mymodel)->mapToSource(idx); |
| 709 | mymodel = static_cast<QAbstractProxyModel*>(mymodel)->sourceModel(); |
| 710 | } |
| 711 | QCMakeCacheModel* cache_model = qobject_cast<QCMakeCacheModel*>(mymodel); |
| 712 | if (cache_model && idx.isValid()) { |
| 713 | QCMakeProperty prop; |
| 714 | idx = idx.sibling(idx.row(), 0); |
| 715 | cache_model->getPropertyData(idx, prop); |
| 716 | |
| 717 | // clean out an old one |
| 718 | QSet<QCMakeProperty>::iterator iter = mChanges.find(prop); |
| 719 | if (iter != mChanges.end()) { |
| 720 | mChanges.erase(iter); |
| 721 | } |
| 722 | // now add the new item |
| 723 | mChanges.insert(prop); |
| 724 | } |
| 725 | } |
no test coverage detected