Bug 178560

Summary: Some associations can't be removed
Product: [Frameworks and Libraries] kio Reporter: Nicolas L. <kde>
Component: generalAssignee: David Faure <faure>
Status: RESOLVED FIXED    
Severity: normal CC: faure
Priority: NOR    
Version: SVN   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Unspecified   
Latest Commit: Version Fixed In:

Description Nicolas L. 2008-12-23 13:08:52 UTC
Version:            (using Devel)
Installed from:    Compiled sources

test is done in kde 4.1.85


I done a test and tried to remove ark in the interface/x-winamp-skin mimetype.
I removed it but when i clicked on Apply, ark came back and ~/.local/share/applications/mimeapps.list i have :

[Removed Associations]
interface/x-winamp-skin=kde4-ark.desktop;


If i remove the association and in a different session do a kbuildsycoca4, ark come back.
interface/x-winamp-skin is not in ark.desktop files in Mimetypes=
Comment 1 David Faure 2008-12-23 20:05:52 UTC
And I suppose
ktraderclient --mimetype interface/x-winamp-skin | grep DesktopEntryPath
shows ark.desktop, right?

Initially you had simply added ark to this mimetype in the filetypes editor? So somehow ksycoca4 remembers this wrongly. Does "kbuildsycoca4 --noincremental" help?

Please also experiment with changing mimeapps.list by hand, not using the filetypes editor at all, and running kbuildsycoca4 after making changes, and running ktraderclient to see what was recorded.

Here's also a patch to get more debug output from kbuildsycoca4 (in both modes, incremental and noincremental, if noincremental makes a difference).
http://www.davidfaure.fr/tmp/kded_more_debug.diff
To be used like "kbuildsycoca4 2>&1 | tee log".
Comment 2 Nicolas L. 2008-12-23 20:21:16 UTC
ktraderclient --mimetype interface/x-winamp-skin | grep DesktopEntryPath
DesktopEntryPath : '/usr/share/applications/kde4/ark.desktop

No it was already with this mimetypes, i didn't added nothing for this one 

I done a test ( don't know if this can help )

i added an association in interface/x-winamp-skin, i added amarok and i applied. Amarok show OK on the window.
i done your test and got the same result:
ktraderclient --mimetype interface/x-winamp-skin | grep DesktopEntryPath
DesktopEntryPath : '/usr/share/applications/kde4/ark.desktop

Then i tried kbuildsycoca4 --noincremental
and now the previous test give an other result: 

ktraderclient --mimetype interface/x-winamp-skin | grep DesktopEntryPath
DesktopEntryPath : '/usr/share/applications/kde4/amarok.desktop'
DesktopEntryPath : '/usr/share/applications/kde4/ark.desktop'

For the next test i changed in :
interface/x-winamp-skin=kde4-amarok.desktop;kde4-ark.desktop;
into 
interface/x-winamp-skin=kde4-amarok.desktop;kde4-ark.desktop;kde4-konqueror.desktop;
i ran kbuilsycoca4 and nothing changed, i still obtain :

ktraderclient --mimetype interface/x-winamp-skin | grep DesktopEntryPath
DesktopEntryPath : '/usr/share/applications/kde4/amarok.desktop'
DesktopEntryPath : '/usr/share/applications/kde4/ark.desktop'

I am building a new rpm with your patch and then comment here
Comment 3 David Faure 2008-12-23 21:06:03 UTC
SVN commit 900848 by dfaure:

Fix removing an implicit association (derived mimetype) -- a bit like 164584 which had a unit test,
but obviously 178560 was slightly different...
BUG: 178560


 M  +9 -12     kmimeassociations.cpp  
 M  +18 -1     test/kmimeassociationstest.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=900848