┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/revisioncontrolobserver.h
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2009-07-17 19:26:46 +0000
committerPeter Penz <[email protected]>2009-07-17 19:26:46 +0000
commita447eb391c53e2731f61375411007b73bf95a0a3 (patch)
tree88a20ddc638713a2e6bb758bc97697ccc39a4de3 /src/revisioncontrolobserver.h
parent93ce7f40e2d067eba48b317ef4028c2c75eebebd (diff)
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
Diffstat (limited to 'src/revisioncontrolobserver.h')
-rw-r--r--src/revisioncontrolobserver.h23
1 files changed, 21 insertions, 2 deletions
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 <libdolphin_export.h>
+#include <kfileitem.h>
+#include <revisioncontrolplugin.h>
#include <QObject>
+#include <QPersistentModelIndex>
#include <QString>
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