[PATCH] Fix assert conditions in KOpenWithDialog

David Faure faure at kde.org
Thu Jun 26 11:04:15 BST 2008


On Thursday 26 June 2008, Will Stephenson wrote:
> While looking for the cause of #164888 I found that it is possible to get 
> KOpenWithDialog to assert from 'kcmshell4 filetypes' while creating a new 
> service type (enter the path to an app instead of choosing an existing one) by 
> cancelling the kbuildsycoca run.  This means that the following 
> KService::serviceByStorageById() call returns 0, causing the assert.
> 
> The attached patch detects this case and reverts any changes to mimeapps.list 
> and filetypesrc, and makes the dialog return Rejected.

But how can you be sure that you're not reverting earlier changes that -were- confirmed?
For instance:
+    fileTypesConfig->group("EmbedSettings").revertToDefault(QString("embed-")+qMimeType);
The user might have configured embed-text/plain in kcmfiletypes a month ago, and this would revert it
just because he cancelled a dialog today. I think this part should just be omitted. Once you press OK
you have already confirmed that you don't want this mimetype to be embedded anymore.

I like the rest though.

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).




More information about the kde-core-devel mailing list