diff options
author | Arno <am@disconnect.de> | 2013-04-11 04:37:09 +0200 |
---|---|---|
committer | Arno <am@disconnect.de> | 2013-04-11 04:37:09 +0200 |
commit | d71c97f56f4eb35a8918b9741fe6bfd6417a3b5c (patch) | |
tree | 52223c86844ae50ed309430e2531ae2d97e2a036 | |
parent | a39a1118320c2c2e291f9e771ab75d32549431a7 (diff) | |
download | SheMov-d71c97f56f4eb35a8918b9741fe6bfd6417a3b5c.tar.gz SheMov-d71c97f56f4eb35a8918b9741fe6bfd6417a3b5c.tar.bz2 SheMov-d71c97f56f4eb35a8918b9741fe6bfd6417a3b5c.zip |
Possible Bugfix for SmDirModel
Check for valid QModelIndex in dirEvent. It could very well be possible
that we get an invalid index from find(), especially when deleting or
modifying files. Maybe this fixes some unexplained crashes I wasn't able
to reproduce...
-rw-r--r-- | smdirmodel.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/smdirmodel.cpp b/smdirmodel.cpp index 6053890..1a631ba 100644 --- a/smdirmodel.cpp +++ b/smdirmodel.cpp @@ -158,6 +158,9 @@ void SmDirModel::dirEvent(const QList<QVariant> &data, int e){ addFile(data); } QModelIndex idx = find(data.at(Name), Name, rootIndex()); + if(!idx.isValid()){ + return; + } if(e == SmDirWatcher::Deleted){ removeRow(idx.row()); } |