mime types and UMS devices

Aran Cox arancox at gmail.com
Fri Oct 16 17:50:51 UTC 2009


I found that there is a handy utility (shipped as a part of the
kdebase-runtime package on my system) called kmimetypefinder.

http://websvn.kde.org/trunk/KDE/kdebase/runtime/kmimetypefinder/kmimetypefinder.cpp?view=markup

kmimetypefinder with the -c option specified does exactly what
UmsHandler.cpp does (calls findByFileContent).  findByFileContent only
looks at the content of the file, not the path so because the
definition for audio/x-flac was only defined by a suffix, it was never
going to match.  kmimetypefinder by default uses findByPath which
allows matches by path name and file content.  When I modified
UmsHandler.cpp to use findByPath it found all my files on my Sansa
including the mp3's that weren't getting matched correctly before and
the flac's.  (Although, clearly the flac definition in
freedesktop.org.xml was incomplete and needed to be fixed anyway.)

I'm of the mind that we should use findByPath() because it solves my problems :)

On a related note, I would really like to use a loopback vfat
filesystem for testing this stuff.  How to I trick amarok into seeing
a directory or other filesystem as something that it would manage as a
UMS device?

I'll attach the patch, although it's trivial.

Cheers!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mimetype.diff
Type: application/octet-stream
Size: 931 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/amarok/attachments/20091016/5020fa2c/attachment.obj>


More information about the Amarok mailing list