Review Request 124404: kpackagetool: Fix output of non-latin text to stdout

David Faure faure at kde.org
Mon Jul 20 12:39:27 UTC 2015



> On July 20, 2015, 12:32 p.m., David Faure wrote:
> > This is rather surprising. How does it compile? std::cout doesn't have operator<< for QString, and QString's implicit conversion to char * is disabled by -DQT_NO_CAST_TO_ASCII (which is set, otherwise that would be a bug in the first place).
> > 
> > I'm pretty sure that toLocal8Bit().constData() is the proper way to give a QString to cout/cerr...
> 
> Aleix Pol Gonzalez wrote:
>     Well QDebug can provide it quite easily, which is what I assumed.
>     
>     Otherwise, maybe converting toStdString would be better...?
> 
> Alexander Potashev wrote:
>     Please see this definition at the beginning of the .cpp file:
>         static QTextStream cout(stdout);

Ah! I was afraid of that. It's not std::cout, it's a local (unicode-aware) cout :-)
Confusing naming.
The patch is definitely correct then, ship it.


- David


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/124404/#review82708
-----------------------------------------------------------


On July 20, 2015, 12:11 p.m., Alexander Potashev wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/124404/
> -----------------------------------------------------------
> 
> (Updated July 20, 2015, 12:11 p.m.)
> 
> 
> Review request for KDE Frameworks and Plasma.
> 
> 
> Repository: kpackage
> 
> 
> Description
> -------
> 
> kpackagetool: Fix output of non-latin text to stdout
> 
> 
> Diffs
> -----
> 
>   src/kpackagetool/kpackagetool.cpp 16d3f0268788d3cefff86542359e8416388542a9 
> 
> Diff: https://git.reviewboard.kde.org/r/124404/diff/
> 
> 
> Testing
> -------
> 
> `kpackagetool5 --list-types` now has readable output with Russian localization.
> 
> 
> Thanks,
> 
> Alexander Potashev
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20150720/e2de528b/attachment.html>


More information about the Kde-frameworks-devel mailing list