┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews/kfileitemmodelrolesupdater.h
diff options
context:
space:
mode:
authorFrank Reininghaus <[email protected]>2013-06-20 18:10:07 +0200
committerFrank Reininghaus <[email protected]>2013-06-20 18:10:07 +0200
commit4b8c4124cb39d1b6b109ff6dbdb6536a0f2d408b (patch)
treefe80b5ee980d3f6e871329c09b43f51d59d60e51 /src/kitemviews/kfileitemmodelrolesupdater.h
parentfda88516e9c32ed93cb4fe47a3a9a9bf2aecc456 (diff)
Simplify handling of preview jobs
This patch changes two things about the way we handle the preview jobs: (a) Rather than passing a KFileItemList to startPreviewJob(), remembering the leftovers in the member variable m_pendingPreviewItems and then starting a new preview job for these, we append items that need a preview to this member, and let startPreviewJob() take its input from there. This simplifies the code greatly. (b) To prevent that we start preview jobs with just one item and also that the GUI is frozen too long by startPreviewJob(), we take the following approach: * If the mime type of the first pending item is known, the function has probably been called by startUpdating(), which has determined mime types for the visible items already. startUpdating() has also blocked the GUI, so we just take all items at the beginning of the list with known mime type, and do not do any expensive mime type determination in startPreviewJob(). * If the mime type of the first pending item is unknown, the function has probably been called by slotPreviewJobFinished(). In that case, we can afford to block the GUI for a short while, so we determine mime types for 200 ms. REVIEW: 111008
Diffstat (limited to 'src/kitemviews/kfileitemmodelrolesupdater.h')
-rw-r--r--src/kitemviews/kfileitemmodelrolesupdater.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/kitemviews/kfileitemmodelrolesupdater.h b/src/kitemviews/kfileitemmodelrolesupdater.h
index aa47f1756..2a5a4041c 100644
--- a/src/kitemviews/kfileitemmodelrolesupdater.h
+++ b/src/kitemviews/kfileitemmodelrolesupdater.h
@@ -224,13 +224,13 @@ private:
void startUpdating();
/**
- * Creates previews for the items starting from the first item of the
- * given list.
+ * Creates previews for the items starting from the first item in
+ * m_pendingPreviewItems.
* @see slotGotPreview()
* @see slotPreviewFailed()
* @see slotPreviewJobFinished()
*/
- void startPreviewJob(const KFileItemList items);
+ void startPreviewJob();
/**
* Ensures that icons, previews, and other roles are determined for any