Chameleon Applications

Chameleon Applications Commit Details

Date:2011-12-01 01:48:11 (12 years 4 months ago)
Author:Rekursor
Commit:370
Parents: 369
Message:Fixed bsdName would not be initialized
Changes:
M/trunk/ChameleonPrefPane/Sources/PartitionInfoElement.mm
M/trunk/ChameleonPrefPane/test_util/test_util.mm

File differences

trunk/ChameleonPrefPane/Sources/PartitionInfoElement.mm
122122
123123
124124
125
126
127
128
129
130125
131126
132127
......
139134
140135
141136
142
137
143138
144139
145140
......
156151
157152
158153
154
155
156
159157
160158
161159
162160
163161
164162
163
165164
166
167
165
166
168167
169168
170169
NSMakeRange(pos, rS.location - pos) ];
NSString* sPart = [name substringFromIndex: pos2 ];
diskNum = [sDiskintValue];
partNum = [sPartintValue];
bsdName = name;
bool mustRelease = (session == nil) ? true : false;
if (session == nil)
if (session == NULL)err = EINVAL;
if (err == 0) {
disk = DADiskCreateFromBSDName(NULL, session, [bsdName UTF8String] );
disk = DADiskCreateFromBSDName(NULL, session, [name UTF8String] );
if (disk == NULL) err = EINVAL;
}
}
if (err == 0) {
diskNum = [sDiskintValue];
partNum = [sPartintValue];
self.vUUID = [self createStringValueWithKey: @"DAVolumeUUID"];
self.vName = [self createStringValueWithKey: @"DAVolumeName"];
self.vAliasName = self.vName; // by default renamed = original part name
self.vKind = [self createStringValueWithKey: @"DAVolumeKind"];
self.mediaPath = [self createStringValueWithKey: @"DAMediaPath"];
self.devProtocol = [self createStringValueWithKey: @"DADeviceProtocol"];
self.bsdName = [[NSString stringWithString:name] retain];
devInternal = (bool) [[descDict objectForKey: @"DADeviceInternal"] boolValue];
mediaRemovable = (bool) [[descDict objectForKey: @"DAMediaRemovable"] boolValue];
self.devInternal = (bool) [[descDict objectForKey: @"DADeviceInternal"] boolValue];
self.mediaRemovable = (bool) [[descDict objectForKey: @"DAMediaRemovable"] boolValue];
}
trunk/ChameleonPrefPane/test_util/test_util.mm
5757
5858
5959
60
60
61
6162
6263
6364
NSArray* arr = [PartitionInfoElement createBSDPartitionList];
NSLog(@"List of existing bsd disk partitions:\n %@", arr);
for (PartitionInfoElement* part in [PartsInfoMgr parts]) NSLog(@"PartionBootable = %i\n%@", (int) [part isBootable], part);
for (PartitionInfoElement* part in [PartsInfoMgr parts])
NSLog(@"PartionBootable = %i\n%@", (int) [part isBootable], part);
/*
[PartsInfoMgr hideParts: @"\"Macintosh HD\" hd(0,3)"];
[PartsInfoMgr hideParts: @"disk0s2 hd(0,2) "];

Archive Download the corresponding diff file

Revision: 370