Fix the menu-bar helper so swiftc accepts it on macOS 14.
The status item types are visible to the menu class, and the JSON helper calls match its signature. Co-authored-by: George Lambert <marchon@gmail.com>
This commit is contained in:
parent
969415e5c6
commit
86ebbbaea9
1 changed files with 4 additions and 4 deletions
|
|
@ -23,7 +23,7 @@ private func logPath() -> String {
|
|||
|
||||
private func trayLog(_ msg: String) {
|
||||
let line = ISO8601DateFormatter().string(from: Date()) + " verae-menubar " + msg + "\n"
|
||||
line.withCString { fputs($0, stderr) }
|
||||
_ = line.withCString { fputs($0, stderr) }
|
||||
let path = logPath()
|
||||
let dir = (path as NSString).deletingLastPathComponent
|
||||
try? FileManager.default.createDirectory(atPath: dir, withIntermediateDirectories: true)
|
||||
|
|
@ -63,7 +63,7 @@ private func aquaSession() -> Bool {
|
|||
return name == "Aqua"
|
||||
}
|
||||
|
||||
private struct PrinterStatus {
|
||||
struct PrinterStatus {
|
||||
var running = false
|
||||
var name = "Verae Timestamp"
|
||||
var jobsToday = 0
|
||||
|
|
@ -99,7 +99,7 @@ private func fetchStatus() -> PrinterStatus {
|
|||
return st
|
||||
}
|
||||
|
||||
private func postJSON(_ path: String, body: [String: Any]) -> Bool {
|
||||
private func postJSON(_ path: String, _ body: [String: Any]) -> Bool {
|
||||
guard let url = URL(string: controlDefault + path),
|
||||
let data = try? JSONSerialization.data(withJSONObject: body) else { return false }
|
||||
var req = URLRequest(url: url)
|
||||
|
|
@ -116,7 +116,7 @@ private func postJSON(_ path: String, body: [String: Any]) -> Bool {
|
|||
return ok
|
||||
}
|
||||
|
||||
private final class EventWatch: NSObject, URLSessionDataDelegate {
|
||||
final class EventWatch: NSObject, URLSessionDataDelegate {
|
||||
var buffer = ""
|
||||
var after: Int64 = 0
|
||||
var seen = Set<Int64>()
|
||||
|
|
|
|||
Loading…
Reference in a new issue