From 5e081035a745c3fe49713d308115352da9e96b37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 23 Jan 2013 21:27:25 +0100 Subject: [PATCH] DriveSetup: fixed device row size/name. * Apparently, the order the fields are set matters, so the drive name and the size now appear in the list as they should have before. * Leave the size field empty if the size is 0. --- src/apps/drivesetup/PartitionList.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/apps/drivesetup/PartitionList.cpp b/src/apps/drivesetup/PartitionList.cpp index 898e3569b8..f2cc4fee66 100644 --- a/src/apps/drivesetup/PartitionList.cpp +++ b/src/apps/drivesetup/PartitionList.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2006-2012 Haiku Inc. All rights reserved. + * Copyright 2006-2013 Haiku Inc. All rights reserved. * Distributed under the terms of the MIT license. * * Authors: @@ -222,11 +222,11 @@ PartitionListRow::PartitionListRow(BPartition* partition) SetField(new BStringField(partition->ContentType()), kFilesystemColumn); SetField(new BStringField(partition->ContentName()), kVolumeNameColumn); } else if (partition->IsDevice()) { + SetField(new BStringField(kUnavailableString), kFilesystemColumn); if (partition->Name() != NULL && partition->Name()[0]) SetField(new BStringField(partition->Name()), kVolumeNameColumn); else SetField(new BStringField(kUnavailableString), kVolumeNameColumn); - SetField(new BStringField(kUnavailableString), kFilesystemColumn); } else if (partition->CountChildren() > 0) { SetField(new BStringField(kUnavailableString), kFilesystemColumn); SetField(new BStringField(kUnavailableString), kVolumeNameColumn); @@ -251,9 +251,13 @@ PartitionListRow::PartitionListRow(BPartition* partition) // Size - char size[1024]; - SetField(new BStringField(string_for_size(partition->Size(), size, - sizeof(size))), kSizeColumn); + if (fSize > 0) { + char size[1024]; + SetField(new BStringField(string_for_size(partition->Size(), size, + sizeof(size))), kSizeColumn); + } else { + SetField(new BStringField(kUnavailableString), kSizeColumn); + } // Additional parameters