From cee0df5129272c3cf5ec0bc710e5fd78c9dbfbb8 Mon Sep 17 00:00:00 2001 From: Philippe Casgrain Date: Sun, 9 Jan 2022 11:41:12 -0500 Subject: [PATCH 1/5] Converted to Swift 5 --- OpenSim.xcodeproj/project.pbxproj | 6 +++--- OpenSim/AppMenuItem.swift | 2 +- OpenSim/DirectoryWatcher.swift | 2 +- OpenSim/MenuManager.swift | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/OpenSim.xcodeproj/project.pbxproj b/OpenSim.xcodeproj/project.pbxproj index 2271738..e5245de 100644 --- a/OpenSim.xcodeproj/project.pbxproj +++ b/OpenSim.xcodeproj/project.pbxproj @@ -235,7 +235,7 @@ TargetAttributes = { B3A1E31E1BF049690090EC58 = { CreatedOnToolsVersion = 7.1; - LastSwiftMigration = 0900; + LastSwiftMigration = 1320; }; }; }; @@ -450,7 +450,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.pop-tap.OpenSim"; PRODUCT_NAME = OpenSim; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -466,7 +466,7 @@ PRODUCT_NAME = OpenSim; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Release; }; diff --git a/OpenSim/AppMenuItem.swift b/OpenSim/AppMenuItem.swift index 82b26b2..9b735ce 100644 --- a/OpenSim/AppMenuItem.swift +++ b/OpenSim/AppMenuItem.swift @@ -20,7 +20,7 @@ class AppMenuItem: NSMenuItem { // Reverse the array to get the higher quality images first for iconFile in application.iconFiles.reversed() { if let bundle = Bundle(url: application.url) { - self.image = bundle.image(forResource: NSImage.Name(rawValue: iconFile))?.appIcon() + self.image = bundle.image(forResource: iconFile)?.appIcon() if self.image != nil { return } diff --git a/OpenSim/DirectoryWatcher.swift b/OpenSim/DirectoryWatcher.swift index 71cf27e..284087d 100644 --- a/OpenSim/DirectoryWatcher.swift +++ b/OpenSim/DirectoryWatcher.swift @@ -68,7 +68,7 @@ public class DirectoryWatcher { oldDirectoryInfo = self.directoryInfo() let timer = Timer(timeInterval: 0.5, target: self, selector: #selector(checkDirectoryInfo(_:)), userInfo: nil, repeats: true) - RunLoop.main.add(timer, forMode: RunLoopMode.commonModes) + RunLoop.main.add(timer, forMode: RunLoop.Mode.common) } } diff --git a/OpenSim/MenuManager.swift b/OpenSim/MenuManager.swift index 84636df..50bf14d 100644 --- a/OpenSim/MenuManager.swift +++ b/OpenSim/MenuManager.swift @@ -30,7 +30,7 @@ protocol MenuManagerDelegate { override init() { statusItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.variableLength) - statusItem.image = NSImage(named: NSImage.Name(rawValue: "menubar")) + statusItem.image = NSImage(named: "menubar") statusItem.image!.isTemplate = true super.init() @@ -97,8 +97,8 @@ protocol MenuManagerDelegate { devices.forEach({ (device) in let deviceMenuItem = menu.addItem(withTitle: device.name, action: nil, keyEquivalent: "") - deviceMenuItem.onStateImage = NSImage(named: NSImage.Name(rawValue: "active")) - deviceMenuItem.offStateImage = NSImage(named: NSImage.Name(rawValue: "inactive")) + deviceMenuItem.onStateImage = NSImage(named: "active") + deviceMenuItem.offStateImage = NSImage(named: "inactive") deviceMenuItem.state = device.state == .booted ? .on : .off let submenu = NSMenu() @@ -193,7 +193,7 @@ protocol MenuManagerDelegate { self.block = dispatch_block_t(delay) { [weak self] in self?.watcher.stop() self?.buildMenu() - try? self?.watcher.start() + ((try? self?.watcher.start()) as ()??) } } From a4c8b95aa563f0d3c47c560ebec747de0d5a990d Mon Sep 17 00:00:00 2001 From: Philippe Casgrain Date: Sun, 9 Jan 2022 11:41:58 -0500 Subject: [PATCH 2/5] Updated to "en" for English --- OpenSim.xcodeproj/project.pbxproj | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/OpenSim.xcodeproj/project.pbxproj b/OpenSim.xcodeproj/project.pbxproj index e5245de..2d4e147 100644 --- a/OpenSim.xcodeproj/project.pbxproj +++ b/OpenSim.xcodeproj/project.pbxproj @@ -241,10 +241,9 @@ }; buildConfigurationList = B3A1E31A1BF049690090EC58 /* Build configuration list for PBXProject "OpenSim" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( - English, en, Base, "pt-BR", From f0b8e1738c42a0da79a6e4472af8b0b0b1183876 Mon Sep 17 00:00:00 2001 From: Philippe Casgrain Date: Sun, 9 Jan 2022 11:42:29 -0500 Subject: [PATCH 3/5] Removed unnecessary underscore --- OpenSim/MenuManager.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/MenuManager.swift b/OpenSim/MenuManager.swift index 50bf14d..5944abd 100644 --- a/OpenSim/MenuManager.swift +++ b/OpenSim/MenuManager.swift @@ -75,7 +75,7 @@ protocol MenuManagerDelegate { DeviceManager.defaultManager.reload { (runtimes) in var sortedList = [Runtime]() - _ = Dictionary(grouping: runtimes, by: { (runtime: Runtime) in + Dictionary(grouping: runtimes, by: { (runtime: Runtime) in return runtime.platform }).values.map({ (runtimeList: [Runtime]) -> [Runtime] in return runtimeList.sorted { $0.version ?? 0.0 > $1.version ?? 0.0 } From 77ed05dcd7bf2a3cb2c8ced5a1924f62264df1aa Mon Sep 17 00:00:00 2001 From: Philippe Casgrain Date: Sun, 9 Jan 2022 11:43:27 -0500 Subject: [PATCH 4/5] Updated to Xcode 13 --- OpenSim.xcodeproj/project.pbxproj | 6 +++++- .../xcshareddata/xcschemes/OpenSim.xcscheme | 10 +++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/OpenSim.xcodeproj/project.pbxproj b/OpenSim.xcodeproj/project.pbxproj index 2d4e147..3d2a66d 100644 --- a/OpenSim.xcodeproj/project.pbxproj +++ b/OpenSim.xcodeproj/project.pbxproj @@ -230,7 +230,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0710; - LastUpgradeCheck = 1000; + LastUpgradeCheck = 1320; ORGANIZATIONNAME = "Luo Sheng"; TargetAttributes = { B3A1E31E1BF049690090EC58 = { @@ -357,6 +357,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -413,6 +414,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -442,6 +444,7 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; INFOPLIST_FILE = OpenSim/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; @@ -457,6 +460,7 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; INFOPLIST_FILE = OpenSim/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; diff --git a/OpenSim.xcodeproj/xcshareddata/xcschemes/OpenSim.xcscheme b/OpenSim.xcodeproj/xcshareddata/xcschemes/OpenSim.xcscheme index 52399a1..0e54d85 100644 --- a/OpenSim.xcodeproj/xcshareddata/xcschemes/OpenSim.xcscheme +++ b/OpenSim.xcodeproj/xcshareddata/xcschemes/OpenSim.xcscheme @@ -1,6 +1,6 @@ - - - - + + - - Date: Sun, 9 Jan 2022 11:44:38 -0500 Subject: [PATCH 5/5] Added Developer Tool application category --- OpenSim/Info.plist | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OpenSim/Info.plist b/OpenSim/Info.plist index 5ae4f98..51eacf9 100644 --- a/OpenSim/Info.plist +++ b/OpenSim/Info.plist @@ -22,6 +22,8 @@ ???? CFBundleVersion 1 + LSApplicationCategoryType + public.app-category.developer-tools LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) LSUIElement