Review Request 118649: Work around null return value of QApplication::clipboard()->mimeData() on Wayland

Emmanuel Pescosta emmanuelpescosta099 at gmail.com
Tue Jun 10 22:41:43 BST 2014


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


Looks pretty good, I'll test it tomorrow!


dolphin/src/kitemviews/private/kfileitemclipboard.cpp
<https://git.reviewboard.kde.org/r/118649/#comment41636>

    const QMimeData* mimeData = QApplication::clipboard()->mimeData();
    if (!mimeData) {
       m_cutItems.clear();
       return;
    }
    
    IMHO it is much more obvious that a valid mimeData pointer is needed to perform this operation and it also makes the code easier to read (no nested isCutSelection assignment).
    
    What do you think? ;)


- Emmanuel Pescosta


On June 10, 2014, 10:21 p.m., Frank Reininghaus wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/118649/
> -----------------------------------------------------------
> 
> (Updated June 10, 2014, 10:21 p.m.)
> 
> 
> Review request for Dolphin.
> 
> 
> Bugs: 335053
>     http://bugs.kde.org/show_bug.cgi?id=335053
> 
> 
> Repository: kde-baseapps
> 
> 
> Description
> -------
> 
> This is a follow-up to https://git.reviewboard.kde.org/r/118450/
> 
> It seems that Qt's clipboard support is broken on Wayland - according to the bug report, the return value of QApplication::clipboard()->mimeData() on Wayland.
> 
> This patch adds safety checks to work around this problem and ensure that Dolphin does not crash on startup.
> 
> Even though only frameworks is affected AFAIK, I still think that it makes sense to have this in master as well because it simplifies the code a bit and makes "Paste into folder" work for non-file data.
> 
> 
> Diffs
> -----
> 
>   dolphin/src/dolphincontextmenu.cpp f295de7 
>   dolphin/src/kitemviews/private/kfileitemclipboard.cpp faace2a 
>   dolphin/src/panels/folders/treeviewcontextmenu.cpp fa8844d 
> 
> Diff: https://git.reviewboard.kde.org/r/118649/diff/
> 
> 
> Testing
> -------
> 
> I cannot test if the patch fixes the Wayland crash, but I checked that updating the "cut" state of items in the view still works, and that the "Paste" action is updated and works as expected in the context menus.
> 
> 
> Thanks,
> 
> Frank Reininghaus
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20140610/cdf51acb/attachment.htm>


More information about the kfm-devel mailing list