No longer "abuses" the provided message to send the request to the registrar.
Minor cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16989 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -989,32 +989,29 @@ BMimeType::SetLongDescription(const char *description)
|
|||||||
The types are copied into the \c "super_types" field of the passed-in \c BMessage.
|
The types are copied into the \c "super_types" field of the passed-in \c BMessage.
|
||||||
The \c BMessage must be pre-allocated.
|
The \c BMessage must be pre-allocated.
|
||||||
|
|
||||||
\param super_types Pointer to a pre-allocated \c BMessage into which the
|
\param supertypes Pointer to a pre-allocated \c BMessage into which the
|
||||||
MIME supertypes will be copied.
|
MIME supertypes will be copied.
|
||||||
\return
|
\return
|
||||||
- \c B_OK: Success
|
- \c B_OK: Success
|
||||||
- other error code: Failure
|
- other error code: Failure
|
||||||
*/
|
*/
|
||||||
status_t
|
/*static*/ status_t
|
||||||
BMimeType::GetInstalledSupertypes(BMessage *supertypes)
|
BMimeType::GetInstalledSupertypes(BMessage *supertypes)
|
||||||
{
|
{
|
||||||
status_t err = supertypes ? B_OK : B_BAD_VALUE;
|
if (supertypes == NULL)
|
||||||
|
return B_BAD_VALUE;
|
||||||
|
|
||||||
BMessage &msg = *supertypes;
|
BMessage msg(B_REG_MIME_GET_INSTALLED_SUPERTYPES);
|
||||||
BMessage &reply = *supertypes;
|
|
||||||
status_t result;
|
status_t result;
|
||||||
|
|
||||||
// Build and send the message, read the reply
|
status_t err = BRoster::Private().SendTo(&msg, supertypes, true);
|
||||||
if (!err)
|
if (!err)
|
||||||
msg.what = B_REG_MIME_GET_INSTALLED_SUPERTYPES;
|
err = supertypes->what == B_REG_RESULT ? (status_t)B_OK : (status_t)B_BAD_REPLY;
|
||||||
if (!err)
|
if (!err)
|
||||||
err = BRoster::Private().SendTo(&msg, &reply, true);
|
err = supertypes->FindInt32("result", &result);
|
||||||
if (!err)
|
|
||||||
err = reply.what == B_REG_RESULT ? (status_t)B_OK : (status_t)B_BAD_REPLY;
|
|
||||||
if (!err)
|
|
||||||
err = reply.FindInt32("result", &result);
|
|
||||||
if (!err)
|
if (!err)
|
||||||
err = result;
|
err = result;
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1052,28 +1049,27 @@ BMimeType::GetInstalledTypes(BMessage *types)
|
|||||||
- \c B_OK: Success
|
- \c B_OK: Success
|
||||||
- other error code: Failure
|
- other error code: Failure
|
||||||
*/
|
*/
|
||||||
status_t
|
/*static*/ status_t
|
||||||
BMimeType::GetInstalledTypes(const char *supertype, BMessage *types)
|
BMimeType::GetInstalledTypes(const char *supertype, BMessage *types)
|
||||||
{
|
{
|
||||||
status_t err = types ? B_OK : B_BAD_VALUE;
|
if (types == NULL)
|
||||||
|
return B_BAD_VALUE;
|
||||||
|
|
||||||
BMessage &msg = *types;
|
|
||||||
BMessage &reply = *types;
|
|
||||||
status_t result;
|
status_t result;
|
||||||
|
|
||||||
// Build and send the message, read the reply
|
// Build and send the message, read the reply
|
||||||
|
|
||||||
|
BMessage msg(B_REG_MIME_GET_INSTALLED_TYPES);
|
||||||
|
status_t err = msg.AddString("supertype", supertype);
|
||||||
if (!err)
|
if (!err)
|
||||||
msg.what = B_REG_MIME_GET_INSTALLED_TYPES;
|
err = BRoster::Private().SendTo(&msg, types, true);
|
||||||
if (!err && supertype)
|
|
||||||
err = msg.AddString("supertype", supertype);
|
|
||||||
if (!err)
|
if (!err)
|
||||||
err = BRoster::Private().SendTo(&msg, &reply, true);
|
err = types->what == B_REG_RESULT ? (status_t)B_OK : (status_t)B_BAD_REPLY;
|
||||||
if (!err)
|
if (!err)
|
||||||
err = reply.what == B_REG_RESULT ? (status_t)B_OK : (status_t)B_BAD_REPLY;
|
err = types->FindInt32("result", &result);
|
||||||
if (!err)
|
|
||||||
err = reply.FindInt32("result", &result);
|
|
||||||
if (!err)
|
if (!err)
|
||||||
err = result;
|
err = result;
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user