Boot partition is not a valid target either, at least not until
installing on it don't leads to warranted crash... git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40371 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -643,14 +643,28 @@ TargetVisitor::Visit(BPartition *partition, int32 level)
|
||||
// TODO: After running DriveSetup and doing another scan, it would
|
||||
// be great to pick the partition which just appeared!
|
||||
|
||||
// Only BFS partitions are valid targets, but we want to display the
|
||||
bool isBootPartition = false;
|
||||
if (partition->IsMounted()) {
|
||||
BPath mountPoint;
|
||||
partition->GetMountPoint(&mountPoint);
|
||||
isBootPartition = strcmp(BOOT_PATH, mountPoint.Path()) == 0;
|
||||
}
|
||||
|
||||
// Only non-boot BFS partitions are valid targets, but we want to display the
|
||||
// other partitions as well, in order not to irritate the user.
|
||||
bool isValidTarget = partition->ContentType() != NULL
|
||||
bool isValidTarget = isBootPartition == false
|
||||
&& partition->ContentType() != NULL
|
||||
&& strcmp(partition->ContentType(), kPartitionTypeBFS) == 0;
|
||||
|
||||
char label[255];
|
||||
char menuLabel[255];
|
||||
make_partition_label(partition, label, menuLabel, !isValidTarget);
|
||||
|
||||
printf("Partion: \"%s\" : isValidTarget = %s isBootPartition = %s\n",
|
||||
menuLabel, isValidTarget ? "true" : "false",
|
||||
isBootPartition ? "true" : "false");
|
||||
|
||||
|
||||
PartitionMenuItem* item = new PartitionMenuItem(partition->ContentName(),
|
||||
label, menuLabel, new BMessage(TARGET_PARTITION), partition->ID());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user