From 29ef0150b5b54a60631d26de8d9233fbe6ae050e Mon Sep 17 00:00:00 2001 From: Zorg Date: Mon, 26 Dec 2016 21:07:21 -0500 Subject: [PATCH] Use [NSApplication sharedApplication] instead to match master --- Sparkle/SPUStandardUserDriver.m | 6 +++--- Sparkle/SPUUpdatePermissionPrompt.m | 2 +- Sparkle/SUStatusController.m | 2 +- Sparkle/SUUpdateAlert.m | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Sparkle/SPUStandardUserDriver.m b/Sparkle/SPUStandardUserDriver.m index 07a7becf..a38bfff0 100644 --- a/Sparkle/SPUStandardUserDriver.m +++ b/Sparkle/SPUStandardUserDriver.m @@ -90,7 +90,7 @@ // If the app is a menubar app or the like, we need to focus it first and alter the // update prompt to behave like a normal window. Otherwise if the window were hidden // there may be no way for the application to be activated to make it visible again. - if ([SUApplicationInfo isBackgroundApplication:NSApp]) { + if ([SUApplicationInfo isBackgroundApplication:[NSApplication sharedApplication]]) { [self.activeUpdateAlert.window setHidesOnDeactivate:NO]; [NSApp activateIgnoringOtherApps:YES]; @@ -210,7 +210,7 @@ // For background applications, obtain focus. // Useful if the update check is requested from another app like System Preferences. - if ([SUApplicationInfo isBackgroundApplication:NSApp]) + if ([SUApplicationInfo isBackgroundApplication:[NSApplication sharedApplication]]) { [NSApp activateIgnoringOtherApps:YES]; } @@ -283,7 +283,7 @@ // When showing a modal alert we need to ensure that background applications // are focused to inform the user since there is no dock icon to notify them. - if ([SUApplicationInfo isBackgroundApplication:NSApp]) { [NSApp activateIgnoringOtherApps:YES]; } + if ([SUApplicationInfo isBackgroundApplication:[NSApplication sharedApplication]]) { [[NSApplication sharedApplication] activateIgnoringOtherApps:YES]; } [alert setIcon:[SUApplicationInfo bestIconForBundle:self.host.bundle]]; [alert runModal]; diff --git a/Sparkle/SPUUpdatePermissionPrompt.m b/Sparkle/SPUUpdatePermissionPrompt.m index 108a79b0..3ffaa916 100644 --- a/Sparkle/SPUUpdatePermissionPrompt.m +++ b/Sparkle/SPUUpdatePermissionPrompt.m @@ -63,7 +63,7 @@ // If this is a background application we need to focus it in order to bring the prompt // to the user's attention. Otherwise the prompt would be hidden behind other applications and // the user would not know why the application was paused. - if ([SUApplicationInfo isBackgroundApplication:NSApp]) { + if ([SUApplicationInfo isBackgroundApplication:[NSApplication sharedApplication]]) { [[NSApplication sharedApplication] activateIgnoringOtherApps:YES]; } diff --git a/Sparkle/SUStatusController.m b/Sparkle/SUStatusController.m index ed82047c..580f0048 100644 --- a/Sparkle/SUStatusController.m +++ b/Sparkle/SUStatusController.m @@ -43,7 +43,7 @@ - (void)windowDidLoad { - if ([SUApplicationInfo isBackgroundApplication:NSApp]) { + if ([SUApplicationInfo isBackgroundApplication:[NSApplication sharedApplication]]) { [[self window] setLevel:NSFloatingWindowLevel]; } diff --git a/Sparkle/SUUpdateAlert.m b/Sparkle/SUUpdateAlert.m index 10467a84..2b2bc6c4 100644 --- a/Sparkle/SUUpdateAlert.m +++ b/Sparkle/SUUpdateAlert.m @@ -245,7 +245,7 @@ [self.window setFrameAutosaveName: showReleaseNotes ? @"SUUpdateAlert" : @"SUUpdateAlertSmall" ]; - if ([SUApplicationInfo isBackgroundApplication:NSApp]) { + if ([SUApplicationInfo isBackgroundApplication:[NSApplication sharedApplication]]) { [self.window setLevel:NSFloatingWindowLevel]; // This means the window will float over all other apps, if our app is switched out ?! }