diff options
author | Arno <am@disconnect.de> | 2012-10-06 12:39:54 +0200 |
---|---|---|
committer | Arno <am@disconnect.de> | 2012-10-06 12:41:09 +0200 |
commit | d562d4a3527044aaeb36534bc2d4b65b587c9bb3 (patch) | |
tree | f3d8e3d3c94f1c44aec26ae77136cb0771573320 /mappingtreemodel.h | |
parent | e2d4843586d84da62e325d1cb0025a795b162c1c (diff) | |
download | SheMov-d562d4a3527044aaeb36534bc2d4b65b587c9bb3.tar.gz SheMov-d562d4a3527044aaeb36534bc2d4b65b587c9bb3.tar.bz2 SheMov-d562d4a3527044aaeb36534bc2d4b65b587c9bb3.zip |
Fix MappingTreeModel
* Don't recurse ad infinitum when having nodes with the same name.
* Add all relevant data to the model.
There's still one quirk left: you can't do something like this blub ->
blub2 if bla -> blub ->blub2 already exists, but that's something I can
live with.
Diffstat (limited to 'mappingtreemodel.h')
-rw-r--r-- | mappingtreemodel.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/mappingtreemodel.h b/mappingtreemodel.h index beb7d7f..38c0c7b 100644 --- a/mappingtreemodel.h +++ b/mappingtreemodel.h @@ -21,9 +21,9 @@ class SmTreeItem; class MappingTreeModel : public SmTreeModel { Q_OBJECT public: - enum Roles { NameRole = Qt::UserRole + 1, ParentIdRole = Qt::UserRole + 2, AddedRole = Qt::UserRole + 3, MyIdRole = Qt::UserRole + 4 }; - enum Fields { Name = 0, ParentId = 1, Added = 2, MyId = 3 }; - enum { NumFields = 4 }; + enum Roles { NameRole = Qt::UserRole + 1, MappingIdRole = Qt::UserRole + 2, AddedRole = Qt::UserRole + 3, MyIdRole = Qt::UserRole + 4, ParentIdRole = Qt::UserRole + 5 }; + enum Fields { Name = 0, MappingId = 1, Added = 2, MyId = 3, ParentId = 4 }; + enum { NumFields = 5 }; MappingTreeModel(QStringList &headers, QObject *parent = 0); ~MappingTreeModel(); @@ -90,6 +90,7 @@ class MappingTreeModel : public SmTreeModel { const QString mForbidden; int mType; QSqlError mLastError; + QList<QVariant> mSeen; }; class MappingTreeResultModel : public SmTreeModel { |