doubled entries in ksycoca?

David Faure faure at kde.org
Sat Jun 28 01:55:40 BST 2008


On Friday 27 June 2008, Christian Ehrlicher wrote:
> Hi,
> 
> while trying to fix ksyscocatest on windows I found a problem in my 
> ksycoca cache. Some entries doubled.
> Digging a little bit deeper I found out that the doubles are written in
> KBuildMimeTypeFactory::savePatternLists() --> m_fastPatternDict->save(str)
> 
> I added some debug output:
> 
> keyStr offset &payload
> "asc" 78230 0x1e7ef58
> "asc" 82709 0x1ea07f8
> "asc" 82709 0x1eb2610
> "asc" 127207 0x1e17c48

Yes, this simply means you have multiple mimetypes associated with the same pattern *.asc.
Same here:
KBuildMimeTypeFactory::savePatternLists: mimeType "application/pgp-keys" has patterns ("*.skr", "*.asc", "*.pkr")
KBuildMimeTypeFactory::savePatternLists: mimeType "text/plain" has patterns ("*.asc", "*.txt", "*.doc")
KBuildMimeTypeFactory::savePatternLists: mimeType "application/pgp-encrypted" has patterns ("*.asc", "*.gpg","*.pgp")

I added support for KSycocaDict being used as a multihash (multiple instances of a key), when I wrote
the shared-mime-info support, see KSycocaDict::findMultiString.
And this is indeed what KMimeTypeFactory::findFromFastPatternDict uses, to get all mimetypes matching a given extension.
After that, KMimeType::findByUrlHelper chooses between those mimetypes by using sniffing.
I still have to implement the support for the new pattern (=glob) priority concept from shared-mime-info,
but it's pointless to do so before more people actually have an updated shared-mime-info :)

-- 
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