From 0de9ce998583f5b7ed2e741edfbfcd1271224886 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Tue, 6 May 2008 05:47:11 +0000 Subject: prevent a possible crash if an item is deleted during previews are generated svn path=/trunk/KDE/kdebase/apps/; revision=804457 --- src/iconmanager.h | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'src/iconmanager.h') diff --git a/src/iconmanager.h b/src/iconmanager.h index 1621441d8..f72811c27 100644 --- a/src/iconmanager.h +++ b/src/iconmanager.h @@ -80,10 +80,10 @@ private slots: private: /** - * Replaces the icon of the item \a item by the preview pixmap + * Replaces the icon of the item with the \a url by the preview pixmap * \a pixmap. */ - void replaceIcon(const KFileItem& item, const QPixmap& pixmap); + void replaceIcon(const KUrl& url, const QPixmap& pixmap); /** * Returns true, if the item \a item has been cut into @@ -112,24 +112,14 @@ private: private: /** - * Remembers the original pixmap for an item before - * the cut effect is applied. + * Remembers the pixmap for an item specified by an URL. */ - struct CutItem + struct ItemInfo { KUrl url; QPixmap pixmap; }; - /** - * Remembers the received preview pixmap for an item. - */ - struct Preview - { - KFileItem item; - QPixmap pixmap; - }; - bool m_showPreview; QAbstractItemView* m_view; @@ -138,8 +128,8 @@ private: DolphinModel* m_dolphinModel; DolphinSortFilterProxyModel* m_proxyModel; - QList m_cutItemsCache; - QList m_previews; + QList m_cutItemsCache; + QList m_previews; }; inline bool IconManager::showPreview() const -- cgit v1.3