+ Added SetSupportedTypes() test
+ Modified BMimeType::SetSupportedTypes functionality so it keeps track of stranded types (i.e. previously supported types that have not had the now unsupporting app signature removed from their supporting apps list yet due to a false fullSync parameter) over consecutive SetSupportedTypes(..., false) calls and updates all appropriate stranded types on the next SetSupportedTypes(..., true) call. + Added fullSync parameter to BMimeType::DeleteSupportedTypes + Made BMimeType::Delete() do a DeleteSupportedTypes(..., true) call to properly update the supporting apps lists when a mime type is deleted. + Added initial BMimeType::Get/SetSnifferRule + Updated BMimeType::CheckSnifferRule() to return B_BAD_VALUE when passed a NULL rule string. + Brought CheckSnifferRule() tests up to date + Added lots of Mime::Database doxygen + Added any missing mime monitor notifications in Mime::Database + Possibly made some other changes as well... :-) git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1004 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -49,7 +49,7 @@ public:
|
||||
status_t SetIconForType(const char *type, const char *fileType, const void *data,
|
||||
size_t dataSize, icon_size which);
|
||||
status_t SetPreferredApp(const char *type, const char *signature, app_verb verb = B_OPEN);
|
||||
// status_t SetSnifferRule(const char *);
|
||||
status_t SetSnifferRule(const char *type, const char *rule);
|
||||
status_t SetSupportedTypes(const char *type, const BMessage *types, bool fullSync);
|
||||
|
||||
// Non-atomic Get()
|
||||
@@ -80,7 +80,7 @@ public:
|
||||
status_t DeleteIconForType(const char *type, const char *fileType, icon_size which);
|
||||
status_t DeletePreferredApp(const char *type, app_verb verb = B_OPEN);
|
||||
status_t DeleteSnifferRule(const char *type);
|
||||
status_t DeleteSupportedTypes(const char *type);
|
||||
status_t DeleteSupportedTypes(const char *type, bool fullSync);
|
||||
|
||||
private:
|
||||
status_t SendInstallNotification(const char *type);
|
||||
|
||||
@@ -28,7 +28,9 @@ public:
|
||||
~SupportingApps();
|
||||
|
||||
status_t GetSupportingApps(const char *type, BMessage *apps);
|
||||
|
||||
status_t SetSupportedTypes(const char *app, const BMessage *types, bool fullSync);
|
||||
status_t DeleteSupportedTypes(const char *app, bool fullSync);
|
||||
private:
|
||||
status_t AddSupportingApp(const char *type, const char *app);
|
||||
status_t RemoveSupportingApp(const char *type, const char *app);
|
||||
@@ -37,6 +39,8 @@ private:
|
||||
|
||||
std::map<std::string, std::set<std::string> > fSupportedTypes; // app sig => set of supported types
|
||||
std::map<std::string, std::set<std::string> > fSupportingApps; // mime type => set of supporting apps
|
||||
std::map<std::string, std::set<std::string> > fStrandedTypes; // app sig => set of no longer supported types for whom the
|
||||
// given app is still listed as a supporting app
|
||||
bool fHaveDoneFullBuild;
|
||||
};
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ status_t get_icon(const char *type, BBitmap *icon, icon_size size);
|
||||
status_t get_icon_for_type(const char *type, const char *fileType, BBitmap *icon,
|
||||
icon_size which);
|
||||
status_t get_preferred_app(const char *type, char *signature, app_verb verb);
|
||||
status_t get_sniffer_rule(BString *result);
|
||||
status_t get_sniffer_rule(const char *type, BString *result);
|
||||
status_t get_supported_types(const char *type, BMessage *types);
|
||||
|
||||
bool is_installed(const char *type);
|
||||
|
||||
Reference in New Issue
Block a user