summaryrefslogtreecommitdiffstats
path: root/filestreemodel.cpp
diff options
context:
space:
mode:
authorArno <am@disconnect.de>2013-01-04 12:53:24 +0100
committerArno <am@disconnect.de>2013-01-04 12:53:24 +0100
commit2fa4f7f525f7138498635204693d94fd3de2d87e (patch)
treefbd106252669494c37951a52ee96d5d5267570e1 /filestreemodel.cpp
parent6ca8a6fab443c0b4ac7f6249c9ef02457ddf4f55 (diff)
downloadSheMov-2fa4f7f525f7138498635204693d94fd3de2d87e.tar.gz
SheMov-2fa4f7f525f7138498635204693d94fd3de2d87e.tar.bz2
SheMov-2fa4f7f525f7138498635204693d94fd3de2d87e.zip
Fix crash in deleting Files from Archive
The QModelIndexList must be a QList<QPersistentModelIndex> to prevent crashes when removeRows is called. The current QModelIndex could already be invalid.
Diffstat (limited to 'filestreemodel.cpp')
-rw-r--r--filestreemodel.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/filestreemodel.cpp b/filestreemodel.cpp
index 5fa926e..dd954ac 100644
--- a/filestreemodel.cpp
+++ b/filestreemodel.cpp
@@ -485,8 +485,8 @@ bool FilesTreeModel::deleteFile(const QModelIndex &file){
return true;
}
-bool FilesTreeModel::deleteFiles(const QModelIndexList &files){
- foreach(QModelIndex i, files){
+bool FilesTreeModel::deleteFiles(const QList<QPersistentModelIndex> &files){
+ foreach(QPersistentModelIndex i, files){
bool retval = deleteFile(i);
if(!retval){
return false;