summaryrefslogtreecommitdiffstats
path: root/mappingtreewidget.cpp
diff options
context:
space:
mode:
authorArno <am@disconnect.de>2012-10-05 09:49:38 +0200
committerArno <am@disconnect.de>2012-10-05 09:49:38 +0200
commit4d2cc1f62de2e097600212f57ef17d222931bbe5 (patch)
tree2ae042ee7d22d741e0bc8e1c075b2237e5981dff /mappingtreewidget.cpp
parent184448e767ccdeae66fe4d795757cace98033b0e (diff)
downloadSheMov-4d2cc1f62de2e097600212f57ef17d222931bbe5.tar.gz
SheMov-4d2cc1f62de2e097600212f57ef17d222931bbe5.tar.bz2
SheMov-4d2cc1f62de2e097600212f57ef17d222931bbe5.zip
Fix deleting children in MappingTreeModel
Deleting children tried to remove it from mappings instead of mappings_parents2. The mapping itself should not be deleted.
Diffstat (limited to 'mappingtreewidget.cpp')
-rw-r--r--mappingtreewidget.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/mappingtreewidget.cpp b/mappingtreewidget.cpp
index 92366e0..7e62ba3 100644
--- a/mappingtreewidget.cpp
+++ b/mappingtreewidget.cpp
@@ -18,6 +18,7 @@
#include <QHideEvent>
#include <QAction>
#include <QMenu>
+#include <QSqlError>
#include <algorithm>
@@ -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);
}
}