From a682fc799b99653b67f5bbd8f1bed371bcbe48f1 Mon Sep 17 00:00:00 2001 From: Arno Date: Fri, 5 Oct 2012 12:18:14 +0200 Subject: Fixed adding and deleting children from MappingTreeModel Another fix to MappingTreeModel's new database layout. I think we're getting there... Insert the mappings into mapping_parents2 and add the MapParentId to the newly created index in the model. For now, the added date remains invalid. Make it possible (again?) to add root items to MappingTreeModel. For this I had to design a new QDialog with a checkbox. This one fixes another bug in SmTreeModel: Don't call parent() on a null pointer. Sometimes I'm getting random SIGBUS-Signals, but maybe that's because of the debug build of qt I'm using. Couldn't track it down yet... --- smtreeitem.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'smtreeitem.cpp') diff --git a/smtreeitem.cpp b/smtreeitem.cpp index ab5e636..77a75d5 100644 --- a/smtreeitem.cpp +++ b/smtreeitem.cpp @@ -44,12 +44,12 @@ SmTreeItem *SmTreeItem::child(int row) const{ SmTreeItem *SmTreeItem::next() const{ int pos = row(); - if(pos + 1 < parent()->childCount()){ - return parent()->child(pos + 1); - } if(parent() == 0){ return 0; } + if(pos + 1 < parent()->childCount()){ + return parent()->child(pos + 1); + } return parent()->next(); } -- cgit v1.2.3-70-g09d2