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

David Rosca nowrep at gmail.com
Thu Oct 22 10:47:12 UTC 2015



> On Oct. 22, 2015, 7:30 a.m., David Faure wrote:
> > src/widgets/kopenwithdialog.cpp, line 911
> > <https://git.reviewboard.kde.org/r/125691/diff/1/?file=411558#file411558line911>
> >
> >     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?

Yes, saveNewApps is true and no remember checkbox is visible. 
It calls the addToMimeAppsList and then it hits assert there.


- David


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


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/6e2dfaa8/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list