<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/100285/">http://git.reviewboard.kde.org/r/100285/</a>
</td>
</tr>
</table>
<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/100285/diff/2/?file=5990#file5990line318" style="color: black; font-weight: bold; text-decoration: underline;">src/covermanager/CoverFetcher.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; ">CoverFetcher::slotDialogFinished()</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">318</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="n">CoverFetcher</span><span class="o">::</span><span class="n">fetchRequestRedirected</span><span class="p">(</span> <span class="n">QNetworkReply</span> <span class="o">*</span><span class="n">oldReply</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;">This is basically untested (unfortunately).</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/100285/diff/2/?file=5992#file5992line248" style="color: black; font-weight: bold; text-decoration: underline;">src/network/NetworkAccessManagerProxy.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="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">NetworkAccessManagerProxy::getRedirectUrl( QNetworkReply *reply )</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">248</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">redirectUrl</span><span class="p">.</span><span class="n">isEmpty</span><span class="p">()</span> <span class="o">&&</span> <span class="n">redirectUrl</span> <span class="o">!=</span> <span class="n">originalUrl</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;">Redirects to the initial URL are handled here.
However, infinite (redirection) loops are not correctly handled yet, but do we need that?</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/100285/diff/2/?file=5994#file5994line156" style="color: black; font-weight: bold; text-decoration: underline;">src/scriptengine/AmarokNetworkScript.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="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">AmarokDownloadHelper::requestRedirected( const KUrl &sourceUrl, const KUrl &targetUrl )</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">153</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="n">AmarokDownloadHelper</span><span class="o">::</span><span class="n">requestRedirected</span><span class="p">(</span> <span class="k">const</span> <span class="n">KUrl</span> <span class="o">&</span><span class="n">sourceUrl</span><span class="p">,</span> <span class="k">const</span> <span class="n">KUrl</span> <span class="o">&</span><span class="n">targetUrl</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;">This is needed as the slot which gets the result looks up some data in a QHash.
The key of the QHash is the URL, but since the URL changed (due to the redirect) we have to update the URL (= the key) in the QHash.</pre>
</div>
<br />
<p>- Martin</p>
<br />
<p>On January 2nd, 2011, 8:25 p.m., Martin Blumenstingl wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://git.reviewboard.kde.orgrb/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 Amarok and Rick W. Chen.</div>
<div>By Martin Blumenstingl.</div>
<p style="color: grey;"><i>Updated 2011-01-02 20:25:45</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;">Currently NetworkAccessManagerProxy::getData() ignores redirects.
Since redirects are required for some URLs (see the linked bug) it would be nice if Amarok's NetworkAccessManagerProxy would also support them.
Please have a look at my comments below, I'm trying to explain some of the issues there.
Here's a quick overview of my changes:
-I implemented redirection support
-Infinite loops are currently not handled properly, if page A redirects to itself my code will not do the redirect.
But my code does not handle "if page A redirects to page B which redirects to page A"-loops.
-I tried to test the changes in CoverFetcher but I couldn't find anything that uses redirects there.
Thus those changes are basically "untested".</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;">I tested Sven's "Free Music Charts" script: it works fine now.
Fetching lyrics through the "Ultimate Lyrics" script is also still working.</pre>
</td>
</tr>
</table>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>
<a href="https://bugs.kde.org/show_bug.cgi?id=261839">261839</a>
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>src/covermanager/CoverFetcher.h <span style="color: grey">(9dc2f2e)</span></li>
<li>src/covermanager/CoverFetcher.cpp <span style="color: grey">(b21dd87)</span></li>
<li>src/network/NetworkAccessManagerProxy.h <span style="color: grey">(045ded3)</span></li>
<li>src/network/NetworkAccessManagerProxy.cpp <span style="color: grey">(9a0e763)</span></li>
<li>src/scriptengine/AmarokNetworkScript.h <span style="color: grey">(342cc2a)</span></li>
<li>src/scriptengine/AmarokNetworkScript.cpp <span style="color: grey">(1742f41)</span></li>
</ul>
<p><a href="http://git.reviewboard.kde.org/r/100285/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>