diff options
author | Arno <am@disconnect.de> | 2013-04-11 09:31:11 +0200 |
---|---|---|
committer | Arno <am@disconnect.de> | 2013-04-11 09:31:11 +0200 |
commit | ecc8d0f8d6b1266d214ec1fad5733fcad4d2bf33 (patch) | |
tree | e3f496eaa30a41615dfeb6162bc4796982aec55e /mappingtreemodel.h | |
parent | a39b9bb410593edf105be3ce808b6bfd94f95cde (diff) | |
download | SheMov-ecc8d0f8d6b1266d214ec1fad5733fcad4d2bf33.tar.gz SheMov-ecc8d0f8d6b1266d214ec1fad5733fcad4d2bf33.tar.bz2 SheMov-ecc8d0f8d6b1266d214ec1fad5733fcad4d2bf33.zip |
Fix editing of MappingTreeModel
Renaming/Editing of an item didn't work, because database restrictions
hadn't been taken into account. tdescription_name is unique, so update
the description_id if it already exists.
Diffstat (limited to 'mappingtreemodel.h')
-rw-r--r-- | mappingtreemodel.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mappingtreemodel.h b/mappingtreemodel.h index 228adee..247c96d 100644 --- a/mappingtreemodel.h +++ b/mappingtreemodel.h @@ -40,7 +40,7 @@ class MappingTreeModel : public SmTreeModel { QList<QVariant> childList(const QVariant &value, int column = 0) const; QStringList path(QModelIndex &idx) const; QModelIndex indexFromPath(const QString &path, int column = 0) const; - bool setData(const QModelIndex &index, const QVariant &value, int role); + bool setData(const QModelIndex &idx, const QVariant &value, int role); bool move(const QModelIndex &source, const QModelIndex &dest); bool addMappingType(const QString &type); bool deleteMappingType(int typeId); @@ -68,6 +68,8 @@ class MappingTreeModel : public SmTreeModel { int addChild(const QString &name, int type); void getMappingTypes(); void getChildrenRecursive(SmTreeItem *item); + bool updateType(SmTreeItem *item, const QVariant &value); + bool updateChild(SmTreeItem *item, const QVariant &value); QStringList getPathsRecursive(SmTreeItem *parent) const; QList<QVariant> getChildListRecursive(SmTreeItem *item, int column) const; QString basePath(SmTreeItem *item) const; |