[prev in list] [next in list] [prev in thread] [next in thread]
List: kfm-devel
Subject: Review Request 111008: KFileItemModelRolesUpdater polishing, part 1: simplify preview job handling
From: "Frank Reininghaus" <frank78ac () googlemail ! com>
Date: 2013-06-13 20:52:00
Message-ID: 20130613205200.17622.87524 () vidsolbach ! de
[Download RAW message or body]
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/111008/
-----------------------------------------------------------
Review request for Dolphin.
Description
-------
This patch changes two things about the way we handle the preview job:
(a) Rather than passing a KFileItemList to startPreviewJob(), remembering the \
leftovers in a member variable and then starting a new preview job for these, I \
propose to just add items that need a preview to this KFileItemList member, and let \
startPreviewJob() take its input from there. Makes the code a lot simpler.
(b) To prevent that we start preview jobs with just 1 item and also that the GUI is \
frozen too long by startPreviewJob(), I propose the following method:
* 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 affort to block the GUI \
for a short while, so we determine mime types for 200 ms.
Diffs
-----
dolphin/src/kitemviews/kfileitemmodelrolesupdater.cpp e539b45
dolphin/src/kitemviews/kfileitemmodelrolesupdater.h aa47f17
Diff: http://git.reviewboard.kde.org/r/111008/diff/
Testing
-------
Works for me.
Thanks,
Frank Reininghaus
[Attachment #3 (text/html)]
<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 \
solid;"> <tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="http://git.reviewboard.kde.org/r/111008/">http://git.reviewboard.kde.org/r/111008/</a>
</td>
</tr>
</table>
<br />
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;"> <tr>
<td>
<div>Review request for Dolphin.</div>
<div>By Frank Reininghaus.</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" \
style="border: 1px solid #b8b5a0"> <tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">This patch changes two things about the way we handle the preview job:
(a) Rather than passing a KFileItemList to startPreviewJob(), remembering the \
leftovers in a member variable and then starting a new preview job for these, I \
propose to just add items that need a preview to this KFileItemList member, and let \
startPreviewJob() take its input from there. Makes the code a lot simpler.
(b) To prevent that we start preview jobs with just 1 item and also that the GUI is \
frozen too long by startPreviewJob(), I propose the following method:
* 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 affort to block the GUI \
for a short while, so we determine mime types for 200 ms.</pre> </td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0"> <tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">Works for me.</pre> </td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>dolphin/src/kitemviews/kfileitemmodelrolesupdater.cpp <span style="color: \
grey">(e539b45)</span></li>
<li>dolphin/src/kitemviews/kfileitemmodelrolesupdater.h <span style="color: \
grey">(aa47f17)</span></li>
</ul>
<p><a href="http://git.reviewboard.kde.org/r/111008/diff/" style="margin-left: \
3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic