]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Remove workaround for bug 304986 which is not needed in master
authorFrank Reininghaus <frank78ac@googlemail.com>
Tue, 30 Oct 2012 06:29:44 +0000 (07:29 +0100)
committerFrank Reininghaus <frank78ac@googlemail.com>
Tue, 30 Oct 2012 06:29:44 +0000 (07:29 +0100)
Commit ea6a7c09a0067aaf62ef2de69b5a2c4967676768 added a workaround for
bug 304986 (high CPU usage because KFileItemModelRolesUpdater requests
previews for the same files over and over again after, e.g., a rename
operation). The KDE/4.10 branch of kdelibs contains the real fix for
this issue (b8f64ca3f4b6311519c21046031d66d9d0a570c6), so the workaround
can be removed.

src/kitemviews/kfileitemmodelrolesupdater.cpp

index 936e6a740513419881b8529a968997eb954bf4a5..ae935819272a4ea1925bbd40718fd26e2734665a 100644 (file)
@@ -438,22 +438,9 @@ void KFileItemModelRolesUpdater::slotSortRoleChanged(const QByteArray& current,
 
 void KFileItemModelRolesUpdater::slotGotPreview(const KFileItem& item, const QPixmap& pixmap)
 {
-    const int oldNumberOfPendingItems = m_pendingVisibleItems.count() + m_pendingInvisibleItems.count();
-
     m_pendingVisibleItems.remove(item);
     m_pendingInvisibleItems.remove(item);
 
-    const int newNumberOfPendingItems = m_pendingVisibleItems.count() + m_pendingInvisibleItems.count();
-
-    if (oldNumberOfPendingItems == newNumberOfPendingItems) {
-        // 'item' could not be removed from either of the sets. It looks like
-        // we have hit bug 304986. Replace the items in the sets by the items
-        // in the model to work around the problem.
-        // NOTE: This workaround is not needed any more in KDE 4.10.
-        m_pendingVisibleItems = sortedItems(m_pendingVisibleItems).toSet();
-        m_pendingInvisibleItems = sortedItems(m_pendingInvisibleItems).toSet();
-    }
-
     const int index = m_model->index(item);
     if (index < 0) {
         return;
@@ -511,22 +498,9 @@ void KFileItemModelRolesUpdater::slotGotPreview(const KFileItem& item, const QPi
 
 void KFileItemModelRolesUpdater::slotPreviewFailed(const KFileItem& item)
 {
-    const int oldNumberOfPendingItems = m_pendingVisibleItems.count() + m_pendingInvisibleItems.count();
-
     m_pendingVisibleItems.remove(item);
     m_pendingInvisibleItems.remove(item);
 
-    const int newNumberOfPendingItems = m_pendingVisibleItems.count() + m_pendingInvisibleItems.count();
-
-    if (oldNumberOfPendingItems == newNumberOfPendingItems) {
-        // 'item' could not be removed from either of the sets. It looks like
-        // we have hit bug 304986. Replace the items in the sets by the items
-        // in the model to work around the problem.
-        // NOTE: This workaround is not needed any more in KDE 4.10.
-        m_pendingVisibleItems = sortedItems(m_pendingVisibleItems).toSet();
-        m_pendingInvisibleItems = sortedItems(m_pendingInvisibleItems).toSet();
-    }
-
     const bool clearPreviews = m_clearPreviews;
     m_clearPreviews = true;
     applyResolvedRoles(item, ResolveAll);