┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/views/dolphinview.cpp
diff options
context:
space:
mode:
authorFrank Reininghaus <[email protected]>2012-09-11 19:43:53 +0200
committerFrank Reininghaus <[email protected]>2012-09-11 19:43:53 +0200
commit42dad0a9483de340118ce67622cb930619dd4699 (patch)
tree551eec56bf53534ab3238286ba5b1f5ec8578720 /src/views/dolphinview.cpp
parent7de641316a40ac1b570f66e5ca4109fe0b6f6702 (diff)
Fix possible crash when refreshing the view while renaming inline
It is not reproducible on every machine for me, but it seems that it can happen that DolphinView's slot slotRoleEditingFinished() is invoked after the items have already been removed from the model. In that case, we have to return from the slot immediately to prevent a crash. BUG: 306147 FIXED-IN: 4.9.2
Diffstat (limited to 'src/views/dolphinview.cpp')
-rw-r--r--src/views/dolphinview.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp
index 08e26c5d6..72ccb8372 100644
--- a/src/views/dolphinview.cpp
+++ b/src/views/dolphinview.cpp
@@ -1321,6 +1321,10 @@ void DolphinView::slotVisibleRolesChangedByHeader(const QList<QByteArray>& curre
void DolphinView::slotRoleEditingFinished(int index, const QByteArray& role, const QVariant& value)
{
+ if (index < 0 || index >= m_model->count()) {
+ return;
+ }
+
if (role == "text") {
const KFileItem oldItem = m_model->fileItem(index);
const QString newName = value.toString();