summaryrefslogtreecommitdiffstats
path: root/seriestreemodel.cpp
diff options
context:
space:
mode:
authorArno <am@disconnect.de>2010-06-18 15:52:01 +0200
committerArno <am@disconnect.de>2010-06-18 15:52:01 +0200
commitb153f90a4c7f76a5ce5f4985bdbd687ba1602fdb (patch)
tree7e2bfc14e62e24b56a77b3afd2e40003956fb49d /seriestreemodel.cpp
parenta8bd9a2310bd630dd4e72fe0ff54a8be17e80064 (diff)
downloadSheMov-b153f90a4c7f76a5ce5f4985bdbd687ba1602fdb.tar.gz
SheMov-b153f90a4c7f76a5ce5f4985bdbd687ba1602fdb.tar.bz2
SheMov-b153f90a4c7f76a5ce5f4985bdbd687ba1602fdb.zip
Created frontend for SeriesTreeModel::deleteFromSeries
Implemented frontend for SeriesTreeModel::deleteFromSeries. I hope QPersistentModelIndexes work as advertised. From the qt-sources it seems that a QPersistentModelIndex is automatically updated by QAbstractItemModel when calling begin(Remove|Insert)Rows. Testing worked out fine. While at it I found a bug in SmTreeModel. removeRows has to be called with (i - 1) instead of (i) to remove the correct nodes.
Diffstat (limited to 'seriestreemodel.cpp')
-rw-r--r--seriestreemodel.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/seriestreemodel.cpp b/seriestreemodel.cpp
index b8a4425..846f00c 100644
--- a/seriestreemodel.cpp
+++ b/seriestreemodel.cpp
@@ -196,6 +196,7 @@ bool SeriesTreeModel::deleteFromSeries(const QModelIndex &what){
foreach(QFileInfo fi, files){
QFile::remove(fi.absoluteFilePath());
}
+ removeRows(what.row(), 1, what.parent());
return true;
}
}