kio_help: use doOutputBuffer and simplify unicodeError
ClosedPublic

Authored by ltoscano on Feb 26 2017, 10:02 PM.

Details

Summary
  • use the new doOutputBuffer from kdoctools and reduce the number of lower-level functions from kdoctools used by kio;
  • unicodeError: force utf-8 as codec; no reason to use a local codec, browsers should be able to render it. Also, remove the last usage of fromUnicode().
Test Plan

Compiles, the code branches previously handled directly and
now managed by doOutputBuffer still works.

Diff Detail

Repository
R241 KIO
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ltoscano created this revision.Feb 26 2017, 10:02 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptFeb 26 2017, 10:02 PM
Restricted Application added a subscriber: Frameworks. · View Herald Transcript
dfaure added inline comments.Feb 26 2017, 10:25 PM
src/ioslaves/help/kio_help.cpp
136

While at it: this change makes the method name quite strange. Rename to sendError ?

138–139

Here the call to data() is not followed by a data(QByteArray()) ....

342

... while here the call to data() is followed by data(empty bytearray), as per the kio SlaveBase docu.

I suggest making it consistent (the best solution depends on what the other calls to unicodeError() look like)

ltoscano added inline comments.Feb 26 2017, 10:33 PM
src/ioslaves/help/kio_help.cpp
136

Probably historical reasons from when UTF-8 was not "da" codec, and I'm not sure I want to dig into the history

138–139

Right, I simply followed the old behavior, but it's easy to fix.

342

Other calls are inside get() and the corresponding usage of data does not include data(QByteArray()), so I think I would change emitFile to always add that line at the end.

For the record, I'm trying to reduce the number of functions used because the next step (which I hope to send for review before 5.32, even if the time is short) is finally exporting a proper public .so from KDocTools.

ltoscano updated this revision to Diff 11866.Feb 26 2017, 10:43 PM

Follow the hints: rename unicodeError(), consistenly close data()

dfaure accepted this revision.Feb 26 2017, 11:27 PM
This revision is now accepted and ready to land.Feb 26 2017, 11:27 PM

I consider this an implicit acceptance for the parent review https://phabricator.kde.org/D4813 then :)

ltoscano updated this revision to Diff 11874.Feb 26 2017, 11:58 PM

Use the updated name of the new function

This revision was automatically updated to reflect the committed changes.
ltoscano marked 3 inline comments as done.

Thank you! And lesson learned: change the message here too, as arcanist did not update it.