[Differential] [Commented On] D4814: kio_help: use doOutputBuffer and simplify unicodeError

David Faure noreply at phabricator.kde.org
Sun Feb 26 22:25:31 UTC 2017


dfaure added inline comments.

INLINE COMMENTS

> kio_help.cpp:136
>  
>  void HelpProtocol::unicodeError(const QString &t)
>  {

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

> kio_help.cpp:138
>  {
> -#ifdef Q_OS_WIN
> -    QString encoding = "UTF-8";
> -#else
> -    QString encoding = QTextCodec::codecForLocale()->name();
> -#endif
> -    data(fromUnicode(QStringLiteral(
> -                         "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=%1\"></head>\n%2</html>").arg(encoding, t.toHtmlEscaped())));
> +    data(QStringLiteral(
> +         "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"></head>\n%1</html>").arg(t.toHtmlEscaped()).toUtf8());

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

> kio_help.cpp:344
> +        data(result);
> +        data(QByteArray());
>      }

... 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)

REPOSITORY
  R241 KIO

REVISION DETAIL
  https://phabricator.kde.org/D4814

EMAIL PREFERENCES
  https://phabricator.kde.org/settings/panel/emailpreferences/

To: ltoscano, dfaure
Cc: #documentation, #frameworks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-doc-english/attachments/20170226/8fb0f2b3/attachment.html>


More information about the kde-doc-english mailing list