From 7262be66f5ea6484f44d3a75171614e08dfc34cb Mon Sep 17 00:00:00 2001 From: Abhishek Date: Mon, 28 Dec 2020 08:58:53 -0600 Subject: [PATCH] Remove unused ObjC-Swift model converter function. --- Clocker/AppDelegate.swift | 3 --- Clocker/Panel/Data Layer/TimezoneData.swift | 15 --------------- 2 files changed, 18 deletions(-) diff --git a/Clocker/AppDelegate.swift b/Clocker/AppDelegate.swift index 3d29100..2a556b4 100644 --- a/Clocker/AppDelegate.swift +++ b/Clocker/AppDelegate.swift @@ -125,9 +125,6 @@ open class AppDelegate: NSObject, NSApplicationDelegate { // Check if another instance of the app is already running. If so, then stop this one. checkIfAppIsAlreadyOpen() - // Make sure the old models are not used anymore - TimezoneData.convert() - // Install the menubar item! statusBarHandler = StatusItemHandler() diff --git a/Clocker/Panel/Data Layer/TimezoneData.swift b/Clocker/Panel/Data Layer/TimezoneData.swift index 4caf7a3..c4e3bc1 100644 --- a/Clocker/Panel/Data Layer/TimezoneData.swift +++ b/Clocker/Panel/Data Layer/TimezoneData.swift @@ -176,21 +176,6 @@ class TimezoneData: NSObject, NSCoding { return nil } - /// Converts the Obj-C model objects into Swift - class func convert() { - if let timezones = DataStore.shared().retrieve(key: CLDefaultPreferenceKey) as? [Data], !timezones.isEmpty { - let newModels = converter(timezones) - - if newModels.count == timezones.count { - // Now point preferences to empty - DataStore.shared().setTimezones([]) - - // Now point it to new models - DataStore.shared().setTimezones(newModels) - } - } - } - private class func converter(_ timezones: [Data]) -> [Data] { var newModels: [TimezoneData] = []