diff options
| author | Peter Penz <[email protected]> | 2012-05-17 13:32:09 +0200 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2012-05-17 13:34:31 +0200 |
| commit | bd02faa982c263205b5cc21d6ceb4225a83c76b5 (patch) | |
| tree | 118e378ba865ed6d6c66637568d9035c1eb9deb4 /src/panels | |
| parent | bca055a38edf722c2433c41cd45f86c27fccc541 (diff) | |
KStandardItemModel: Fix inconsistent internal state
Assure that the index-cache is kept consistent with the items when
a removing or inserting is done. A unit-test will be created as soon
as possible.
Diffstat (limited to 'src/panels')
| -rw-r--r-- | src/panels/places/placesitemmodel.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/panels/places/placesitemmodel.cpp b/src/panels/places/placesitemmodel.cpp index 21cbf9ed3..14ec54be8 100644 --- a/src/panels/places/placesitemmodel.cpp +++ b/src/panels/places/placesitemmodel.cpp @@ -395,7 +395,7 @@ void PlacesItemModel::onItemChanged(int index, const QSet<QByteArray>& changedRo { const PlacesItem* changedItem = placesItem(index); if (changedItem) { - // Take care to apply the PlacesItemModel-order of the inserted item + // Take care to apply the PlacesItemModel-order of the changed item // also to the bookmark-manager. const KBookmark insertedBookmark = changedItem->bookmark(); @@ -409,9 +409,7 @@ void PlacesItemModel::onItemChanged(int index, const QSet<QByteArray>& changedRo } if (changedRoles.contains("isHidden")) { - const PlacesItem* shownItem = placesItem(index); - Q_ASSERT(shownItem); - if (!m_hiddenItemsShown && shownItem->isHidden()) { + if (!m_hiddenItemsShown && changedItem->isHidden()) { m_hiddenItemToRemove = index; QTimer::singleShot(0, this, SLOT(hideItem())); } |
