mirror of
https://github.com/hholtmann/smcFanControl.git
synced 2025-11-04 19:49:16 +01:00
No longer read unnecessary data in -readFanData
-readFanData was always reading the temperature and the speeds of all of the fans regardless of what data was displayed in the menu bar. Now, -readFanData only reads the data necessary to update the text in the menubar, so, if only the temp is displayed, only the temp is read. The updating of the fan speeds in the menu is now only done when the user clicks on the menu. Also: cleaned up some test code and deleted an unnecessary comment.
This commit is contained in:
@ -60,9 +60,7 @@ static NSDictionary *tsensors = nil;
|
||||
if (c_temp<=0) {
|
||||
NSArray *allTSensors = [tsensors allKeys];
|
||||
for (NSString *key in allTSensors) {
|
||||
bool bPtrEq = (key == foundKey);
|
||||
bool bCmpEq = ([key isEqualToString:foundKey]);
|
||||
if (false == bPtrEq && false == bCmpEq) {
|
||||
if (![key isEqualToString:foundKey]) {
|
||||
SMCReadKey2((char*)[[tsensors objectForKey:key] UTF8String], &val,conn);
|
||||
c_temp= ((val.bytes[0] * 256 + val.bytes[1]) >> 2)/64;
|
||||
if (c_temp>0) break;
|
||||
|
||||
Reference in New Issue
Block a user