summaryrefslogtreecommitdiffstats
path: root/mappingtreemodel.cpp
diff options
context:
space:
mode:
authorArno <am@disconnect.de>2012-11-17 06:35:40 +0100
committerArno <am@disconnect.de>2012-11-17 06:35:40 +0100
commitc01144b29afc0879ebff89704b10095696721930 (patch)
treed01d833e5cfb1ef5c8ae555623ea53ee883f2b80 /mappingtreemodel.cpp
parent2defc44300bd18917e6e5e2327ebb72f951ff7b1 (diff)
downloadSheMov-c01144b29afc0879ebff89704b10095696721930.tar.gz
SheMov-c01144b29afc0879ebff89704b10095696721930.tar.bz2
SheMov-c01144b29afc0879ebff89704b10095696721930.zip
Yet another MappingTreeModel fix
Forgot to fix/rename MappingTreeResultModel... Adding pictures works again :)
Diffstat (limited to 'mappingtreemodel.cpp')
-rw-r--r--mappingtreemodel.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/mappingtreemodel.cpp b/mappingtreemodel.cpp
index cf8bfc0..eed7d51 100644
--- a/mappingtreemodel.cpp
+++ b/mappingtreemodel.cpp
@@ -488,8 +488,8 @@ bool MappingTreeResultModel::setData(const QModelIndex &index, const QVariant &v
item->setData(ParentId, value);
return true;
}
- if(role == MyIdRole){
- item->setData(MyId, value);
+ if(role == DescIdRole){
+ item->setData(DescId, value);
return true;
}
return SmTreeModel::setData(index, value, role);
@@ -509,20 +509,20 @@ void MappingTreeResultModel::addItem(const MappingData &data){
//insert child
int mappingId = -1;
int parentId = -1;
- int myId = -1;
+ int descId = -1;
if(i == p.count() - 1){
mappingId = data.mappingId;
parentId = data.parentId;
- myId = data.descId;
+ descId = data.descId;
}
- QModelIndex curIdx = insertChild(p.at(i), mappingId, parentId, myId, curItem);
+ QModelIndex curIdx = insertChild(p.at(i), mappingId, parentId, descId, curItem);
curItem = itemAt(curIdx);
}
}
}
}
-QModelIndex MappingTreeResultModel::insertChild(const QVariant &data, int mappingId, int parentId, int myId, SmTreeItem *parent){
+QModelIndex MappingTreeResultModel::insertChild(const QVariant &data, int mappingId, int parentId, int descId, SmTreeItem *parent){
QModelIndex parentIdx;
int row = parent->childCount();
if(parent != root()){
@@ -537,7 +537,7 @@ QModelIndex MappingTreeResultModel::insertChild(const QVariant &data, int mappin
QModelIndex newIdx = index(row, 0, parentIdx);
setData(newIdx, data, NameRole);
setData(newIdx, mappingId, MappingIdRole);
- setData(newIdx, myId, MyIdRole);
+ setData(newIdx, descId, DescIdRole);
setData(newIdx, parentId, ParentIdRole);
return newIdx;
}