Small cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30371 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2009-04-24 14:08:11 +00:00
parent e963a92370
commit 2e80f194d5
2 changed files with 45 additions and 18 deletions

View File

@ -9,9 +9,10 @@
#include "PartitionMenuItem.h"
PartitionMenuItem::PartitionMenuItem(const char *name, const char *label, const char *menuLabel,
BMessage *msg, partition_id id)
: BMenuItem(label, msg)
PartitionMenuItem::PartitionMenuItem(const char* name, const char* label,
const char* menuLabel, BMessage* message, partition_id id)
:
BMenuItem(label, message)
{
fID = id;
fMenuLabel = strdup(menuLabel);
@ -24,3 +25,25 @@ PartitionMenuItem::~PartitionMenuItem()
free(fMenuLabel);
free(fName);
}
partition_id
PartitionMenuItem::ID() const
{
return fID;
}
const char*
PartitionMenuItem::MenuLabel() const
{
return fMenuLabel ? fMenuLabel : Label();
}
const char*
PartitionMenuItem::Name() const
{
return fName ? fName : Label();
}

View File

@ -2,28 +2,32 @@
* Copyright 2005, Jérôme DUVAL. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef __PARTITIONMENUITEM_H_
#define __PARTITIONMENUITEM_H_
#ifndef PARTITION_MENU_ITEM_H
#define PARTITION_MENU_ITEM_H
#include <MenuItem.h>
#include <Partition.h>
const uint32 SRC_PARTITION = 'iSPT';
const uint32 TARGET_PARTITION = 'iTPT';
class PartitionMenuItem : public BMenuItem {
public:
PartitionMenuItem(const char *name, const char *label,
const char* menuLabel, BMessage *msg, partition_id id);
~PartitionMenuItem();
partition_id ID() const { return fID; };
const char *MenuLabel() { return fMenuLabel ? fMenuLabel : Label(); };
const char *Name() { return fName ? fName : Label(); };
private:
partition_id fID;
char *fMenuLabel;
char *fName;
public:
PartitionMenuItem(const char* name,
const char* label, const char* menuLabel,
BMessage* msg, partition_id id);
virtual ~PartitionMenuItem();
partition_id ID() const;
const char* MenuLabel() const;
const char* Name() const;
private:
partition_id fID;
char* fMenuLabel;
char* fName;
};
#endif /* __PARTITIONMENUITEM_H_ */
#endif // PARTITION_MENU_ITEM_H_