Review Request 125691: KOpenWithDialog: Fix creating desktop file with empty mimetype

David Faure faure at kde.org
Thu Oct 22 07:30:19 UTC 2015


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



src/widgets/kopenwithdialog.cpp (line 911)
<https://git.reviewboard.kde.org/r/125691/#comment59926>

    How about changing this condition to
       (...) && !qMimeType.isEmpty() ?
       
    If there is no mimetype to "remember" then there is little point in creating a .desktop file in the first place, right?
    
    And this avoids yet another code path at the end with the "else" you had to add.
    
    Actually... if mimetype is empty, then bRemember has to be false (the checkbox isn't even shown). So I suppose createDesktopFile is true because saveNewApps is true?
    
    Or is there a problem of isNull vs isEmpty in line 676?


- David Faure


On Oct. 18, 2015, 4:09 p.m., David Rosca wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/125691/
> -----------------------------------------------------------
> 
> (Updated Oct. 18, 2015, 4:09 p.m.)
> 
> 
> Review request for KDE Frameworks.
> 
> 
> Repository: kio
> 
> 
> Description
> -------
> 
> If qMimeType is empty, addToMimeAppsList shouldn't be called.
> 
> 
> Diffs
> -----
> 
>   src/widgets/kopenwithdialog.cpp c60a193 
> 
> Diff: https://git.reviewboard.kde.org/r/125691/diff/
> 
> 
> Testing
> -------
> 
> opening new KOpenWithDialog() without mimeType and typing eg "dolphin" to exec line now correctly returns valid KService.
> 
> 
> Thanks,
> 
> David Rosca
> 
>

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


More information about the Kde-frameworks-devel mailing list