From ecc8d0f8d6b1266d214ec1fad5733fcad4d2bf33 Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 11 Apr 2013 09:31:11 +0200 Subject: 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. --- mappingtreemodel.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'mappingtreemodel.h') 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 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 getChildListRecursive(SmTreeItem *item, int column) const; QString basePath(SmTreeItem *item) const; -- cgit v1.2.3-70-g09d2