|
|
@ -327,7 +327,7 @@ extension PreferencesViewController: NSTableViewDataSource, NSTableViewDelegate |
|
|
|
|
|
|
|
|
|
|
|
private func _unfavourite(_ dataObject: TimezoneData) { |
|
|
|
private func _unfavourite(_ dataObject: TimezoneData) { |
|
|
|
Logger.log(object: ["label": dataObject.customLabel ?? "Error"], |
|
|
|
Logger.log(object: ["label": dataObject.customLabel ?? "Error"], |
|
|
|
for: "favouriteRemoved") |
|
|
|
for: "favouriteRemoved") |
|
|
|
|
|
|
|
|
|
|
|
if let appDelegate = NSApplication.shared.delegate as? AppDelegate, |
|
|
|
if let appDelegate = NSApplication.shared.delegate as? AppDelegate, |
|
|
|
let menubarFavourites = DataStore.shared().menubarTimezones(), |
|
|
|
let menubarFavourites = DataStore.shared().menubarTimezones(), |
|
|
@ -420,7 +420,7 @@ extension PreferencesViewController { |
|
|
|
|
|
|
|
|
|
|
|
self.placeholderLabel.placeholderString = "Searching for \(searchString)" |
|
|
|
self.placeholderLabel.placeholderString = "Searching for \(searchString)" |
|
|
|
|
|
|
|
|
|
|
|
print(self.placeholderLabel.placeholderString ?? "") |
|
|
|
Logger.info(self.placeholderLabel.placeholderString ?? "") |
|
|
|
|
|
|
|
|
|
|
|
self.dataTask = NetworkManager.task(with: self.generateSearchURL(), |
|
|
|
self.dataTask = NetworkManager.task(with: self.generateSearchURL(), |
|
|
|
completionHandler: { [weak self] response, error in |
|
|
|
completionHandler: { [weak self] response, error in |
|
|
@ -474,7 +474,7 @@ extension PreferencesViewController { |
|
|
|
return false |
|
|
|
return false |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
print(searchResultsDataSource.timezoneFilteredArray) |
|
|
|
Logger.info(searchResultsDataSource.timezoneFilteredArray.debugDescription) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private func generateSearchURL() -> String { |
|
|
|
private func generateSearchURL() -> String { |
|
|
@ -528,7 +528,7 @@ extension PreferencesViewController { |
|
|
|
|
|
|
|
|
|
|
|
private func reloadSearchResults() { |
|
|
|
private func reloadSearchResults() { |
|
|
|
if searchResultsDataSource.calculateChangesets() { |
|
|
|
if searchResultsDataSource.calculateChangesets() { |
|
|
|
print("Reloading Search Results") |
|
|
|
Logger.info("Reloading Search Results") |
|
|
|
availableTimezoneTableView.reloadData() |
|
|
|
availableTimezoneTableView.reloadData() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -540,7 +540,7 @@ extension PreferencesViewController { |
|
|
|
let decodedObject = try jsonDecoder.decode(SearchResult.self, from: data) |
|
|
|
let decodedObject = try jsonDecoder.decode(SearchResult.self, from: data) |
|
|
|
return decodedObject |
|
|
|
return decodedObject |
|
|
|
} catch { |
|
|
|
} catch { |
|
|
|
print("decodedObject error: \n\(error)") |
|
|
|
Logger.info("decodedObject error: \n\(error)") |
|
|
|
return nil |
|
|
|
return nil |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -552,7 +552,7 @@ extension PreferencesViewController { |
|
|
|
let decodedObject = try jsonDecoder.decode(Timezone.self, from: data) |
|
|
|
let decodedObject = try jsonDecoder.decode(Timezone.self, from: data) |
|
|
|
return decodedObject |
|
|
|
return decodedObject |
|
|
|
} catch { |
|
|
|
} catch { |
|
|
|
print("decodedObject error: \n\(error)") |
|
|
|
Logger.info("decodedObject error: \n\(error)") |
|
|
|
return nil |
|
|
|
return nil |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|