BRoster: added missing const in Launch() variant.

* The argument array passed in is never touched.
This commit is contained in:
Axel Dörfler
2015-01-28 16:12:18 +01:00
parent 65b32f9c38
commit 85f43155fe
2 changed files with 33 additions and 25 deletions
+8 -7
View File
@@ -1,5 +1,5 @@
/* /*
* Copyright 2001-2014 Haiku, Inc. All rights reserved. * Copyright 2001-2015 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */
#ifndef _ROSTER_H #ifndef _ROSTER_H
@@ -101,20 +101,21 @@ public:
// launch app // launch app
status_t Launch(const char* mimeType, status_t Launch(const char* mimeType,
BMessage* initialMessage = NULL, BMessage* initialMessage = NULL,
team_id* appTeam = NULL) const; team_id* _appTeam = NULL) const;
status_t Launch(const char* mimeType, BList* messageList, status_t Launch(const char* mimeType, BList* messageList,
team_id* appTeam = NULL) const; team_id* _appTeam = NULL) const;
status_t Launch(const char* mimeType, int argc, status_t Launch(const char* mimeType, int argc,
char* *args, team_id* appTeam = NULL) const; const char* const* args,
team_id* _appTeam = NULL) const;
status_t Launch(const entry_ref* ref, status_t Launch(const entry_ref* ref,
const BMessage* initialMessage = NULL, const BMessage* initialMessage = NULL,
team_id* appTeam = NULL) const; team_id* _appTeam = NULL) const;
status_t Launch(const entry_ref* ref, status_t Launch(const entry_ref* ref,
const BList* messageList, const BList* messageList,
team_id* appTeam = NULL) const; team_id* _appTeam = NULL) const;
status_t Launch(const entry_ref* ref, int argc, status_t Launch(const entry_ref* ref, int argc,
const char* const* args, const char* const* args,
team_id* appTeam = NULL) const; team_id* _appTeam = NULL) const;
// recent documents, folders, apps // recent documents, folders, apps
void GetRecentDocuments(BMessage* refList, void GetRecentDocuments(BMessage* refList,
+25 -18
View File
@@ -1,5 +1,5 @@
/* /*
* Copyright 2001-2014 Haiku, Inc. All rights reserved. * Copyright 2001-2015 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
* *
* Authors: * Authors:
@@ -910,7 +910,7 @@ BRoster::ActivateApp(team_id team) const
status_t status_t
BRoster::Launch(const char* mimeType, BMessage* initialMessage, BRoster::Launch(const char* mimeType, BMessage* initialMessage,
team_id* appTeam) const team_id* _appTeam) const
{ {
if (mimeType == NULL) if (mimeType == NULL)
return B_BAD_VALUE; return B_BAD_VALUE;
@@ -919,35 +919,35 @@ BRoster::Launch(const char* mimeType, BMessage* initialMessage,
if (initialMessage != NULL) if (initialMessage != NULL)
messageList.AddItem(initialMessage); messageList.AddItem(initialMessage);
return _LaunchApp(mimeType, NULL, &messageList, 0, NULL, appTeam); return _LaunchApp(mimeType, NULL, &messageList, 0, NULL, _appTeam);
} }
status_t status_t
BRoster::Launch(const char* mimeType, BList* messageList, BRoster::Launch(const char* mimeType, BList* messageList,
team_id* appTeam) const team_id* _appTeam) const
{ {
if (mimeType == NULL) if (mimeType == NULL)
return B_BAD_VALUE; return B_BAD_VALUE;
return _LaunchApp(mimeType, NULL, messageList, 0, NULL, appTeam); return _LaunchApp(mimeType, NULL, messageList, 0, NULL, _appTeam);
} }
status_t status_t
BRoster::Launch(const char* mimeType, int argc, char** args, BRoster::Launch(const char* mimeType, int argc, const char* const* args,
team_id* appTeam) const team_id* _appTeam) const
{ {
if (mimeType == NULL) if (mimeType == NULL)
return B_BAD_VALUE; return B_BAD_VALUE;
return _LaunchApp(mimeType, NULL, NULL, argc, args, appTeam); return _LaunchApp(mimeType, NULL, NULL, argc, args, _appTeam);
} }
status_t status_t
BRoster::Launch(const entry_ref* ref, const BMessage* initialMessage, BRoster::Launch(const entry_ref* ref, const BMessage* initialMessage,
team_id* appTeam) const team_id* _appTeam) const
{ {
if (ref == NULL) if (ref == NULL)
return B_BAD_VALUE; return B_BAD_VALUE;
@@ -956,7 +956,7 @@ BRoster::Launch(const entry_ref* ref, const BMessage* initialMessage,
if (initialMessage != NULL) if (initialMessage != NULL)
messageList.AddItem(const_cast<BMessage*>(initialMessage)); messageList.AddItem(const_cast<BMessage*>(initialMessage));
return _LaunchApp(NULL, ref, &messageList, 0, NULL, appTeam); return _LaunchApp(NULL, ref, &messageList, 0, NULL, _appTeam);
} }
@@ -983,23 +983,30 @@ BRoster::Launch(const entry_ref* ref, int argc, const char* const* args,
#if __GNUC__ == 2 #if __GNUC__ == 2
/*! Just here for providing binary compatibility // #pragma mark - Binary compatibility
(for example "Guido" needs this)
*/
extern "C" status_t extern "C" status_t
Launch__C7BRosterP9entry_refP8BMessagePl(BRoster* roster, entry_ref* ref, Launch__C7BRosterP9entry_refP8BMessagePl(BRoster* roster, entry_ref* ref,
BMessage* initialMessage) BMessage* initialMessage)
{ {
return roster->BRoster::Launch(ref, initialMessage, NULL); return roster->BRoster::Launch(ref, initialMessage, NULL);
} }
/*! Just here for providing binary compatibility
(for example "BartLauncher" needs this)
*/ extern "C" status_t
Launch__C7BRosterPCciPPcPl(BRoster* roster, const char* mimeType,
int argc, char** args, team_id* _appTeam)
{
return roster->BRoster::Launch(mimeType, argc, args, _appTeam);
}
extern "C" status_t extern "C" status_t
Launch__C7BRosterP9entry_refiPPcPl(BRoster* roster, entry_ref* ref, Launch__C7BRosterP9entry_refiPPcPl(BRoster* roster, entry_ref* ref,
int argc, char * const *args, team_id *app_team) int argc, char* const* args, team_id* _appTeam)
{ {
return roster->BRoster::Launch(ref, argc, args, app_team); return roster->BRoster::Launch(ref, argc, args, _appTeam);
} }
#endif // __GNUC__ == 2 #endif // __GNUC__ == 2