Change Path() to GetPath(), and made it accept a reference instead of

a pointer. Style changes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38260 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini
2010-08-19 03:57:58 +00:00
parent 1e7a45fd7a
commit 2aef272550
2 changed files with 12 additions and 13 deletions
+1 -1
View File
@@ -83,7 +83,7 @@ public:
bool delete_when_done = false); bool delete_when_done = false);
private: private:
status_t Path(BPath* path) const; status_t GetPath(BPath& path) const;
status_t Load(BMessage*); status_t Load(BMessage*);
int32 fId; int32 fId;
+11 -12
View File
@@ -200,7 +200,7 @@ BMailChain::Instantiate(BMessage* archive)
status_t status_t
BMailChain::Path(BPath* path) const BMailChain::GetPath(BPath& path) const
{ {
status_t status = find_directory(B_USER_SETTINGS_DIRECTORY,path); status_t status = find_directory(B_USER_SETTINGS_DIRECTORY,path);
if (status < B_OK) { if (status < B_OK) {
@@ -209,16 +209,16 @@ BMailChain::Path(BPath* path) const
return status; return status;
} }
path->Append("Mail/chains"); path.Append("Mail/chains");
if (ChainDirection() == outbound) if (ChainDirection() == outbound)
path->Append("outbound"); path.Append("outbound");
else else
path->Append("inbound"); path.Append("inbound");
BString leaf; BString leaf;
leaf << fId; leaf << fId;
path->Append(leaf.String()); path.Append(leaf.String());
return B_OK; return B_OK;
} }
@@ -227,10 +227,8 @@ BMailChain::Path(BPath* path) const
status_t status_t
BMailChain::Save(bigtime_t /*timeout*/) BMailChain::Save(bigtime_t /*timeout*/)
{ {
status_t ret;
BMessage archive; BMessage archive;
ret = Archive(&archive,true); status_t ret = Archive(&archive, true);
if (ret != B_OK) { if (ret != B_OK) {
fprintf(stderr, "Couldn't archive chain %ld: %s\n", fprintf(stderr, "Couldn't archive chain %ld: %s\n",
fId, strerror(ret)); fId, strerror(ret));
@@ -238,14 +236,15 @@ BMailChain::Save(bigtime_t /*timeout*/)
} }
BPath path; BPath path;
if ((ret = Path(&path)) < B_OK) if ((ret = GetPath(path)) < B_OK)
return ret; return ret;
BPath directory; BPath directory;
if ((ret = path.GetParent(&directory)) < B_OK) if ((ret = path.GetParent(&directory)) < B_OK)
return ret; return ret;
return MailInternal::WriteMessageFile(archive,directory,path.Leaf()/*,timeout*/); return MailInternal::WriteMessageFile(archive, directory,
path.Leaf()/*, timeout*/);
} }
@@ -254,7 +253,7 @@ BMailChain::Delete() const
{ {
status_t status; status_t status;
BPath path; BPath path;
if ((status = Path(&path)) < B_OK) if ((status = GetPath(path)) < B_OK)
return status; return status;
BEntry entry(path.Path()); BEntry entry(path.Path());
@@ -466,7 +465,7 @@ status_t
BMailChain::AddFilter(int32 index, const BMessage& settings, BMailChain::AddFilter(int32 index, const BMessage& settings,
const entry_ref& addon) const entry_ref& addon)
{ {
BMessage*s = new BMessage(settings); BMessage* s = new BMessage(settings);
entry_ref* a = new entry_ref(addon); entry_ref* a = new entry_ref(addon);
if (!fFilterSettings.AddItem(s, index)) { if (!fFilterSettings.AddItem(s, index)) {