┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews/kstandarditemlistwidget.cpp
diff options
context:
space:
mode:
authorLuca Beltrame <[email protected]>2012-09-21 10:55:08 +0200
committerLuca Beltrame <[email protected]>2012-09-21 10:55:08 +0200
commitf1b822d926316d739ec10d8b05917b6b0c2d92b5 (patch)
tree20e52bfd70694a34f86fa650d3797be67bda8f67 /src/kitemviews/kstandarditemlistwidget.cpp
parent399c4b22ea9947047c7d2777d7f361df6b5e9636 (diff)
parentc8243401470156d9ee76e2015a23741570d3dba1 (diff)
Merge branch 'KDE/4.9'
Conflicts: konq-plugins/dirfilter/dirfilterplugin.cpp konq-plugins/dirfilter/dirfilterplugin.h
Diffstat (limited to 'src/kitemviews/kstandarditemlistwidget.cpp')
-rw-r--r--src/kitemviews/kstandarditemlistwidget.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/kitemviews/kstandarditemlistwidget.cpp b/src/kitemviews/kstandarditemlistwidget.cpp
index be4fd68cb..97c8a038b 100644
--- a/src/kitemviews/kstandarditemlistwidget.cpp
+++ b/src/kitemviews/kstandarditemlistwidget.cpp
@@ -271,6 +271,16 @@ void KStandardItemListWidget::paint(QPainter* painter, const QStyleOptionGraphic
painter->setFont(m_customizedFont);
painter->setPen(m_isHidden ? m_additionalInfoTextColor : textColor());
const TextInfo* textInfo = m_textInfo.value("text");
+
+ if (!textInfo) {
+ // It seems that we can end up here even if m_textInfo does not contain
+ // the key "text", see bug 306167. According to triggerCacheRefreshing(),
+ // this can only happen if the index is negative. This can happen when
+ // the item is about to be removed, see KItemListView::slotItemsRemoved().
+ // TODO: try to reproduce the crash and find a better fix.
+ return;
+ }
+
painter->drawStaticText(textInfo->pos, textInfo->staticText);
bool clipAdditionalInfoBounds = false;