From 1e84e246d1a4e0b24657e9c416c6ce4a0eb002d5 Mon Sep 17 00:00:00 2001 From: Arno Date: Wed, 9 Jul 2014 14:05:15 +0200 Subject: Fix commit dc7cc269a4fffe43bdac2ae2dc6548fbd1e3bb5e Since that commit we not only recorded leaves for Mappings, but also the nodes. This is plain wrong, since we build the path/tree ourselves where it matters (e.g. MappingTreeItem). Fix it by checking recursively if the MappingItem has children. --- newpicsdialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'newpicsdialog.cpp') diff --git a/newpicsdialog.cpp b/newpicsdialog.cpp index 2b14c6d..e665f3b 100644 --- a/newpicsdialog.cpp +++ b/newpicsdialog.cpp @@ -147,7 +147,7 @@ void NewPicsDialog::accept(){ if(files.isEmpty()){ return QDialog::accept(); } - QList mappingParentsIds = mMappingEditWidget->model()->columnValues(MappingTreeResultModel::MappingId); + QList mappingParentsIds = mMappingEditWidget->model()->getMappings(mMappingEditWidget->model()->root()); QSqlQuery addFileQ(mDb); addFileQ.prepare("INSERT INTO pics (tfilename, cmd5sum, isize, tformat, cpicsize) VALUES(:fn, :md5, :size, :format, :picsize)"); QSqlQuery addMappingQ(mDb); -- cgit v1.2.3-70-g09d2