TextSnifferAddon: Use MIME DB directly
A DatabaseLocation is passed to the constructor and used to verify that the sniffed MIME type is installed instead of BMimeType::IsInstalled(). This makes the add-on independent of the default MIME DB.
This commit is contained in:
@@ -14,9 +14,13 @@ namespace Storage {
|
||||
namespace Mime {
|
||||
|
||||
|
||||
class DatabaseLocation;
|
||||
|
||||
|
||||
class TextSnifferAddon : public BMimeSnifferAddon {
|
||||
public:
|
||||
TextSnifferAddon();
|
||||
TextSnifferAddon(
|
||||
DatabaseLocation* databaseLocation);
|
||||
virtual ~TextSnifferAddon();
|
||||
|
||||
virtual size_t MinimalBufferSize();
|
||||
@@ -26,6 +30,9 @@ public:
|
||||
virtual float GuessMimeType(BFile* file,
|
||||
const void* buffer, int32 length,
|
||||
BMimeType* type);
|
||||
|
||||
private:
|
||||
DatabaseLocation* fDatabaseLocation;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user