┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/iconmanager.h
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2008-06-11 17:50:59 +0000
committerPeter Penz <[email protected]>2008-06-11 17:50:59 +0000
commit629ec98952bcf38bc99f2b11bc37bdc2ec7aabcc (patch)
treec9cd01c8a232f4c787a641ccd8d22001b4d97d71 /src/iconmanager.h
parent60bfc514641b515cf673c15876f6ee7f8800ea1d (diff)
Improve the performance of the code part which checks which items are visible. Although the code is less readable now, it requires only 0,5 seconds for 2500 items instead of 2 seconds.
svn path=/trunk/KDE/kdebase/apps/; revision=819663
Diffstat (limited to 'src/iconmanager.h')
-rw-r--r--src/iconmanager.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/iconmanager.h b/src/iconmanager.h
index 85538f87d..b5a822175 100644
--- a/src/iconmanager.h
+++ b/src/iconmanager.h
@@ -60,10 +60,18 @@ public:
bool showPreview() const;
/**
- * Updates the previews for all already available items.
+ * Updates the previews for all already available items. It is only necessary
+ * to invoke this method when the icon size of the abstract item view has
+ * been changed.
*/
void updatePreviews();
+ /**
+ * Cancels all pending previews. Should be invoked when the URL of the item
+ * view has been changed.
+ */
+ void cancelPreviews();
+
private slots:
/**
* Generates previews for the items \a items asynchronously.
@@ -144,6 +152,12 @@ private:
/** Kills all ongoing preview jobs. */
void killPreviewJobs();
+ /**
+ * Returns true, if the item list \a items contains an item with the
+ * URL \a url. This is a helper method for IconManager::generatePreviews().
+ */
+ bool itemListContains(const KFileItemList& items, const KUrl& url) const;
+
private:
/** Remembers the pixmap for an item specified by an URL. */
struct ItemInfo