Browse Source

Remove unused ObjC-Swift model converter function.

pull/92/head
Abhishek 4 years ago
parent
commit
7262be66f5
  1. 3
      Clocker/AppDelegate.swift
  2. 15
      Clocker/Panel/Data Layer/TimezoneData.swift

3
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()

15
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] = []

Loading…
Cancel
Save