From a447eb391c53e2731f61375411007b73bf95a0a3 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Fri, 17 Jul 2009 19:26:46 +0000 Subject: The performance of updating the revision state of items depends on the used plugin. To prevent that Dolphin gets blocked by a slow plugin, the updating is delegated to a thread. Still open issue: Applying the revision control property to the model is a bottleneck in QListView (a detailed description of the reason is in kdelibs/kfile/kfilepreviewgenerator.cpp, class LayoutBlocker). But the approach used in KFilePreviewGenerator destroys the textlayout in this case and is temporary disabled until I could track down the reason. svn path=/trunk/KDE/kdebase/apps/; revision=998492 --- src/revisioncontrolobserver.h | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'src/revisioncontrolobserver.h') diff --git a/src/revisioncontrolobserver.h b/src/revisioncontrolobserver.h index 14ea0528e..c5cf9bb0d 100644 --- a/src/revisioncontrolobserver.h +++ b/src/revisioncontrolobserver.h @@ -22,14 +22,18 @@ #include +#include +#include #include +#include #include class DolphinModel; class KDirLister; class QAbstractItemView; +class QThread; class QTimer; -class RevisionControlPlugin; +class UpdateItemStatesThread; /** * @brief Observes all revision control plugins. @@ -50,16 +54,31 @@ public: private slots: void delayedDirectoryVerification(); void verifyDirectory(); - + void applyUpdatedItemStates(); + private: void updateItemStates(); private: + struct ItemState + { + QPersistentModelIndex index; + KFileItem item; + RevisionControlPlugin::RevisionState revision; + }; + + bool m_pendingItemStatesUpdate; + QAbstractItemView* m_view; KDirLister* m_dirLister; DolphinModel* m_dolphinModel; + QTimer* m_dirVerificationTimer; + RevisionControlPlugin* m_plugin; + UpdateItemStatesThread* m_updateItemStatesThread; + + friend class UpdateItemStatesThread; }; #endif // REVISIONCONTROLOBSERVER_H -- cgit v1.3