> On May 27, 2014, 10:36 p.m., Kai Uwe Broulik wrote: > > src/plasmaquick/dialog.cpp, line 800 > > <https://git.reviewboard.kde.org/r/118361/diff/1/?file=275561#file275561line800> > > > > Isn't comparison more efficient using QLatin1String? > > Martin Klapetek wrote: > Last time I've heard it's not anymore in Qt5 thanks to > QStringLiteral...is it still? > > David Edmundson wrote: > Kai is right. > QStringLiteral is just a better replacement for QString::fromUtf8 > > http://woboq.com/blog/qstringliteral.html > > Martin Klapetek wrote: > That's not true - QStringLiteral is a macro that generates the (q)string > at compile time, so in the code there's no QString (and QStringData) > allocation just for the comparison. So basically it's like comparing > "a->objectName() == b->objectName()", two already allocated (UTF8) strings.
However, the reason for why to use QLatin1String in comparisons (still) is that then it performs ascii comparison --> less memory as opposed to UTF16 (QString(Literal) default which is 2 bytes per char) and can be faster too (only because it has to compare about half the bytes compared to full QString). I'll change this to QL1String in the commit. - Martin ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/118361/#review58609 ----------------------------------------------------------- On May 27, 2014, 9:13 p.m., Martin Klapetek wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://git.reviewboard.kde.org/r/118361/ > ----------------------------------------------------------- > > (Updated May 27, 2014, 9:13 p.m.) > > > Review request for Plasma. > > > Repository: plasma-framework > > > Description > ------- > > When plasmoid in a popup is opening a QMenu, the popup itself hides because > it looses focus. This patch fixes it. > > > Diffs > ----- > > src/plasmaquick/dialog.cpp d8e263c > > Diff: https://git.reviewboard.kde.org/r/118361/diff/ > > > Testing > ------- > > > Thanks, > > Martin Klapetek > >
_______________________________________________ Plasma-devel mailing list Plasma-devel@kde.org https://mail.kde.org/mailman/listinfo/plasma-devel