diff --git a/Classes/MachineDefaults.m b/Classes/MachineDefaults.m index 2805e52..a798f9e 100644 --- a/Classes/MachineDefaults.m +++ b/Classes/MachineDefaults.m @@ -75,8 +75,15 @@ [fans addObject:[[NSMutableDictionary alloc] initWithDictionary:@{@"Description": desc,@"Minspeed": min,@"Maxspeed": max,@"selspeed": min}]]; } //save to plist for future - NSMutableArray *supported_m=[[NSMutableArray alloc] initWithContentsOfFile:[[[NSFileManager defaultManager] applicationSupportDirectory] stringByAppendingPathComponent:@"Machines.plist"]]; - NSMutableDictionary *new_machine= [[NSMutableDictionary alloc] initWithDictionary:@{@"Fans": fans,@"NumFans": @(num_fans),@"Machine": machine,@"Comment": @"Autogenerated",@"Minspeed": min,@"Maxspeed": max}]; + NSMutableArray *supported_m=[[NSMutableArray alloc] initWithContentsOfFile:[[[NSFileManager defaultManager] applicationSupportDirectory] stringByAppendingPathComponent:@"Machines.plist"]]; + NSMutableDictionary *new_machine; + if (fans == nil) + { + new_machine= [[NSMutableDictionary alloc] initWithDictionary:@{@"Fans": [NSNull null],@"NumFans": @(0),@"Machine": machine,@"Comment": @"Autogenerated",@"Minspeed": min,@"Maxspeed": max}]; + + } else { + new_machine= [[NSMutableDictionary alloc] initWithDictionary:@{@"Fans": fans,@"NumFans": @(num_fans),@"Machine": machine,@"Comment": @"Autogenerated",@"Minspeed": min,@"Maxspeed": max}]; + } [supported_m addObject:new_machine]; //save to plist diff --git a/Info.plist b/Info.plist index b4d68ad..a35707e 100644 --- a/Info.plist +++ b/Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable smcFanControl CFBundleGetInfoString - smcFanControl 2.5.2, Hendrik Holtmann (GPL) + smcFanControl 2.6, Hendrik Holtmann (GPL) CFBundleIconFile smcfancontrol_v2 CFBundleIdentifier @@ -19,11 +19,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 2.5.2 + 2.6 CFBundleSignature ???? CFBundleVersion - 2.5.2 + 2.6 LSUIElement 1 NSHumanReadableCopyright diff --git a/smcFanControl.xcodeproj/project.xcworkspace/xcuserdata/hendrikh.xcuserdatad/UserInterfaceState.xcuserstate b/smcFanControl.xcodeproj/project.xcworkspace/xcuserdata/hendrikh.xcuserdatad/UserInterfaceState.xcuserstate index 1856b19..ace1b48 100644 Binary files a/smcFanControl.xcodeproj/project.xcworkspace/xcuserdata/hendrikh.xcuserdatad/UserInterfaceState.xcuserstate and b/smcFanControl.xcodeproj/project.xcworkspace/xcuserdata/hendrikh.xcuserdatad/UserInterfaceState.xcuserstate differ