Review Request 126328: kwallet: Do not use QStringLiteral with multi strings

Patrick Spendrin ps_ml at gmx.de
Sun Dec 13 22:00:39 UTC 2015



> On Dez. 13, 2015, 1:01 vorm., Nick Shaforostoff wrote:
> > i suggest using:
> > 
> > #ifdef Q_OS_WIN
> > #define U QLatin1String
> > #else
> > #define U QStringLiteral	
> > #endif
> 
> Valentin Rusu wrote:
>     Patrick's approach corresponds to a widespread practice in KF5 sources. It also has the advantage to always use the same class, everywhere.

There is another issue with QLatin1String: unlike QStringLiteral and QString::fromLatin1 it doesn't return a QString instance, but a QLatin1String. This would require then some more rework. Also, I want to have the code as platform independent as possible.


- Patrick


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


On Dez. 13, 2015, 9:57 nachm., Patrick Spendrin wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/126328/
> -----------------------------------------------------------
> 
> (Updated Dez. 13, 2015, 9:57 nachm.)
> 
> 
> Review request for KDE Frameworks.
> 
> 
> Repository: kwallet
> 
> 
> Description
> -------
> 
> Strings that are separated into multiple parts don't work on Windows
> together with QStringLiteral as the first string is interpreted as a
> wide (16bit) string, and the second one as a narrow (8bit) string.
> Replacing with QString::fromLatin1 is the easiest solution keeping
> the code layout the same, joining the strings does work too though.
> 
> 
> Diffs
> -----
> 
>   src/runtime/kwalletd/kwalletd.cpp 5f99f161a0911732c4d46ab36f2e4f3d3f3e3c4b 
> 
> Diff: https://git.reviewboard.kde.org/r/126328/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Patrick Spendrin
> 
>

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


More information about the Kde-frameworks-devel mailing list