From 2aef2725504d979c95f66cbd96a04c9127d8829d Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Thu, 19 Aug 2010 03:57:58 +0000 Subject: [PATCH] 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 --- headers/os/mail/MailSettings.h | 2 +- src/kits/mail/MailChain.cpp | 23 +++++++++++------------ 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/headers/os/mail/MailSettings.h b/headers/os/mail/MailSettings.h index e2413cd4bb..b5248e7e9f 100644 --- a/headers/os/mail/MailSettings.h +++ b/headers/os/mail/MailSettings.h @@ -83,7 +83,7 @@ public: bool delete_when_done = false); private: - status_t Path(BPath* path) const; + status_t GetPath(BPath& path) const; status_t Load(BMessage*); int32 fId; diff --git a/src/kits/mail/MailChain.cpp b/src/kits/mail/MailChain.cpp index b86ac93513..6928d3ef11 100644 --- a/src/kits/mail/MailChain.cpp +++ b/src/kits/mail/MailChain.cpp @@ -200,7 +200,7 @@ BMailChain::Instantiate(BMessage* archive) status_t -BMailChain::Path(BPath* path) const +BMailChain::GetPath(BPath& path) const { status_t status = find_directory(B_USER_SETTINGS_DIRECTORY,path); if (status < B_OK) { @@ -209,16 +209,16 @@ BMailChain::Path(BPath* path) const return status; } - path->Append("Mail/chains"); + path.Append("Mail/chains"); if (ChainDirection() == outbound) - path->Append("outbound"); + path.Append("outbound"); else - path->Append("inbound"); + path.Append("inbound"); BString leaf; leaf << fId; - path->Append(leaf.String()); + path.Append(leaf.String()); return B_OK; } @@ -227,10 +227,8 @@ BMailChain::Path(BPath* path) const status_t BMailChain::Save(bigtime_t /*timeout*/) { - status_t ret; - BMessage archive; - ret = Archive(&archive,true); + status_t ret = Archive(&archive, true); if (ret != B_OK) { fprintf(stderr, "Couldn't archive chain %ld: %s\n", fId, strerror(ret)); @@ -238,14 +236,15 @@ BMailChain::Save(bigtime_t /*timeout*/) } BPath path; - if ((ret = Path(&path)) < B_OK) + if ((ret = GetPath(path)) < B_OK) return ret; BPath directory; if ((ret = path.GetParent(&directory)) < B_OK) 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; BPath path; - if ((status = Path(&path)) < B_OK) + if ((status = GetPath(path)) < B_OK) return status; BEntry entry(path.Path()); @@ -466,7 +465,7 @@ status_t BMailChain::AddFilter(int32 index, const BMessage& settings, const entry_ref& addon) { - BMessage*s = new BMessage(settings); + BMessage* s = new BMessage(settings); entry_ref* a = new entry_ref(addon); if (!fFilterSettings.AddItem(s, index)) {