From 87dc8352d448126f4d7f1e93c574277845cf4bef Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Fri, 11 Jan 2008 11:37:28 +0000 Subject: Up to now DolphinView and ColumnWidget contained a lot of code duplication regarding generating previews and the dimming of cut items. This has been refactored by introducing an IconManager which takes care itself about generating a preview and dimming cut items. This also allows improving the speed of previews in (near) future (at the moment showing previews from the cache is a lot slower than in KDE 3...). svn path=/trunk/KDE/kdebase/apps/; revision=759864 --- src/dolphinview.h | 56 ++++++++----------------------------------------------- 1 file changed, 8 insertions(+), 48 deletions(-) (limited to 'src/dolphinview.h') diff --git a/src/dolphinview.h b/src/dolphinview.h index 60e29b4d5..fa5b18471 100644 --- a/src/dolphinview.h +++ b/src/dolphinview.h @@ -38,24 +38,21 @@ #include #include -class KAction; -class KToggleAction; class DolphinController; -class KDirLister; -class KFileItemDelegate; -class KUrl; -class DolphinModel; class DolphinColumnView; class DolphinDetailsView; class DolphinIconsView; class DolphinMainWindow; +class DolphinModel; class DolphinSortFilterProxyModel; +class IconManager; +class KAction; +class KDirLister; +class KFileItemDelegate; +class KUrl; +class KToggleAction; class QModelIndex; class ViewProperties; -namespace KIO -{ - class PreviewJob; -} /** * @short Represents a view for the directory content. @@ -526,19 +523,6 @@ private slots: */ void triggerItem(const KFileItem& index); - /** - * Generates a preview image for each file item in \a items. - * The current preview settings (maximum size, 'Show Preview' menu) - * are respected. - */ - void generatePreviews(const KFileItemList& items); - - /** - * Replaces the icon of the item \a item by the preview pixmap - * \a pixmap. - */ - void replaceIcon(const KFileItem& item, const QPixmap& pixmap); - void emitSelectionChangedSignal(); /** @@ -587,9 +571,6 @@ private slots: */ void emitContentsMoved(); - /** Applies an item effect to all cut items of the clipboard. */ - void updateCutItems(); - /** * Updates the status bar to show hover information for the * item \a item. If currently other items are selected, @@ -610,12 +591,6 @@ private slots: */ void slotDeleteFileFinished(KJob* job); - /** - * Is invoked when the preview job has been finished and - * set m_previewJob to 0. - */ - void slotPreviewJobFinished(KJob* job); - private: void loadDirectory(const KUrl& url, bool reload = false); @@ -654,9 +629,6 @@ private: */ bool isCutItem(const KFileItem& item) const; - /** Applies an item effect to all cut items. */ - void applyCutItemEffect(); - /** * Returns true, if the ColumnView is activated. As the column view * requires some special handling for iterating through directories, @@ -668,16 +640,6 @@ private: } private: - /** - * Remembers the original pixmap for an item before - * the cut effect is applied. - */ - struct CutItem - { - KUrl url; - QPixmap pixmap; - }; - bool m_active; bool m_showPreview; bool m_loadingDirectory; @@ -698,9 +660,7 @@ private: KDirLister* m_dirLister; DolphinSortFilterProxyModel* m_proxyModel; - KIO::PreviewJob* m_previewJob; - - QList m_cutItemsCache; + IconManager* m_iconManager; KUrl m_rootUrl; }; -- cgit v1.3