summaryrefslogtreecommitdiffstats
path: root/archivemodel.cpp
diff options
context:
space:
mode:
authorArno <am@disconnect.de>2015-03-21 09:15:16 +0100
committerArno <am@disconnect.de>2015-03-21 09:15:16 +0100
commit9544f4d790695e707e7e8b9cb44f9cb0fed0dbcb (patch)
treebf6af4d83c91f5a2594a3777fb31f620e6a852d2 /archivemodel.cpp
parente6b7e5e0fccef756398982bd51137bb433df7f4a (diff)
downloadSheMov-9544f4d790695e707e7e8b9cb44f9cb0fed0dbcb.tar.gz
SheMov-9544f4d790695e707e7e8b9cb44f9cb0fed0dbcb.tar.bz2
SheMov-9544f4d790695e707e7e8b9cb44f9cb0fed0dbcb.zip
Delete emtpy series
Enable the delete option in ArchiveTree, but only allow delete when it has no children.
Diffstat (limited to 'archivemodel.cpp')
-rw-r--r--archivemodel.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/archivemodel.cpp b/archivemodel.cpp
index d1580de..483eb9f 100644
--- a/archivemodel.cpp
+++ b/archivemodel.cpp
@@ -552,6 +552,13 @@ bool ArchiveModel::deleteSeriesPart(int partId){
return deleteQ.exec();
}
+bool ArchiveModel::deleteSeries(int seriesId){
+ QSqlQuery seriesQ(mDb);
+ seriesQ.prepare("DELETE FROM series WHERE iseries_id = :id");
+ seriesQ.bindValue(":id", seriesId);
+ return seriesQ.exec();
+}
+
bool ArchiveModel::addSeriesPart(int partno, QString subtitle, const QModelIndex &parent){
int seriesId = parent.data(ArchiveModel::GenericIdRole).toInt();
mDb.transaction();