From 01b0ac581b1eaec3054471507258b294a293e06c Mon Sep 17 00:00:00 2001
From: Yourself <user@shredder.d-rendszer.hu>
Date: Thu, 29 Nov 2012 00:57:55 +0100
Subject: [PATCH] Added disk device's name.
---
src/apps/drivesetup/DiskView.cpp | 21 ++++++++++++++++-----
src/apps/drivesetup/PartitionList.cpp | 8 +++++++-
2 files changed, 23 insertions(+), 6 deletions(-)
diff --git a/src/apps/drivesetup/DiskView.cpp b/src/apps/drivesetup/DiskView.cpp
index 7dd0df5..6ea3aa7 100644
a
|
b
|
public:
|
202 | 202 | |
203 | 203 | virtual bool Visit(BDiskDevice* device) |
204 | 204 | { |
205 | | PartitionView* view = new PartitionView(B_TRANSLATE("Device"), 1.0, |
206 | | device->Offset(), 0, device->ID()); |
207 | | fViewMap.Put(device->ID(), view); |
208 | | fView->GetLayout()->AddView(view); |
209 | | _AddSpaces(device, view); |
| 205 | if (device->Name() != NULL && device->Name()[0]) |
| 206 | { |
| 207 | PartitionView* view = new PartitionView(device->Name(), 1.0, |
| 208 | device->Offset(), 0, device->ID()); |
| 209 | fViewMap.Put(device->ID(), view); |
| 210 | fView->GetLayout()->AddView(view); |
| 211 | _AddSpaces(device, view); |
| 212 | } |
| 213 | else |
| 214 | { |
| 215 | PartitionView* view = new PartitionView(B_TRANSLATE("Device"), 1.0, |
| 216 | device->Offset(), 0, device->ID()); |
| 217 | fViewMap.Put(device->ID(), view); |
| 218 | fView->GetLayout()->AddView(view); |
| 219 | _AddSpaces(device, view); |
| 220 | } |
210 | 221 | return false; |
211 | 222 | } |
212 | 223 | |
diff --git a/src/apps/drivesetup/PartitionList.cpp b/src/apps/drivesetup/PartitionList.cpp
index f711aa3..ae0255e 100644
a
|
b
|
PartitionListRow::PartitionListRow(BPartition* partition)
|
233 | 233 | } else { |
234 | 234 | SetField(new BStringField(kUnavailableString), kMountedAtColumn); |
235 | 235 | } |
236 | | |
| 236 | |
| 237 | if (partition->IsDevice()) |
| 238 | { |
| 239 | if (partition->Name() != NULL && partition->Name()[0]) |
| 240 | SetField(new BStringField(partition->Name()), kVolumeNameColumn); |
| 241 | } |
| 242 | |
237 | 243 | char size[1024]; |
238 | 244 | SetField(new BStringField(string_for_size(partition->Size(), size, |
239 | 245 | sizeof(size))), kSizeColumn); |