By default, Bugzilla does not search the list of RESOLVED bugs.
You can force it to do so by putting the upper-case word ALL in front of your search query, e.g.: ALL tdelibs
We recommend searching for bugs this way, as you may discover that your bug has already been resolved and fixed in a later release.

Bug 2158

Summary: TDE lists virtualbox vdi files as Unknown in Konqueror
Product: TDE Reporter: Darrell <darrella>
Component: tdelibsAssignee: Timothy Pearson <kb9vqf>
Status: RESOLVED NOTOURPROBLEM    
Severity: normal CC: bugwatch, darrella, kb9vqf
Priority: P5    
Version: R14.0.0 [Trinity]   
Hardware: Other   
OS: Linux   
Compiler Version: TDE Version String:
Application Version: Application Name:

Description Darrell 2014-10-11 18:26:00 CDT
Virtualbox installs /usr/share/mime/packages/virtualbox.xml, which I believe is then used to populate /usr/share/mime/application, which then contains x-virtualbox.xml. In Konqueror, vdi files should be listed as Virtual Disk Image. This does not happen in TDE.

On the same system, KDE4 Dolphin and Konqueror, and Xfce Thunar, correctly list the vdi files.
Comment 1 Timothy Pearson 2014-10-11 18:30:34 CDT
What does 'file --mime-type' have to say about the .vdi file?
Comment 2 Darrell 2014-10-12 10:05:14 CDT
>What does 'file --mime-type' have to say about the .vdi file?
application/octet-stream
Comment 3 Timothy Pearson 2014-10-12 11:50:09 CDT
(In reply to Darrell from comment #2)
> >What does 'file --mime-type' have to say about the .vdi file?
> application/octet-stream

If file(1) can't identify the file TDE can't either.  It looks like this was fixed upstream in late 2011:
http://thr3ads.net/libguestfs/2011/11/1624013-file-PATCH-Properly-detect-.vdi-VirtualBox-disk-image-files

Tim
Comment 4 Darrell 2014-10-12 11:52:19 CDT
So what are other file managers or desktops doing that allows correct detection?
Comment 5 Timothy Pearson 2014-10-12 12:05:12 CDT
No idea.  I do know KDE uses QMimeMagic, so you could start digging in the Qt4/Qt5 sources to see if they embed a specific libmagic version or if they have someone backporting patches from the libmagic database into a Qt-specific database.

In any case we don't have the manpower to maintain a fork of libmagic; over time that will decay and we'll end up right back where we were with an obsolete embedded libmagic version that gives consistently bad results.  We *might* be able to backport some of the magic definitions into a KDE-specific database; even better would be if Qt is doing the backporting for us, in that case we could just track the Qt definition file.

Let me know what you find!
Comment 6 Darrell 2014-10-13 10:45:45 CDT
I tested Cinnamon Nemo, Mate Caja, GNOME Files, and Xfe. Nemo listed vdi files as Unknown, Caja correctly as disk images, Files as Binary, and Xfe as Document.

Searching around the web seems to indicate that xml files installed to /usr/share/mime/packages are parsed through the update-mime-database mechanism. Installing xml files to /usr/share/mime/packages is intended to be a mechanism for adding unique mime types. The resulting mime cache is stored in /usr/share/mime/. This mime cache is supposed to compliment other detection mechanisms.

I don't pretend to understand the mime mechanism on a 'nix system, but as update-mime-database is run on most systems daily and along with package installations, the problem would seem to be that the failing file managers are not querying the /usr/share/mime/ cache, including TDE Konqueror.
Comment 7 Timothy Pearson 2014-10-13 11:21:58 CDT
That doesn't explain why file(1) isn't working though.  In any case it looks like several other file managers are failing as well, and from the results it would seem that Nemo is using libmagic as well.

As far as I understand the mime-database is a systemwide repository of mime *types*, not mime magic rules.  As libmagic fails the first step (detection of type via magic rules), we don't even get to the second step (parsing of mime definition files, in our case via a built-in mime database comprised of .desktop files).