[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Re: Review Request: Add direct support for remote URLs to previewjob
From: "David Faure" <faure () kde ! org>
Date: 2011-10-28 14:49:42
Message-ID: 20111028144942.11490.74734 () vidsolbach ! de
[Download RAW message or body]
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/102929/#review7723
-----------------------------------------------------------
Ship it!
Looks good, the code is much simpler now. Just two small things, then I'm O=
K with this being committed to 4.7 branch -- won't affect existing thumbnai=
l plugins.
kio/kio/previewjob.cpp
<http://git.reviewboard.kde.org/r/102929/#comment6638>
Remove this if(), it's not needed. The foreach will do nothing if the l=
ist is empty, anyway.
kio/kio/previewjob.cpp
<http://git.reviewboard.kde.org/r/102929/#comment6639>
The const ref here is not necessary [I hear the compilers make it work,=
but it "reads wrong", e.g. it points to the temporary QStringList() if the=
protocol wasn't found...].
=
Anyway, why use a local variable for this case and not for the "KIO" ca=
se? This is harder to read because not symmetric.
I guess making it a single line, just like for KIO, would be okay.
- David Faure
On Oct. 22, 2011, 12:55 a.m., Sebastian K=C3=BCgler wrote:
> =
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/102929/
> -----------------------------------------------------------
> =
> (Updated Oct. 22, 2011, 12:55 a.m.)
> =
> =
> Review request for kdelibs.
> =
> =
> Description
> -------
> =
> This patch allows previewjobs to take a URL in case they understand how t=
o deal with that. preview plugis can specify a list of protocols which they=
support, this is then matched with the scheme of the URL and if supported =
the URL is passed directly into the plugin. Otherwise, the file is download=
ed and passed as local file (this part hasn't changed).
> =
> A suitable preview plugin that does the job will be submitted separately =
to kde-runtime.
> =
> Is this definitively Frameworks 5 material, or would you be OK with addin=
g it to the 4.7 branch? (The latter would mean, we could use vanilla kdelib=
s for Plasma Active 2 in december.)
> =
> =
> Diffs
> -----
> =
> kdecore/services/kservice.h 040507c =
> kio/kio/previewjob.cpp ff6d340 =
> =
> Diff: http://git.reviewboard.kde.org/r/102929/diff/diff
> =
> =
> Testing
> -------
> =
> Generating preview for HTTP URLs, for local files and for remote files wi=
thout a suitable plugin.
> =
> =
> Thanks,
> =
> Sebastian K=C3=BCgler
> =
>
[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/102929/">http://git.reviewboard.kde.org/r/102929/</a>
</td>
</tr>
</table>
<br />
<p>Ship it!</p>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Looks good, the code is \
much simpler now. Just two small things, then I'm OK with this being committed to \
4.7 branch -- won't affect existing thumbnail plugins.</pre> <br />
<div>
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;"> <thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;"> <a \
href="http://git.reviewboard.kde.org/r/102929/diff/2/?file=39480#file39480line277" \
style="color: black; font-weight: bold; text-decoration: \
underline;">kio/kio/previewjob.cpp</a> <span style="font-weight: normal;">
(Diff revision 2)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; \
">PreviewJob::ScaleType PreviewJob::scaleType() const</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th> <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td> <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">276</font></th> <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span \
class="k">if</span> <span class="p">(</span><span class="o">!</span><span \
class="n">protocols</span><span class="p">.</span><span class="n">isEmpty</span><span \
class="p">())</span> <span class="p">{</span></pre></td> </tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Remove this \
if(), it's not needed. The foreach will do nothing if the list is empty, \
anyway.</pre> </div>
<br />
<div>
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;"> <thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;"> <a \
href="http://git.reviewboard.kde.org/r/102929/diff/2/?file=39480#file39480line599" \
style="color: black; font-weight: bold; text-decoration: \
underline;">kio/kio/previewjob.cpp</a> <span style="font-weight: normal;">
(Diff revision 2)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">bool \
PreviewJobPrivate::statResultThumbnail()</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th> <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td> <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">597</font></th> <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span \
class="k">const</span> <span class="n">QStringList</span> <span \
class="o">&</span><span class="n">_plugins</span> <span class="o">=</span> <span \
class="n">m_remoteProtocolPlugins</span><span class="p">.</span><span \
class="n">value</span><span class="p">(</span><span class="n">fileUrl</span><span \
class="p">.</span><span class="n">scheme</span><span class="p">());</span></pre></td> \
</tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">The const \
ref here is not necessary [I hear the compilers make it work, but it "reads \
wrong", e.g. it points to the temporary QStringList() if the protocol wasn't \
found...].
Anyway, why use a local variable for this case and not for the "KIO" case? \
This is harder to read because not symmetric. I guess making it a single line, just \
like for KIO, would be okay.</pre> </div>
<br />
<p>- David</p>
<br />
<p>On October 22nd, 2011, 12:55 a.m., Sebastian Kügler wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://git.reviewboard.kde.org/media/rb/images/review_request_box_top_bg.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;"> <tr>
<td>
<div>Review request for kdelibs.</div>
<div>By Sebastian Kügler.</div>
<p style="color: grey;"><i>Updated Oct. 22, 2011, 12:55 a.m.</i></p>
<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 allows previewjobs to take a URL in case they understand how \
to deal with that. preview plugis can specify a list of protocols which they support, \
this is then matched with the scheme of the URL and if supported the URL is passed \
directly into the plugin. Otherwise, the file is downloaded and passed as local file \
(this part hasn't changed).
A suitable preview plugin that does the job will be submitted separately to \
kde-runtime.
Is this definitively Frameworks 5 material, or would you be OK with adding it to the \
4.7 branch? (The latter would mean, we could use vanilla kdelibs for Plasma Active 2 \
in december.)</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;">Generating preview for HTTP URLs, for local files and for remote files \
without a suitable plugin.</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>kdecore/services/kservice.h <span style="color: grey">(040507c)</span></li>
<li>kio/kio/previewjob.cpp <span style="color: grey">(ff6d340)</span></li>
</ul>
<p><a href="http://git.reviewboard.kde.org/r/102929/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