* Minor cleanup, no functional change.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34303 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2009-11-27 11:11:38 +00:00
parent ea151a7f6a
commit 4fb9da18e0

View File

@ -1,24 +1,26 @@
/* /*
* Copyright 2001-2006, Haiku. * Copyright 2001-2009, Haiku.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
* *
* Authors: * Authors:
* Ingo Weinhold (bonefish@users.sf.net) * Ingo Weinhold (bonefish@users.sf.net)
*/ */
//! Access class for BRoster members //! Access class for BRoster members
#include <RosterPrivate.h> #include <RosterPrivate.h>
#include <Roster.h> #include <Roster.h>
/*! \class BRoster::Private /*! \class BRoster::Private
\brief Class used to access private BRoster members. \brief Class used to access private BRoster members.
This way, the only friend BRoster needs is this class. This way, the only friend BRoster needs is this class.
*/ */
// SetTo
/*! \brief Initializes the roster. /*! \brief Initializes the roster.
\param mainMessenger A BMessenger targeting the registrar application. \param mainMessenger A BMessenger targeting the registrar application.
@ -27,13 +29,13 @@
void void
BRoster::Private::SetTo(BMessenger mainMessenger, BMessenger mimeMessenger) BRoster::Private::SetTo(BMessenger mainMessenger, BMessenger mimeMessenger)
{ {
if (fRoster) { if (fRoster != NULL) {
fRoster->fMessenger = mainMessenger; fRoster->fMessenger = mainMessenger;
fRoster->fMimeMessenger = mimeMessenger; fRoster->fMimeMessenger = mimeMessenger;
} }
} }
// SendTo
/*! \brief Sends a message to the registrar. /*! \brief Sends a message to the registrar.
\a mime specifies whether to send the message to the roster or to the \a mime specifies whether to send the message to the roster or to the
@ -54,19 +56,18 @@ BRoster::Private::SetTo(BMessenger mainMessenger, BMessenger mimeMessenger)
status_t status_t
BRoster::Private::SendTo(BMessage *message, BMessage *reply, bool mime) BRoster::Private::SendTo(BMessage *message, BMessage *reply, bool mime)
{ {
status_t error = (message ? B_OK : B_BAD_VALUE); if (message == NULL)
if (error == B_OK && !fRoster) return B_BAD_VALUE;
error = B_NO_INIT; if (fRoster == NULL)
if (error == B_OK) { return B_NO_INIT;
if (mime)
error = fRoster->fMimeMessenger.SendMessage(message, reply); if (mime)
else return fRoster->fMimeMessenger.SendMessage(message, reply);
error = fRoster->fMessenger.SendMessage(message, reply);
} return fRoster->fMessenger.SendMessage(message, reply);
return error;
} }
// IsMessengerValid
/*! \brief Returns whether the roster's messengers are valid. /*! \brief Returns whether the roster's messengers are valid.
\a mime specifies whether to check the roster messenger or the one of \a mime specifies whether to check the roster messenger or the one of
@ -79,11 +80,11 @@ BRoster::Private::SendTo(BMessage *message, BMessage *reply, bool mime)
bool bool
BRoster::Private::IsMessengerValid(bool mime) const BRoster::Private::IsMessengerValid(bool mime) const
{ {
return (fRoster && (mime ? fRoster->fMimeMessenger.IsValid() return fRoster != NULL && (mime ? fRoster->fMimeMessenger.IsValid()
: fRoster->fMessenger.IsValid())); : fRoster->fMessenger.IsValid());
} }
// InitBeRoster
/*! \brief Initializes the global be_roster variable. /*! \brief Initializes the global be_roster variable.
Called before the global constructors are invoked. Called before the global constructors are invoked.
@ -94,7 +95,7 @@ BRoster::Private::InitBeRoster()
be_roster = new BRoster; be_roster = new BRoster;
} }
// DeleteBeRoster
/*! \brief Deletes the global be_roster. /*! \brief Deletes the global be_roster.
Called after the global destructors are invoked. Called after the global destructors are invoked.