From 4d2cc1f62de2e097600212f57ef17d222931bbe5 Mon Sep 17 00:00:00 2001 From: Arno Date: Fri, 5 Oct 2012 09:49:38 +0200 Subject: Fix deleting children in MappingTreeModel Deleting children tried to remove it from mappings instead of mappings_parents2. The mapping itself should not be deleted. --- mappingtreewidget.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'mappingtreewidget.cpp') diff --git a/mappingtreewidget.cpp b/mappingtreewidget.cpp index 92366e0..7e62ba3 100644 --- a/mappingtreewidget.cpp +++ b/mappingtreewidget.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include @@ -142,7 +143,8 @@ void MappingTreeWidget::deleteChild(){ int retval = QMessageBox::question(this, tr("Question"), question, QMessageBox::Yes | QMessageBox::No); if(retval == QMessageBox::Yes){ if(!mModel->deleteChild(real)){ - QString msg = QString(tr("Failed to delete %1. Most likely there are still items mapped.")).arg(real.data().toString()); + QSqlError last = mModel->lastError(); + QString msg = QString(tr("Failed to delete %1. Database said: %2")).arg(real.data().toString()).arg(last.text()); QMessageBox::critical(this, tr("Error"), msg); } } -- cgit v1.2.3-70-g09d2