[Kde-games-devel] Review Request 126383: Use of QScopedPointer for avoiding crashy dialogs.
Christian Ehrlicher
ch.ehrlicher at gmx.de
Thu Dec 17 08:43:56 UTC 2015
> On Dez. 16, 2015, 5:05 nachm., Christian Ehrlicher wrote:
> > I'm sorry but this is still wrong. Did you read this blog: https://blogs.kde.org/node/3919
> > You somehow have to notice the the dialog gets deleted during exec(). This is only possible with a QPointer. After exec() when you want to access the pointer, you've to check if the QPointer is null before accesing them:
> >
> > QPointer<KNS3::DownloadDialog> dialog(new KNS3::DownloadDialog(q));
> > dialog->exec();
> > if (dialog)
> > {
> > dialog->getValues();
> > }
> > delete dialog;
>
> Frederik Schwarzer wrote:
> No need to be sorry. I put this here to get this kind of feedback. :)
>
> So, if I get this right (also the content of the page you linked to) your critisism is not against the ScopedPointer itself but against how I used it.
> Because QScopedPointer also has the bool overload and can be used in if conditions.
>
> QScopedPointer<KNS3::DownloadDialog> dialog(new KNS3::DownloadDialog(q));
> dialog->exec();
> if (dialog && !dialog->changedEntries().isEmpty())
> {
> m_provider->rediscoverThemes();
> fillList();
> }
>
> Seems to be alright?
Yes, that's correct :)
- Christian
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/126383/#review89612
-----------------------------------------------------------
On Dez. 16, 2015, 11:33 vorm., Frederik Schwarzer wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/126383/
> -----------------------------------------------------------
>
> (Updated Dez. 16, 2015, 11:33 vorm.)
>
>
> Review request for KDE Games.
>
>
> Repository: libkdegames
>
>
> Description
> -------
>
> I recently found out about QScopedPointer and thought it might be a good thing to use instead of QPointer in many cases.
> So I tested it with two crashy dialogs in libkdegames.
> Please comment in case I forgot to think about something.
>
>
> Diffs
> -----
>
> kgthemeselector.cpp 9cd9c61
> libkdegamesprivate/kgamethemeselector.cpp ce3cf1f
>
> Diff: https://git.reviewboard.kde.org/r/126383/diff/
>
>
> Testing
> -------
>
> Used the KNS3 dialog in Kigo.
>
>
> Thanks,
>
> Frederik Schwarzer
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-games-devel/attachments/20151217/4104bc0f/attachment.html>
More information about the kde-games-devel
mailing list