From 5f4cd4a86a1994ad59ace51edbc66a7f2a292814 Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Wed, 21 Sep 2022 17:33:21 +0800 Subject: [PATCH] Main // Simplify the processing of the connection name. --- Source/Modules/main.swift | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Source/Modules/main.swift b/Source/Modules/main.swift index 21ccbb38..4db020ce 100644 --- a/Source/Modules/main.swift +++ b/Source/Modules/main.swift @@ -13,12 +13,6 @@ import InputMethodKit import Shared import Uninstaller -guard let kConnectionName = Bundle.main.infoDictionary?["InputMethodConnectionName"] as? String -else { - NSLog("Fatal error: Failed from retrieving connection name from info.plist file.") - exit(-1) -} - switch max(CommandLine.arguments.count - 1, 0) { case 0: break case 1, 2: @@ -53,9 +47,12 @@ if !loaded { } guard let bundleID = Bundle.main.bundleIdentifier, + let kConnectionName = Bundle.main.infoDictionary?["InputMethodConnectionName"] as? String, let server = IMKServer(name: kConnectionName, bundleIdentifier: bundleID) else { - NSLog("Fatal error: Cannot initialize input method server with connection \(kConnectionName).") + NSLog( + "Fatal error: Cannot initialize input method server with connection name retrieved from the plist, nor there's no connection name in the plist." + ) exit(-1) }