<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/105392/">http://git.reviewboard.kde.org/r/105392/</a>
</td>
</tr>
</table>
<br />
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Great work!
I noticed a few things though:
* in your initial analysis, you said KEncodingDetector had code to detect the encoding from the html/xml and http headers. Is this functionality lost during this port, in khtml?
* you deleted the KEncodingDetector unittest, but apparently KEncodingProber has no unittests. Could you port the old unittest to KEncodingProber, in order to at least validate it a bit, and ideally could you extend the unittest for things that only the prober can do?
* rather than deleting KEncodingDetector, please move it to kde4support (in a separate commit, possibly), so that source compatibility is preserved (just in case there is some application out there that uses it).</pre>
<br />
<p>- David</p>
<br />
<p>On June 30th, 2012, 11:01 a.m., Hui Ni 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, Kevin Ottens and David Faure.</div>
<div>By Hui Ni.</div>
<p style="color: grey;"><i>Updated June 30, 2012, 11:01 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;">hi, this is my first contribution to kde frameworks.
This patch removes KEncodingDetector class from tier1/kcodecs and ports all related bits in kdelibs to KEncodingProber class.
proposal raised at http://mail.kde.org/pipermail/kde-frameworks-devel/2012-June/000738.html
KEncodingDetector is actually KEncodingProber + encoding priority list + QTextDecoder, and the later two things are used only in khtml.
things removed:
enum KEncodingDetector::EncodingChoiceSource -> removed
KEncodingDetector::setEncoding -> removed, implement it in khtml code
KEncodingDetector::encodingChoiceSource -> removed
KEncodingProber::encodingName -> removed, avoid potential memory leak
one to one changes:
enum KEncodingDetector::AutoDetectScript -> enum KEncodingProber::ProberType
KEncodingDetector::encoding -> KEncodingProber::encoding
KEncodingDetector::visuallyOrdered -> check KEncodingProber::encoding is hebrew or not
KEncodingDetector::autoDetectLanguage -> KEncodingProber::proberType
KEncodingDetector::setAutoDetectLanguage -> KEncodingProber::setProberType
KEncodingDetector::decode -> KEncodingProber::feed + QTextCodec::codecForName(prober.encoding())->toUnicode
KEncodingDetector::decodeWithBuffering -> KEncodingProber::feed, feed, feed + check KEncodingProber::state + QTextCodec::codecForName(prober.encoding())->makeDecoder
KEncodingDetector::decodedInvalidCharacters -> QTextCodec::codecForName(prober.encoding())->makeDecoder + hasFailure
KEncodingDetector::resetDecoder -> KEncodingProber::reset
KEncodingDetector::flush -> KEncodingProber::feed, feed, feed + QTextCodec::codecForName(prober.encoding())->toUnicode
KEncodingDetector::scriptForName -> KEncodingProber::proberTypeForName
KEncodingDetector::nameForScript -> KEncodingProber::nameForProberType
KEncodingDetector::hasAutoDetectionForScript -> if (proberType == KEncodingProber::None) ... else ...
</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>kdeui/actions/kcodecaction.h <span style="color: grey">(627d770)</span></li>
<li>kdeui/actions/kcodecaction.cpp <span style="color: grey">(97a8a90)</span></li>
<li>khtml/ecma/xmlhttprequest.h <span style="color: grey">(7eb2012)</span></li>
<li>khtml/ecma/xmlhttprequest.cpp <span style="color: grey">(11bcc46)</span></li>
<li>khtml/khtml_part.h <span style="color: grey">(340ece1)</span></li>
<li>khtml/khtml_part.cpp <span style="color: grey">(d9d1250)</span></li>
<li>khtml/khtmlpart_p.h <span style="color: grey">(d46d254)</span></li>
<li>khtml/test_regression.cpp <span style="color: grey">(8b2fa15)</span></li>
<li>khtml/xml/dom_docimpl.h <span style="color: grey">(71bc13f)</span></li>
<li>khtml/xml/dom_docimpl.cpp <span style="color: grey">(5e34d18)</span></li>
<li>khtml/xml/xml_tokenizer.cpp <span style="color: grey">(f65be63)</span></li>
<li>tier1/kcodecs/autotests/CMakeLists.txt <span style="color: grey">(9ce6f85)</span></li>
<li>tier1/kcodecs/autotests/kencodingdetectortest.h <span style="color: grey">(a9eedec)</span></li>
<li>tier1/kcodecs/autotests/kencodingdetectortest.cpp <span style="color: grey">(d54fcef)</span></li>
<li>tier1/kcodecs/src/CMakeLists.txt <span style="color: grey">(e58c438)</span></li>
<li>tier1/kcodecs/src/guess_ja.cpp <span style="color: grey">(0631815)</span></li>
<li>tier1/kcodecs/src/guess_ja_p.h <span style="color: grey">(e34d986)</span></li>
<li>tier1/kcodecs/src/kencodingdetector.h <span style="color: grey">(e6a0444)</span></li>
<li>tier1/kcodecs/src/kencodingdetector.cpp <span style="color: grey">(1d64bdd)</span></li>
<li>tier1/kcodecs/src/kencodingprober.h <span style="color: grey">(da4b958)</span></li>
<li>tier1/kcodecs/src/kencodingprober.cpp <span style="color: grey">(42beac0)</span></li>
<li>tier1/kcoreaddons/src/text/kstringhandler.h <span style="color: grey">(b9b6c2e)</span></li>
</ul>
<p><a href="http://git.reviewboard.kde.org/r/105392/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>