Good deal of hackery to get update_mime_info() to work on the host

platform to the extend we need it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16129 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2006-01-28 22:00:16 +00:00
parent 58b53fd940
commit 15285cb04d
9 changed files with 121 additions and 191 deletions
+5
View File
@@ -109,6 +109,11 @@ public:
/* Deprecated Use SetTo instead. */
status_t SetType(const char *mimeType);
static status_t GuessMimeType(const entry_ref *file, BMimeType *type);
static status_t GuessMimeType(const void *buffer, int32 length,
BMimeType *type);
static status_t GuessMimeType(const char *filename, BMimeType *type);
private:
BMimeType(const char *mimeType, const char *mimePath);
// if mimePath is NULL, defaults to "/boot/home/config/settings/beos_mime/"
@@ -18,8 +18,9 @@ namespace Mime {
class CreateAppMetaMimeThread : public MimeUpdateThread {
public:
CreateAppMetaMimeThread(const char *name, int32 priority, BMessenger managerMessenger,
const entry_ref *root, bool recursive, bool force, BMessage *replyee);
CreateAppMetaMimeThread(const char *name, int32 priority,
BMessenger managerMessenger, const entry_ref *root, bool recursive,
int32 force, BMessage *replyee);
status_t DoMimeUpdate(const entry_ref *entry, bool *entryIsDir);
};
@@ -11,7 +11,7 @@
#define _MIME_UPDATE_THREAD_H
#include <Entry.h>
#include <RegistrarThread.h>
//#include <RegistrarThread.h>
#include <SupportDefs.h>
#include <list>
@@ -24,21 +24,24 @@ namespace BPrivate {
namespace Storage {
namespace Mime {
class MimeUpdateThread : public RegistrarThread {
class MimeUpdateThread /*: public RegistrarThread*/ {
public:
MimeUpdateThread(const char *name, int32 priority, BMessenger managerMessenger,
const entry_ref *root, bool recursive, bool force, BMessage *replyee);
MimeUpdateThread(const char *name, int32 priority,
BMessenger managerMessenger, const entry_ref *root, bool recursive,
int32 force, BMessage *replyee);
virtual ~MimeUpdateThread();
virtual status_t InitCheck();
status_t DoUpdate() { return ThreadFunction(); }
protected:
virtual status_t ThreadFunction();
virtual status_t DoMimeUpdate(const entry_ref *entry, bool *entryIsDir) = 0;
const entry_ref fRoot;
const bool fRecursive;
const bool fForce;
const int32 fForce;
BMessage *fReplyee;
bool DeviceSupportsAttributes(dev_t device);
@@ -18,8 +18,9 @@ namespace Mime {
class UpdateMimeInfoThread : public MimeUpdateThread {
public:
UpdateMimeInfoThread(const char *name, int32 priority, BMessenger managerMessenger,
const entry_ref *root, bool recursive, bool force, BMessage *replyee);
UpdateMimeInfoThread(const char *name, int32 priority,
BMessenger managerMessenger, const entry_ref *root, bool recursive,
int32 force, BMessage *replyee);
status_t DoMimeUpdate(const entry_ref *entry, bool *entryIsDir);
};