Skip to content
This repository was archived by the owner on Oct 12, 2018. It is now read-only.

Commit 679bd0b

Browse files
committed
Refactoring
1 parent ffc463b commit 679bd0b

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

HWMonitor/AppController.m

+3-3
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
9999
//[[[NSWorkspace sharedWorkspace] notificationCenter] addObserver: self selector: @selector(drivesChanged:) name:NSWorkspaceDidUnmountNotification object:nil];
100100
[[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self selector:@selector(wakeFromSleep:) name:NSWorkspaceDidWakeNotification object:nil];
101101

102-
[self performSelector:@selector(rebuildSensorsList) withObject:nil afterDelay:0.0];
103-
102+
[[NSOperationQueue mainQueue] addOperationWithBlock:^{
103+
[self rebuildSensorsList];
104+
}];
104105

105-
106106
// if (![[NSUserDefaults standardUserDefaults] boolForKey:@"SUHasLaunchedBefore"] || [[NSUserDefaults standardUserDefaults] integerForKey:@"SUScheduledCheckInterval"] != 3600) {
107107
// _sharedUpdater.updateCheckInterval = 3600;
108108
// }

HWMonitor/PopupController.m

+4-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@ - (id)init
4444

4545
[_statusItemView setAction:@selector(togglePanel:)];
4646
[_statusItemView setTarget:self];
47-
48-
[self performSelector:@selector(initialSetup) withObject:nil afterDelay:0.0];
47+
48+
[[NSOperationQueue mainQueue] addOperationWithBlock:^{
49+
[self initialSetup];
50+
}];
4951
}
5052

5153
return self;

0 commit comments

Comments
 (0)