[mapplauncherd] Remove Booster::boosterTemporaryProcessName

pull/1/head
John Brooks 13 years ago
parent 25dfb62293
commit 07a233fb3b

@ -25,12 +25,6 @@
#include <string.h>
const string EBooster::m_boosterType = "generic";
const string EBooster::m_temporaryProcessName = "booster-generic";
const string & EBooster::boosterTemporaryProcessName() const
{
return m_temporaryProcessName;
}
const string & EBooster::boosterType() const
{

@ -35,9 +35,6 @@ public:
EBooster() {}
virtual ~EBooster() {}
//! \reimp
virtual const string &boosterTemporaryProcessName() const;
//! \reimp
virtual const string & boosterType() const;
@ -59,10 +56,6 @@ private:
static const string m_boosterType;
//! Process name to be used when booster is not
//! yet transformed into a running application
static const string m_temporaryProcessName;
//! wait for socket connection
void accept();

@ -98,8 +98,11 @@ void Booster::initialize(int initialArgc, char ** initialArgv, int newBoosterLau
if (!m_bootMode)
preload();
// Rename process to temporary booster process name, e.g. "booster-m"
const char * tempArgv[] = {boosterTemporaryProcessName().c_str()};
// Rename process to temporary booster process name
std::string temporaryProcessName = "booster [";
temporaryProcessName += boosterType();
temporaryProcessName += "]";
const char * tempArgv[] = {temporaryProcessName.c_str()};
renameProcess(initialArgc, initialArgv, 1, tempArgv);
// Restore priority

@ -111,12 +111,6 @@ public:
*/
virtual const string & boosterType() const = 0;
/*! Return the process name to be used when booster is not
* yet transformed into a running application (e.g. "booster-m"
* for MBooster)
*/
virtual const string & boosterTemporaryProcessName() const = 0;
//! Get invoker's pid
pid_t invokersPid();

@ -29,19 +29,16 @@ class MyBooster : public Booster
public:
MyBooster();
const std::string & boosterType() const;
const std::string & boosterTemporaryProcessName() const;
protected:
bool preload();
private:
const string m_boosterType;
const string m_temporaryProcessName;
};
MyBooster::MyBooster() :
m_boosterType("TestBooster"),
m_temporaryProcessName("test booster")
m_boosterType("TestBooster")
{}
const std::string & MyBooster::boosterType() const
@ -54,11 +51,6 @@ bool MyBooster::preload()
return true;
}
const std::string & MyBooster::boosterTemporaryProcessName() const
{
return m_temporaryProcessName;
}
void Ut_Booster::initTestCase()
{}
@ -93,11 +85,11 @@ void Ut_Booster::testRenameProcess()
char ** initialArgv = packTwoArgs("oldName", " ");
// Rename process
const char * tempArgv[] = {m_subject->boosterTemporaryProcessName().c_str()};
const char * tempArgv[] = {"test booster"};
m_subject->renameProcess(INIT_ARGC, initialArgv, 1, tempArgv);
// Check that new name and arguments fit and are correct
QVERIFY(strcmp(initialArgv[0], m_subject->boosterTemporaryProcessName().c_str()) == 0);
QVERIFY(strcmp(initialArgv[0], "test booster") == 0);
// Define and copy args because it's assumed that they are allocated in the heap
// (AppData deletes the argv on exit)

Loading…
Cancel
Save