From d288b1cda477623297c6e25eb63bb1295a99878f Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sun, 19 Jul 2009 22:29:59 +0000 Subject: - interface cleanups - the subversion test plugin is at least capable of indicating the revision state for files svn path=/trunk/KDE/kdebase/apps/; revision=999489 --- src/revisioncontrolobserver.cpp | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'src/revisioncontrolobserver.cpp') diff --git a/src/revisioncontrolobserver.cpp b/src/revisioncontrolobserver.cpp index 95253c59a..246450fe7 100644 --- a/src/revisioncontrolobserver.cpp +++ b/src/revisioncontrolobserver.cpp @@ -26,7 +26,6 @@ #include #include -#include #include /** @@ -163,14 +162,12 @@ void RevisionControlObserver::verifyDirectory() void RevisionControlObserver::applyUpdatedItemStates() { - // Updating items with non-uniform item sizes is a serious bottleneck - // in QListView. Temporary disable the non-uniform item sizes. - QListView* listView = qobject_cast(m_view); - bool uniformSizes = true; - if (listView != 0) { - uniformSizes = listView->uniformItemSizes(); - //listView->setUniformItemSizes(true); TODO: does not work as well as in KFilePreviewGenerator - } + // QAbstractItemModel::setData() triggers a bottleneck in combination with QListView + // (a detailed description of the root cause is given in the class KFilePreviewGenerator + // from kdelibs). To bypass this bottleneck, the signals of the model are temporary blocked. + // This works as the update of the data does not require a relayout of the views used in Dolphin. + const bool signalsBlocked = m_dolphinModel->signalsBlocked(); + m_dolphinModel->blockSignals(true); const QList itemStates = m_updateItemStatesThread->itemStates(); foreach (const ItemState& itemState, itemStates) { @@ -179,11 +176,8 @@ void RevisionControlObserver::applyUpdatedItemStates() Qt::DecorationRole); } - if (listView != 0) { - listView->setUniformItemSizes(uniformSizes); - } - - m_view->viewport()->repaint(); // TODO: this should not be necessary, as DolphinModel::setData() calls dataChanged() + m_dolphinModel->blockSignals(signalsBlocked); + m_view->viewport()->repaint(); if (m_pendingItemStatesUpdate) { m_pendingItemStatesUpdate = false; -- cgit v1.3