Review Request 128581: Make the default KMessageBoxDontAskAgainMemoryStorage save to QSettings

David Faure faure at kde.org
Fri Aug 5 09:51:59 UTC 2016



> On Aug. 5, 2016, 8:23 a.m., David Faure wrote:
> > src/kmessagebox_p.cpp, line 40
> > <https://git.reviewboard.kde.org/r/128581/diff/3/?file=473043#file473043line40>
> >
> >     space after foreach -- or use range for
> 
> Mark Gaiser wrote:
>     You don't want to do range for on Qt containers.
>     Rule of thumb: range-for on stl containers, foreach on Qt containers.
>     
>     There are exceptions, like when the Qt container is const (which it isn't in this case), then you can use range-for. In all other cases it detaches and makes a copy.
>     Qt 5.7 added qAsConst specifically to make range-for work on Qt containers without detaching: http://doc.qt.io/qt-5/qtglobal.html#qAsConst

Yep, that's all exactly what I used to say, too.

And nowadays Qt uses range-for everywhere :-)

Detaching happens when the container isn't const *and* there is another reference to it, which isn't the case here [but ok, I can only know this because I know QSettings doesn't store the list of keys into a member variable].

But yeah, I'm certainly fine with foreach for now, until the Qt-5.7 way is more widely spread (i.e. when we require 5.7).


- David


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


On Aug. 4, 2016, 10:40 p.m., Albert Astals Cid wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/128581/
> -----------------------------------------------------------
> 
> (Updated Aug. 4, 2016, 10:40 p.m.)
> 
> 
> Review request for KDE Frameworks, Christoph Feck, David Faure, and Kevin Ottens.
> 
> 
> Repository: kwidgetsaddons
> 
> 
> Description
> -------
> 
> Otherwise if you don't have the framework integration plugin installed, the messageboxes appear again and again and again even if the user continuously clicks "Don't show again".
> 
> See "KMessageBox runtime dependency on FrameworkIntegrationPlugin makes it useless" thread in kde-frameworks-devel mailing list for more information.
> 
> 
> Diffs
> -----
> 
>   src/kmessagebox_p.cpp 896cdb7 
> 
> Diff: https://git.reviewboard.kde.org/r/128581/diff/
> 
> 
> Testing
> -------
> 
> Tried rsibreak without the framework integration plugin, worked.
> 
> 
> Thanks,
> 
> Albert Astals Cid
> 
>

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


More information about the Kde-frameworks-devel mailing list