From f5e7da42213fb6877aa08b1e31a4cd694b56bab6 Mon Sep 17 00:00:00 2001 From: Serhiy Mytrovtsiy Date: Sat, 29 Nov 2025 16:31:23 +0100 Subject: [PATCH] feat: removed the Telemetry module from the Stats since it does not do anything for a long time --- Kit/plugins/Telemetry.swift | 23 ------- Stats.xcodeproj/project.pbxproj | 6 +- .../xcshareddata/xcschemes/SMC.xcscheme | 2 +- .../xcshareddata/xcschemes/Stats.xcscheme | 2 +- .../xcschemes/WidgetsExtension.xcscheme | 2 +- Stats/Views/AppSettings.swift | 13 +--- Stats/Views/Setup.swift | 66 +------------------ 7 files changed, 6 insertions(+), 108 deletions(-) delete mode 100644 Kit/plugins/Telemetry.swift diff --git a/Kit/plugins/Telemetry.swift b/Kit/plugins/Telemetry.swift deleted file mode 100644 index 477859d9..00000000 --- a/Kit/plugins/Telemetry.swift +++ /dev/null @@ -1,23 +0,0 @@ -// -// Telemetry.swift -// Kit -// -// Created by Serhiy Mytrovtsiy on 18/06/2023 -// Using Swift 5.0 -// Running on macOS 13.4 -// -// Copyright © 2023 Serhiy Mytrovtsiy. All rights reserved. -// - -import Foundation - -public class Telemetry { - public static let shared = Telemetry() - - public var isEnabled: Bool { - get { Store.shared.bool(key: "telemetry", defaultValue: true) } - set { Store.shared.set(key: "telemetry", value: newValue) } - } - - public init() {} -} diff --git a/Stats.xcodeproj/project.pbxproj b/Stats.xcodeproj/project.pbxproj index 421bc104..2ad1d614 100644 --- a/Stats.xcodeproj/project.pbxproj +++ b/Stats.xcodeproj/project.pbxproj @@ -53,7 +53,6 @@ 5C4E8BC42B6EF65E00F148B6 /* libleveldb.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C4E8BC32B6EF65E00F148B6 /* libleveldb.a */; }; 5C4E8BC72B6EF98800F148B6 /* DB.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C4E8BC62B6EF98800F148B6 /* DB.swift */; }; 5C4E8BE92B71031A00F148B6 /* Kit.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C4E8BE82B7102A700F148B6 /* Kit.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 5C5647F82A3F6B100098FFE9 /* Telemetry.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C5647F72A3F6B100098FFE9 /* Telemetry.swift */; }; 5C621D822B4770D6004ED7AF /* process.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C621D812B4770D6004ED7AF /* process.swift */; }; 5C645BFF2C591F6600D8342A /* widget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C645BFE2C591F6600D8342A /* widget.swift */; }; 5C645C002C591FFA00D8342A /* Net.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A3E17CC247A94AF00449CD1 /* Net.framework */; }; @@ -541,7 +540,6 @@ 5C4E8BC32B6EF65E00F148B6 /* libleveldb.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libleveldb.a; sourceTree = ""; }; 5C4E8BC62B6EF98800F148B6 /* DB.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DB.swift; sourceTree = ""; }; 5C4E8BE82B7102A700F148B6 /* Kit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Kit.h; sourceTree = ""; }; - 5C5647F72A3F6B100098FFE9 /* Telemetry.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Telemetry.swift; sourceTree = ""; }; 5C621D812B4770D6004ED7AF /* process.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = process.swift; sourceTree = ""; }; 5C645BFE2C591F6600D8342A /* widget.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = widget.swift; sourceTree = ""; }; 5C6F55A62D45694400AB58ED /* notifications.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = notifications.swift; sourceTree = ""; }; @@ -1203,7 +1201,6 @@ 9A6EEBBD2685259500897371 /* Logger.swift */, 9A5A8446271895B700BC40A4 /* Reachability.swift */, 9A302613286A2A3B00B41D57 /* Repeater.swift */, - 5C5647F72A3F6B100098FFE9 /* Telemetry.swift */, 5C4E8BC62B6EF98800F148B6 /* DB.swift */, ); path = plugins; @@ -1720,7 +1717,7 @@ New, ); LastSwiftUpdateCheck = 1540; - LastUpgradeCheck = 1640; + LastUpgradeCheck = 2610; ORGANIZATIONNAME = "Serhiy Mytrovtsiy"; TargetAttributes = { 5C22299C29CCB3C400F00E69 = { @@ -2086,7 +2083,6 @@ 9A2847672666AA2700EC1F6D /* BarChart.swift in Sources */, 9A28477B2666AA5000EC1F6D /* popup.swift in Sources */, 5C038CF62D86EE8A00516809 /* Remote.swift in Sources */, - 5C5647F82A3F6B100098FFE9 /* Telemetry.swift in Sources */, 9A2848202666AB3600EC1F6D /* types.swift in Sources */, 9A28481E2666AB3600EC1F6D /* extensions.swift in Sources */, 9A2848092666AB3000EC1F6D /* Store.swift in Sources */, diff --git a/Stats.xcodeproj/xcshareddata/xcschemes/SMC.xcscheme b/Stats.xcodeproj/xcshareddata/xcschemes/SMC.xcscheme index aa758e4f..5abdc944 100644 --- a/Stats.xcodeproj/xcshareddata/xcschemes/SMC.xcscheme +++ b/Stats.xcodeproj/xcshareddata/xcschemes/SMC.xcscheme @@ -1,6 +1,6 @@ NSView { - let container: NSGridView = NSGridView() - - container.addRow(with: [self.option( - tag: 1, - state: Telemetry.shared.isEnabled, - text: localizedString("Share anonymous telemetry data") - )]) - container.addRow(with: [self.option( - tag: 2, - state: !Telemetry.shared.isEnabled, - text: localizedString("Do not share anonymous telemetry data") - )]) - - return container - } - - private func option(tag: Int, state: Bool, text: String) -> NSView { - let button: NSButton = NSButton(frame: NSRect(x: 0, y: 0, width: 30, height: 20)) - button.setButtonType(.radio) - button.state = state ? .on : .off - button.title = text - button.action = #selector(self.toggle) - button.isBordered = false - button.isTransparent = false - button.target = self - button.tag = tag - - return button - } - - @objc private func toggle(_ sender: NSButton) { - Telemetry.shared.isEnabled = sender.tag == 1 - } -} - private class SetupView_end: NSStackView { init() { super.init(frame: NSRect(x: 0, y: 0, width: setupSize.width, height: setupSize.height - 60))