┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphinview.h
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2009-07-11 17:48:05 +0000
committerPeter Penz <[email protected]>2009-07-11 17:48:05 +0000
commit8e6dbadef2e7f25caed42559c4ffc832e03d387b (patch)
treefcf01df972da3011e8fe56f1937bd87bd1520335 /src/dolphinview.h
parentebd0f1b06fdf94fc7be5c44a434dd6fc96a34e4a (diff)
Fixed performance issues related to selections and deleting of files:
- Don't connect to KDirLister::itemDeleted(const KFileItem&), but KDirLister::itemsDeleted(const KFileItemList&). Otherwise Dolphin is informed about each single file deletion instead of getting the deleted items as a list. Thanks to David Faure for the hint! - DolphinViewContainer::updateStatusBar() can be expensive when a lot of files are selected, as the file size must get retrieved. Assure that fast calls for updateStatusBar() don't trigger a synchronous update, do the update after 300 ms where no further update has been triggered. - Dolphin provides a list of file items when emitting the selectionChanged() signal. Collecting the file items is a quite expensive operation, so use the same approach as when updating the statusbar: only emit the selection changed signal when no change has been done within 300 ms. This improves the performance when doing huge selections a lot. - Make updateStatusBar() a private method, the main window should not need to take care about updating the statusbar (this is done internally now by DolphinViewContainer). BUG: 199090 BUG: 195787 CCBUG: 199352 CCBUG: 188218 svn path=/trunk/KDE/kdebase/apps/; revision=995015
Diffstat (limited to 'src/dolphinview.h')
-rw-r--r--src/dolphinview.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/dolphinview.h b/src/dolphinview.h
index 24f56f403..44915f6c0 100644
--- a/src/dolphinview.h
+++ b/src/dolphinview.h
@@ -580,6 +580,19 @@ private slots:
*/
void triggerItem(const KFileItem& index);
+ /**
+ * Emits the signal \a selectionChanged() with a small delay. This is
+ * because getting all file items for the signal can be an expensive
+ * operation. Fast selection changes are collected in this case and
+ * the signal is emitted only after no selection change has been done
+ * within a small delay.
+ */
+ void emitDelayedSelectionChangedSignal();
+
+ /**
+ * Is called by emitDelayedSelectionChangedSignal() and emits the
+ * signal \a selectionChanged() with all selected file items as parameter.
+ */
void emitSelectionChangedSignal();
/**
@@ -785,7 +798,9 @@ private:
DolphinDetailsView* m_detailsView;
DolphinColumnView* m_columnView;
DolphinFileItemDelegate* m_fileItemDelegate;
+
QItemSelectionModel* m_selectionModel;
+ QTimer* m_selectionChangedTimer;
DolphinModel* m_dolphinModel;
KDirLister* m_dirLister;