* Use const references instead of pointers for the read from/write to

attribute/resource method in locale kit catalogs
 * Only load the embedded catalog if nothing else was found, so it can easily
be overridden
 * Change the resource type to 'CADA' (CAtalog DAta) for embedded catalogs, and
use a hash of the language code as the resource ID. This allows multiple
languages to be stored in the same file and does not interfere with the user
storing his own BMessages as resources.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43057 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Adrien Destugues
2011-11-01 10:13:34 +00:00
parent c87c47960c
commit 1a5c1f9ed5
9 changed files with 88 additions and 78 deletions
+16 -8
View File
@@ -305,11 +305,15 @@ public:
virtual status_t SetData(uint32 id, BMessage* msg);
virtual status_t ReadFromFile(const char* path = NULL);
virtual status_t ReadFromAttribute(entry_ref* appOrAddOnRef);
virtual status_t ReadFromResource(entry_ref* appOrAddOnRef);
virtual status_t ReadFromAttribute(
const entry_ref& appOrAddOnRef);
virtual status_t ReadFromResource(
const entry_ref& appOrAddOnRef);
virtual status_t WriteToFile(const char* path = NULL);
virtual status_t WriteToAttribute(entry_ref* appOrAddOnRef);
virtual status_t WriteToResource(entry_ref* appOrAddOnRef);
virtual status_t WriteToAttribute(
const entry_ref& appOrAddOnRef);
virtual status_t WriteToResource(
const entry_ref& appOrAddOnRef);
virtual void MakeEmpty();
virtual int32 CountItems() const;
@@ -475,11 +479,15 @@ public:
status_t SetData(uint32 id, BMessage* msg);
status_t ReadFromFile(const char* path = NULL);
status_t ReadFromAttribute(entry_ref* appOrAddOnRef);
status_t ReadFromResource(entry_ref* appOrAddOnRef);
status_t ReadFromAttribute(
const entry_ref& appOrAddOnRef);
status_t ReadFromResource(
const entry_ref& appOrAddOnRef);
status_t WriteToFile(const char* path = NULL);
status_t WriteToAttribute(entry_ref* appOrAddOnRef);
status_t WriteToResource(entry_ref* appOrAddOnRef);
status_t WriteToAttribute(
const entry_ref& appOrAddOnRef);
status_t WriteToResource(
const entry_ref& appOrAddOnRef);
void MakeEmpty();
+4 -4
View File
@@ -38,11 +38,11 @@ class DefaultCatalog : public BHashMapCatalog {
// implementation for editor-interface:
status_t ReadFromFile(const char *path = NULL);
status_t ReadFromAttribute(entry_ref *appOrAddOnRef);
status_t ReadFromResource(entry_ref *appOrAddOnRef);
status_t ReadFromAttribute(const entry_ref &appOrAddOnRef);
status_t ReadFromResource(const entry_ref &appOrAddOnRef);
status_t WriteToFile(const char *path = NULL);
status_t WriteToAttribute(entry_ref *appOrAddOnRef);
status_t WriteToResource(entry_ref *appOrAddOnRef);
status_t WriteToAttribute(const entry_ref &appOrAddOnRef);
status_t WriteToResource(const entry_ref &appOrAddOnRef);
status_t SetRawString(const CatKey& key, const char *translated);
void SetSignature(const entry_ref &catalogOwner);
+4 -4
View File
@@ -90,15 +90,15 @@ class BHashMapCatalog: public BCatalogAddOn {
// implementation for editor-interface
virtual status_t ReadFromFile(const char *path = NULL)
{return B_NOT_SUPPORTED;}
virtual status_t ReadFromAttribute(entry_ref *appOrAddOnRef)
virtual status_t ReadFromAttribute(const entry_ref &appOrAddOnRef)
{return B_NOT_SUPPORTED;}
virtual status_t ReadFromResource(entry_ref *appOrAddOnRef)
virtual status_t ReadFromResource(const entry_ref &appOrAddOnRef)
{return B_NOT_SUPPORTED;}
virtual status_t WriteToFile(const char *path = NULL)
{return B_NOT_SUPPORTED;}
virtual status_t WriteToAttribute(entry_ref *appOrAddOnRef)
virtual status_t WriteToAttribute(const entry_ref &appOrAddOnRef)
{return B_NOT_SUPPORTED;}
virtual status_t WriteToResource(entry_ref *appOrAddOnRef)
virtual status_t WriteToResource(const entry_ref &appOrAddOnRef)
{return B_NOT_SUPPORTED;}
void UpdateFingerprint();