Review Request 115517: Do not crash if there is no QMimeData in decodeIsCutSelection
Alex Merry
kde at randomguy3.me.uk
Thu Feb 6 13:32:51 UTC 2014
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/115517/#review49126
-----------------------------------------------------------
I think the tests would make more sense at the calling sites. KFilePreviewGenerator::Private::applyCutItemEffect, in particular, also passes the mimeData to KUrlMimeData::urlsFromMimeData later in the function (which must not be 0). It then depends on decodeIsCutSelection always returning false when passed 0 to not crash later.
I mean, your way works, but I think moving the test to the calling sites is more resilient to future code changes.
- Alex Merry
On Feb. 6, 2014, 1:18 p.m., Martin Gräßlin wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/115517/
> -----------------------------------------------------------
>
> (Updated Feb. 6, 2014, 1:18 p.m.)
>
>
> Review request for KDE Frameworks and David Faure.
>
>
> Repository: kio
>
>
> Description
> -------
>
> Do not crash if there is no QMimeData in decodeIsCutSelection
>
> On Wayland the QMimeData is null and thus the Open File dialog
> crashed when trying to enter a directory.
>
>
> Diffs
> -----
>
> src/filewidgets/kfilepreviewgenerator.cpp cdc18a18508eceb58b9fbcad9b68b47bf534996c
>
> Diff: https://git.reviewboard.kde.org/r/115517/diff/
>
>
> Testing
> -------
>
> Kate on Wayland can open files now: http://paste.opensuse.org/79557635
>
>
> Thanks,
>
> Martin Gräßlin
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20140206/9a643933/attachment.html>
More information about the Kde-frameworks-devel
mailing list