[interfacekit] Re: MimeDatabase News

  • From: "Ingo Weinhold" <bonefish@xxxxxxxxxxxxxxx>
  • To: interfacekit@xxxxxxxxxxxxx
  • Date: Fri, 30 Aug 2002 22:24:43 CEST (+0200)

> I'm in a bit of a rush, but here's a quick update:
> 
> BMimeType::GetSupportingApps() should be working now. I did nearly as 
> simple an implementation as possible, which means creating the 
> supporting apps table from the database on the first 
> GetSupportingApps() call, then maintaing said database in memory as 
> SetSupportedTypes() calls are made. It passes all the previous tests 
> we 
> had written (though I need to make the tests a bit more rigorous with 
> some SetSupportedTypes() calls in there), and furthermore, it appears 
> to be noticably faster than the R5 implementation. As this surprises 
> me 
> a bit, I plan to double-check that I'm not missing something at some 
> point, but here's hoping (actually, I just realized 
> SetSupportedTypes(NULL) is not implemented, but I will do that 
> shortly, 
> and it's not relevant to the current tests anyway :-).

I had to fix a few things in order to make 
BAppFileInfo::SetSupportedType() work properly, e.g. 
Database::SetSupportedTypes() now installs the not yet installed 
supported types.

> I'm not currently using the __mime_table file for anything, as it 
> contains only redundant information (correct?) and I figured we'd see 
> if a simpler implementation would be fast enough. So far, it looks 
> okay 
> to me, but perhaps we'll think of some reason later as to why we 
> might 
> still want to use a __mime_table file.

Mmh, in fact the first call to BMimeType::GetSupportingApps() blocks 
for a moment -- maybe 0.5 - 1 second on my machine.

> SetSupportedTypes() now takes a "bool fullSync" parameter analogous 
> to 
> BAppFileInfo's "bool sync_all" parameter. I need to write some tests 
> up 
> for this function as well.
> 
> Ingo, can you get rid of the B_REG_MIME_UNSUPPORT_TYPE constant once 
> you update BAppFileInfo to use the updated SetSupportedTypes()?

Done.

> I believe this leaves the MIME sniffer and C functions as far as 
> BMimeType is concerned. Up next for me is some polishing on all the 
> recent mime database stuff, plus the tests I mentioned.

For get_device_icon() you can reuse code from CheckIconData() in 
MimeTypeTest.cpp.

> Also, I'm moving to a new apartment over the course of the next week 
> or 
> so, so I may take a slight break, or at least a cutback, from OBOS 
> work 
> until I get resettled.

Have fun. Er, as much fun as one can have when moving, I mean. ;-)

CU, Ingo



Other related posts: