From 15075bc7f1b635438f768753d50caf8eceee66ba Mon Sep 17 00:00:00 2001 From: Serhiy Mytrovtsiy Date: Fri, 14 Nov 2025 11:12:06 +0100 Subject: [PATCH] fix: reverted enabling macOS widget updates since there is still a problem with `chronod` (#2733) --- Modules/CPU/main.swift | 10 ++++++---- Modules/Disk/main.swift | 10 ++++++---- Modules/GPU/main.swift | 10 ++++++---- Modules/Net/main.swift | 8 +++++--- Modules/Net/popup.swift | 2 +- Modules/RAM/main.swift | 10 ++++++---- Stats.xcodeproj/project.pbxproj | 4 ++-- Stats/Supporting Files/Info.plist | 2 +- Widgets/Supporting Files/Info.plist | 4 ++-- 9 files changed, 35 insertions(+), 25 deletions(-) diff --git a/Modules/CPU/main.swift b/Modules/CPU/main.swift index 3df16b76..3d13ef64 100644 --- a/Modules/CPU/main.swift +++ b/Modules/CPU/main.swift @@ -234,10 +234,12 @@ public class CPU: Module { } if #available(macOS 11.0, *) { - guard let blobData = try? JSONEncoder().encode(value) else { return } - self.userDefaults?.set(blobData, forKey: "CPU@LoadReader") - WidgetCenter.shared.reloadTimelines(ofKind: CPU_entry.kind) - WidgetCenter.shared.reloadTimelines(ofKind: "UnitedWidget") + if #unavailable(macOS 26.0) { + guard let blobData = try? JSONEncoder().encode(value) else { return } + self.userDefaults?.set(blobData, forKey: "CPU@LoadReader") + WidgetCenter.shared.reloadTimelines(ofKind: CPU_entry.kind) + WidgetCenter.shared.reloadTimelines(ofKind: "UnitedWidget") + } } } } diff --git a/Modules/Disk/main.swift b/Modules/Disk/main.swift index 68209c3d..e8059a76 100644 --- a/Modules/Disk/main.swift +++ b/Modules/Disk/main.swift @@ -330,10 +330,12 @@ public class Disk: Module { } if #available(macOS 11.0, *) { - guard let blobData = try? JSONEncoder().encode(d) else { return } - self.userDefaults?.set(blobData, forKey: "Disk@CapacityReader") - WidgetCenter.shared.reloadTimelines(ofKind: Disk_entry.kind) - WidgetCenter.shared.reloadTimelines(ofKind: "UnitedWidget") + if #unavailable(macOS 26.0) { + guard let blobData = try? JSONEncoder().encode(d) else { return } + self.userDefaults?.set(blobData, forKey: "Disk@CapacityReader") + WidgetCenter.shared.reloadTimelines(ofKind: Disk_entry.kind) + WidgetCenter.shared.reloadTimelines(ofKind: "UnitedWidget") + } } } diff --git a/Modules/GPU/main.swift b/Modules/GPU/main.swift index 9cb099a9..e59f35ff 100644 --- a/Modules/GPU/main.swift +++ b/Modules/GPU/main.swift @@ -192,10 +192,12 @@ public class GPU: Module { } if #available(macOS 11.0, *) { - guard let blobData = try? JSONEncoder().encode(selectedGPU) else { return } - self.userDefaults?.set(blobData, forKey: "GPU@InfoReader") - WidgetCenter.shared.reloadTimelines(ofKind: GPU_entry.kind) - WidgetCenter.shared.reloadTimelines(ofKind: "UnitedWidget") + if #unavailable(macOS 26.0) { + guard let blobData = try? JSONEncoder().encode(selectedGPU) else { return } + self.userDefaults?.set(blobData, forKey: "GPU@InfoReader") + WidgetCenter.shared.reloadTimelines(ofKind: GPU_entry.kind) + WidgetCenter.shared.reloadTimelines(ofKind: "UnitedWidget") + } } } } diff --git a/Modules/Net/main.swift b/Modules/Net/main.swift index f3b16301..52b218d6 100644 --- a/Modules/Net/main.swift +++ b/Modules/Net/main.swift @@ -326,9 +326,11 @@ public class Network: Module { } if #available(macOS 11.0, *) { - guard let blobData = try? JSONEncoder().encode(raw) else { return } - self.userDefaults?.set(blobData, forKey: "Network@UsageReader") - WidgetCenter.shared.reloadTimelines(ofKind: Network_entry.kind) + if #unavailable(macOS 26.0) { + guard let blobData = try? JSONEncoder().encode(raw) else { return } + self.userDefaults?.set(blobData, forKey: "Network@UsageReader") + WidgetCenter.shared.reloadTimelines(ofKind: Network_entry.kind) + } } } diff --git a/Modules/Net/popup.swift b/Modules/Net/popup.swift index b82d3287..d764cca4 100644 --- a/Modules/Net/popup.swift +++ b/Modules/Net/popup.swift @@ -472,7 +472,7 @@ internal class Popup: PopupWrapper { self.recalculateHeight() } var ip = addr - if let cc = value.raddr.countryCode { + if let cc = value.raddr.countryCode, !cc.isEmpty { ip += " (\(cc))" } if self.publicIPv4Field?.stringValue != ip { diff --git a/Modules/RAM/main.swift b/Modules/RAM/main.swift index f5df70de..291ce401 100644 --- a/Modules/RAM/main.swift +++ b/Modules/RAM/main.swift @@ -233,10 +233,12 @@ public class RAM: Module { } if #available(macOS 11.0, *) { - guard let blobData = try? JSONEncoder().encode(value) else { return } - self.userDefaults?.set(blobData, forKey: "RAM@UsageReader") - WidgetCenter.shared.reloadTimelines(ofKind: RAM_entry.kind) - WidgetCenter.shared.reloadTimelines(ofKind: "UnitedWidget") + if #unavailable(macOS 26.0) { + guard let blobData = try? JSONEncoder().encode(value) else { return } + self.userDefaults?.set(blobData, forKey: "RAM@UsageReader") + WidgetCenter.shared.reloadTimelines(ofKind: RAM_entry.kind) + WidgetCenter.shared.reloadTimelines(ofKind: "UnitedWidget") + } } } } diff --git a/Stats.xcodeproj/project.pbxproj b/Stats.xcodeproj/project.pbxproj index 00cecbbf..421bc104 100644 --- a/Stats.xcodeproj/project.pbxproj +++ b/Stats.xcodeproj/project.pbxproj @@ -2871,7 +2871,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 2.11.60; + MARKETING_VERSION = 2.11.61; OTHER_LDFLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = eu.exelban.Stats; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -2908,7 +2908,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 2.11.60; + MARKETING_VERSION = 2.11.61; OTHER_LDFLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = eu.exelban.Stats; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/Stats/Supporting Files/Info.plist b/Stats/Supporting Files/Info.plist index 2115c3c1..0c1bd217 100755 --- a/Stats/Supporting Files/Info.plist +++ b/Stats/Supporting Files/Info.plist @@ -17,7 +17,7 @@ CFBundleShortVersionString $(MARKETING_VERSION) CFBundleVersion - 741 + 742 Description Simple macOS system monitor in your menu bar LSApplicationCategoryType diff --git a/Widgets/Supporting Files/Info.plist b/Widgets/Supporting Files/Info.plist index 3b80bdb3..333dc7dd 100644 --- a/Widgets/Supporting Files/Info.plist +++ b/Widgets/Supporting Files/Info.plist @@ -11,9 +11,9 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleShortVersionString - 2.11.60 + 2.11.61 CFBundleVersion - 741 + 742 NSExtension NSExtensionPointIdentifier