┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/panels/information/informationpanel.h
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2009-07-05 19:10:20 +0000
committerPeter Penz <[email protected]>2009-07-05 19:10:20 +0000
commitb4aacaf4d2a0f119176f491543261b62914d6be0 (patch)
tree5bc9602a2671dc1669c0bc2b01a1f70f986bb343 /src/panels/information/informationpanel.h
parent40cd135f4dc7ae5ffacf8095fcf6e9fca9c04d45 (diff)
Improve performance of Dolphin:
- When changing a directory the receiving of the meta data is done now with a short delay. This gives the directory lister the chance to show the directory as fast as possible. - Prevent that DolphinInformationPanel::reset() is invoked when changing a directory. The method only needs to get invoked if an item has been deleted or renamed. - Cache an unknown file item. This improves the startup time of Dolphin (-> KFileItem constructor is invoked only once instead of up to 6 times). svn path=/trunk/KDE/kdebase/apps/; revision=991840
Diffstat (limited to 'src/panels/information/informationpanel.h')
-rw-r--r--src/panels/information/informationpanel.h42
1 files changed, 33 insertions, 9 deletions
diff --git a/src/panels/information/informationpanel.h b/src/panels/information/informationpanel.h
index 76af6a66a..51642068b 100644
--- a/src/panels/information/informationpanel.h
+++ b/src/panels/information/informationpanel.h
@@ -122,6 +122,13 @@ private slots:
*/
void showPreview(const KFileItem& item, const QPixmap& pixmap);
+ /**
+ * Resets the information panel to show the current
+ * URL (InformationPanel::url()). Is called by
+ * DolphinInformationPanel::markUrlAsInvalid().
+ */
+ void reset();
+
void slotFileRenamed(const QString& source, const QString& dest);
void slotFilesAdded(const QString& directory);
void slotFilesChanged(const QStringList& files);
@@ -151,11 +158,12 @@ private:
void showMetaInfo();
/**
- * Returns the item for file where the preview and meta information
- * should be received, if InformationPanel::showMultipleSelectionInfo()
- * returns false.
+ * Updates the file item m_fileItem if necessary and returns
+ * the file item which should be used to show the meta information.
+ * The returned item is different from m_fileItem if a selection
+ * is given.
*/
- KFileItem fileItem() const;
+ KFileItem updateFileItem();
/**
* Returns true, if the meta information should be shown for
@@ -181,10 +189,12 @@ private:
void setNameLabelText(const QString& text);
/**
- * Resets the information panel to show the current
- * URL (InformationPanel::url()).
+ * Marks the URL as invalid and will reset the Information Panel
+ * after a short delay. The reset is not done synchronously to
+ * prevent expensive updates during temporary invalid URLs by
+ * e. g. changing the directory.
*/
- void reset();
+ void markUrlAsInvalid();
/**
* Assures that the settings for the meta information
@@ -208,8 +218,22 @@ private:
bool m_pendingPreview;
QTimer* m_infoTimer;
QTimer* m_outdatedPreviewTimer;
- KUrl m_shownUrl; // URL that is shown as info
- KUrl m_urlCandidate; // URL candidate that will replace m_shownURL after a delay
+ QTimer* m_urlChangedTimer;
+ QTimer* m_resetUrlTimer;
+
+ // URL that is currently shown in the Information Panel.
+ KUrl m_shownUrl;
+
+ // URL candidate that will replace m_shownURL after a delay.
+ // Used to remember URLs when hovering items.
+ KUrl m_urlCandidate;
+
+ // URL candidate that is marked as invalid (e. g. because the directory
+ // has been deleted or the shown item has been renamed). The Information
+ // Panel will be reset asynchronously to prevent unnecessary resets when
+ // a directory has been changed.
+ KUrl m_invalidUrlCandidate;
+
KFileItem m_fileItem; // file item for m_shownUrl if available (otherwise null)
KFileItemList m_selection;