From a07c3cf3235bddc7717c6423809dcd5e776d3fa8 Mon Sep 17 00:00:00 2001 From: Serhiy Mytrovtsiy Date: Tue, 30 Sep 2025 17:34:07 +0200 Subject: [PATCH] fix: disabled widgets update for macOS 26 since there is a problem with `chronod` --- Modules/CPU/main.swift | 10 ++++++---- Modules/Disk/main.swift | 10 ++++++---- Modules/GPU/main.swift | 10 ++++++---- Modules/Net/main.swift | 8 +++++--- Modules/RAM/main.swift | 10 ++++++---- Stats.xcodeproj/project.pbxproj | 4 ++-- Stats/Supporting Files/Info.plist | 2 +- Widgets/Supporting Files/Info.plist | 4 ++-- 8 files changed, 34 insertions(+), 24 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/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 f3fc9ee8..950debbb 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.54; + MARKETING_VERSION = 2.11.55; 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.54; + MARKETING_VERSION = 2.11.55; 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 9aaca433..91338c76 100755 --- a/Stats/Supporting Files/Info.plist +++ b/Stats/Supporting Files/Info.plist @@ -17,7 +17,7 @@ CFBundleShortVersionString $(MARKETING_VERSION) CFBundleVersion - 719 + 720 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 6d906219..2e88fd07 100644 --- a/Widgets/Supporting Files/Info.plist +++ b/Widgets/Supporting Files/Info.plist @@ -11,9 +11,9 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleShortVersionString - 2.11.54 + 2.11.55 CFBundleVersion - 719 + 720 NSExtension NSExtensionPointIdentifier