summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArno <am@disconnect.de>2011-05-27 16:25:59 +0200
committerArno <am@disconnect.de>2011-05-27 16:25:59 +0200
commitd924a6414962435a0695441216474c7d95044233 (patch)
tree1c133ab350dae13ed485d133e7bd6b39225ee9ee
parent547cb6e2b19ba766d104e338d3501289f60489da (diff)
downloadSheMov-d924a6414962435a0695441216474c7d95044233.tar.gz
SheMov-d924a6414962435a0695441216474c7d95044233.tar.bz2
SheMov-d924a6414962435a0695441216474c7d95044233.zip
Fix removal of items from FilesTreeWidget
When setting the dvd no. on several items in FilesTreeWidget, QModelIndex was used in a foreach() loop. Since the loop alters the model, the subsequent operations failed or operated on the wrong Indexes. Fixed by using a QPersistenModelIndex instead.
-rw-r--r--filestreewidget.cpp2
-rw-r--r--filestreewidget.h2
2 files changed, 3 insertions, 1 deletions
diff --git a/filestreewidget.cpp b/filestreewidget.cpp
index 983ddeb..2aa32d2 100644
--- a/filestreewidget.cpp
+++ b/filestreewidget.cpp
@@ -200,7 +200,7 @@ void FilesTreeWidget::edit(int column){
if(!cols.values().contains(column)){
return;
}
- QModelIndexList sIdxes;
+ PersistenModelIndexList sIdxes;
foreach(QModelIndex idx, currentSel){
QModelIndex pIdx = filesTree()->model()->index(idx.row(), column, idx.parent());
if(pIdx.isValid()){
diff --git a/filestreewidget.h b/filestreewidget.h
index 86210c3..73e53b3 100644
--- a/filestreewidget.h
+++ b/filestreewidget.h
@@ -13,6 +13,8 @@
#include <QSortFilterProxyModel>
#include <QDialog>
+typedef QList<QPersistentModelIndex> PersistenModelIndexList;
+
class FilesTreeView;
class FilesTreeModel;
class FilesTreeSortModel;