summaryrefslogtreecommitdiffstats
path: root/mappingtreemodel.cpp
diff options
context:
space:
mode:
authorArno <am@disconnect.de>2014-06-19 11:23:57 +0200
committerArno <am@disconnect.de>2014-06-19 11:23:57 +0200
commitb5bd9cf0b981ee0c87ead9e20c36247932de7818 (patch)
tree4eea2c01ed4b1ced3a387cb4fad13c774137e758 /mappingtreemodel.cpp
parent7ba8c197150a86c2406a029e4a7f02d1285c47c0 (diff)
downloadSheMov-b5bd9cf0b981ee0c87ead9e20c36247932de7818.tar.gz
SheMov-b5bd9cf0b981ee0c87ead9e20c36247932de7818.tar.bz2
SheMov-b5bd9cf0b981ee0c87ead9e20c36247932de7818.zip
Fix Display of mappings
MappingTreeModel::treeFromPath() never worked as intended, so replace it by displaying mappings in a QTextTable.
Diffstat (limited to 'mappingtreemodel.cpp')
-rw-r--r--mappingtreemodel.cpp31
1 files changed, 0 insertions, 31 deletions
diff --git a/mappingtreemodel.cpp b/mappingtreemodel.cpp
index 25969cb..62cec14 100644
--- a/mappingtreemodel.cpp
+++ b/mappingtreemodel.cpp
@@ -38,37 +38,6 @@ int MappingTreeModel::mappingTypeIdFromName(const QVariant &name) const{
return -1;
}
-//caller has ownership of this item!
-SmTreeItem *MappingTreeModel::treeFromPaths(const QStringList &paths){
- if(paths.isEmpty()){
- return 0;
- }
- QHash<QString, SmTreeItem*> partsHash;
- SmTreeItem *root = new SmTreeItem(1);
- partsHash.insert(QString(), root);
- SmTreeItem *pItem = root;
-
- // create tree
- for(int i = 0; i < paths.count(); ++i){
- //split the paths
- QStringList parts = paths.at(i).split(forbidden());
- //process path items
- for(int j = 0; j < parts.count(); ++j){
- if(partsHash.contains(parts.at(j))){
- pItem = partsHash.value(parts.at(j)); //we've already seen this item, set it as new parent
- }else{
- //create a new item, save old root
- SmTreeItem *oldRoot = pItem;
- pItem = new SmTreeItem(QList<QVariant>() << parts.at(j), partsHash.value(parts.at(j)));
- oldRoot->appendChild(pItem);
- partsHash.insert(parts.at(j), pItem);
- }
- }
- pItem = root;
- }
- return root;
-}
-
QVariant MappingTreeModel::data(const QModelIndex &index, int role) const{
if(!index.isValid()){
return QVariant();