From 7deb601f317d7c806e69d0d82d99a03d0859ca85 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Tue, 21 Feb 2012 16:46:56 +0100 Subject: Don't trigger assert when switching to details-view If the visible roles of the details-view are equal to the visible roles of other views, then switching to the details-view will trigger an assert because the invisible roles don't get updated. Thanks to Frank Reininghaus for the detailed analyses! In the context of this fix optimizations have been done when switching view-modes: The "don't-animate-workaround" could be removed. BUG: 294531 FIXED-IN: 4.8.1 --- src/kitemviews/kitemlistview.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/kitemviews/kitemlistview.h') diff --git a/src/kitemviews/kitemlistview.h b/src/kitemviews/kitemlistview.h index 293f4b1ec..d524dbdf4 100644 --- a/src/kitemviews/kitemlistview.h +++ b/src/kitemviews/kitemlistview.h @@ -176,7 +176,7 @@ public: * has to take care itself how to visually represent the expanded items provided * by the model. */ - virtual bool supportsItemExpanding() const; + bool supportsItemExpanding() const; /** * @return The rectangle of the item relative to the top/left of @@ -298,6 +298,13 @@ protected: QList visibleItemListWidgets() const; + /** + * Must be called by the derived class if it supports the expanding + * of items. + * @see supportsItemExpanding() + */ + void setSupportsItemExpanding(bool supportsExpanding); + protected slots: virtual void slotItemsInserted(const KItemRangeList& itemRanges); virtual void slotItemsRemoved(const KItemRangeList& itemRanges); @@ -547,6 +554,7 @@ private: private: bool m_enabledSelectionToggles; bool m_grouped; + bool m_supportsItemExpanding; int m_activeTransactions; // Counter for beginTransaction()/endTransaction() LayoutAnimationHint m_endTransactionAnimationHint; -- cgit v1.3.1