1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2025-08-07 03:50:08 +02:00

👌 Fix Swift 5.10 concurrency warnings

This commit is contained in:
2024-03-30 17:39:30 +01:00
parent 4a3dee3c50
commit b7cad3af62
2 changed files with 7 additions and 14 deletions

View File

@ -23,12 +23,6 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele
*/ */
let state: App let state: App
/**
The MainMenu singleton is responsible for rendering the
menu bar item and its menu, as well as its actions.
*/
let menu: MainMenu
/** /**
The paths singleton that determines where Homebrew is installed, The paths singleton that determines where Homebrew is installed,
and where to look for binaries. and where to look for binaries.
@ -96,7 +90,6 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele
} }
self.state = App.shared self.state = App.shared
self.menu = MainMenu.shared
self.paths = Paths.shared self.paths = Paths.shared
self.valet = Valet.shared self.valet = Valet.shared
self.brew = Brew.shared self.brew = Brew.shared
@ -132,7 +125,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele
setupNotifications() setupNotifications()
Task { // Make sure the menu performs its initial checks Task { // Make sure the menu performs its initial checks
await menu.startup() await MainMenu.shared.startup()
} }
} }

View File

@ -242,7 +242,7 @@ extension StatusMenu {
addLoadedPresets() addLoadedPresets()
} }
private func addEmptyPresetHelp() { @MainActor private func addEmptyPresetHelp() {
addItem(NSMenuItem(title: "mi_presets_title".localized, submenu: [ addItem(NSMenuItem(title: "mi_presets_title".localized, submenu: [
NSMenuItem(title: "mi_no_presets".localized), NSMenuItem(title: "mi_no_presets".localized),
NSMenuItem.separator(), NSMenuItem.separator(),
@ -251,7 +251,7 @@ extension StatusMenu {
], target: MainMenu.shared)) ], target: MainMenu.shared))
} }
private func addLoadedPresets() { @MainActor private func addLoadedPresets() {
addItem(NSMenuItem(title: "mi_presets_title".localized, submenu: [ addItem(NSMenuItem(title: "mi_presets_title".localized, submenu: [
NSMenuItem.separator(), NSMenuItem.separator(),
HeaderView.asMenuItem(text: "mi_apply_presets_title".localized) HeaderView.asMenuItem(text: "mi_apply_presets_title".localized)
@ -266,7 +266,7 @@ extension StatusMenu {
// MARK: - Xdebug // MARK: - Xdebug
func addXdebugMenuItem() { @MainActor func addXdebugMenuItem() {
if !Xdebug.enabled { if !Xdebug.enabled {
addItem(NSMenuItem.separator()) addItem(NSMenuItem.separator())
return return
@ -286,7 +286,7 @@ extension StatusMenu {
// MARK: - PHP Doctor // MARK: - PHP Doctor
func addPhpDoctorMenuItem() { @MainActor func addPhpDoctorMenuItem() {
if !Preferences.isEnabled(.showPhpDoctorSuggestions) || if !Preferences.isEnabled(.showPhpDoctorSuggestions) ||
!WarningManager.shared.hasWarnings() { !WarningManager.shared.hasWarnings() {
return return
@ -302,7 +302,7 @@ extension StatusMenu {
// MARK: - First Aid & Services // MARK: - First Aid & Services
func addFirstAidAndServicesMenuItems() { @MainActor func addFirstAidAndServicesMenuItems() {
let services = NSMenuItem(title: "mi_other".localized) let services = NSMenuItem(title: "mi_other".localized)
var items: [NSMenuItem] = [ var items: [NSMenuItem] = [
@ -359,7 +359,7 @@ extension StatusMenu {
// MARK: - Other helper methods to generate menu items // MARK: - Other helper methods to generate menu items
func addExtensionItem(_ phpExtension: PhpExtension, _ shortcutKey: Int) { @MainActor func addExtensionItem(_ phpExtension: PhpExtension, _ shortcutKey: Int) {
let keyEquivalent = shortcutKey < 9 ? "\(shortcutKey)" : "" let keyEquivalent = shortcutKey < 9 ? "\(shortcutKey)" : ""
let menuItem = ExtensionMenuItem( let menuItem = ExtensionMenuItem(