btrfs: Attempt to fix GCC2 build.
[haiku.git] / src / apps / installer / PartitionMenuItem.cpp
blob54d41f71ac31c6809088136ed71d4e3fa3055ceb
1 /*
2 * Copyright 2005, Jérôme DUVAL. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 */
6 #include <View.h>
7 #include <stdlib.h>
8 #include <string.h>
10 #include "PartitionMenuItem.h"
12 PartitionMenuItem::PartitionMenuItem(const char* name, const char* label,
13 const char* menuLabel, BMessage* message, partition_id id)
15 BMenuItem(label, message),
16 fID(id),
17 fMenuLabel(strdup(menuLabel)),
18 fName(strdup(name)),
19 fIsValidTarget(true)
24 PartitionMenuItem::~PartitionMenuItem()
26 free(fMenuLabel);
27 free(fName);
31 partition_id
32 PartitionMenuItem::ID() const
34 return fID;
38 const char*
39 PartitionMenuItem::MenuLabel() const
41 return fMenuLabel != NULL ? fMenuLabel : Label();
45 const char*
46 PartitionMenuItem::Name() const
48 return fName != NULL ? fName : Label();
52 void
53 PartitionMenuItem::SetIsValidTarget(bool isValidTarget)
55 fIsValidTarget = isValidTarget;
59 bool
60 PartitionMenuItem::IsValidTarget() const
62 return fIsValidTarget;