[Kourse 3] Fixing krazy2 issues
Philipp Klaffert
pklaffert at googlemail.com
Thu Jan 15 16:23:23 CET 2009
Hi Dominik,
thanks for your reply and for the link. For fixing the krazy2 issues
correctly I changed QString to QLatin1String. I understand your point of
view with "readability" but I won't decide which way is better. I think the
explicit conversion of these Strings makes the understanding of the code not
so much harder...
You can find the modified patch in the attachment.
2009/1/15 Dominik Haumann <dhdev at gmx.de>
> Hi Philipp,
>
> On Thursday 15 January 2009, Philipp Klaffert wrote:
> > @@ -54,7 +53,7 @@
> > return true;
> > }
> >
> > - if (!name.startsWith("Timeline:") &&
> > !name.startsWith("TimelineWithFriends:") &&
> > !name.startsWith("Profile:")) {
> > + if
> > (!name.startsWith(QString("Timeline:")) &&
> > !name.startsWith(QString("TimelineWithFriends:")) &&
> > !name.startsWith(QString("Profile:"))) { return false;
> > }
>
> This is also what implicitly happens: const char* is implicitely converted
> to a QString. The right way is afaik to use QLatin1String, see also
> http://doc.trolltech.com/latest/qlatin1string.html for a better
> explanation :)
>
> And then, such optimizations should only be used in time critical cases, as
> the readability decreases when wrapping all strings (more text to read).
> But that's just my personal opinion, and maybe that's always the case in
> plasma - I don't know the preferred way here.
>
> Hope this helps :)
> Dominik
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/plasma-devel/attachments/20090115/e3d7d65f/attachment-0001.htm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 6116 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20090115/e3d7d65f/attachment-0001.bin
More information about the Plasma-devel
mailing list