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/kfileitemmodel.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/kitemviews/kfileitemmodel.cpp') diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp index ede3c3623..9078cb85a 100644 --- a/src/kitemviews/kfileitemmodel.cpp +++ b/src/kitemviews/kfileitemmodel.cpp @@ -372,6 +372,9 @@ void KFileItemModel::clear() void KFileItemModel::setRoles(const QSet& roles) { + if (m_roles == roles) { + return; + } m_roles = roles; if (count() > 0) { -- cgit v1.3