Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Core-Monitor.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
objects = {

/* Begin PBXBuildFile section */
A19700032026091900000002 /* DiskProcessSamplerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A19700032026091900000001 /* DiskProcessSamplerTests.swift */; };
A19700022026091900000002 /* CoreMonitorSingleInstancePolicyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A19700022026091900000001 /* CoreMonitorSingleInstancePolicyTests.swift */; };
A19700012026091900000002 /* FollowupRegressionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A19700012026091900000001 /* FollowupRegressionTests.swift */; };
A19600032026091900000002 /* BatteryDetailFormatterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A19600032026091900000001 /* BatteryDetailFormatterTests.swift */; };
A19600022026091900000002 /* HelperXPCClientTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A19600022026091900000001 /* HelperXPCClientTests.swift */; };
A19600012026091900000002 /* RuntimeSafetyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A19600012026091900000001 /* RuntimeSafetyTests.swift */; };
Expand Down Expand Up @@ -54,6 +57,9 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
A19700032026091900000001 /* DiskProcessSamplerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DiskProcessSamplerTests.swift; sourceTree = "<group>"; };
A19700022026091900000001 /* CoreMonitorSingleInstancePolicyTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoreMonitorSingleInstancePolicyTests.swift; sourceTree = "<group>"; };
A19700012026091900000001 /* FollowupRegressionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FollowupRegressionTests.swift; sourceTree = "<group>"; };
A19600032026091900000001 /* BatteryDetailFormatterTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BatteryDetailFormatterTests.swift; sourceTree = "<group>"; };
A19600022026091900000001 /* HelperXPCClientTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HelperXPCClientTests.swift; sourceTree = "<group>"; };
A19600012026091900000001 /* RuntimeSafetyTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RuntimeSafetyTests.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -121,6 +127,9 @@
1A2F97F19E4BA4C0B1070411 /* Core-MonitorTests */ = {
isa = PBXGroup;
children = (
A19700032026091900000001 /* DiskProcessSamplerTests.swift */,
A19700022026091900000001 /* CoreMonitorSingleInstancePolicyTests.swift */,
A19700012026091900000001 /* FollowupRegressionTests.swift */,
A19600032026091900000001 /* BatteryDetailFormatterTests.swift */,
A19600022026091900000001 /* HelperXPCClientTests.swift */,
A19600012026091900000001 /* RuntimeSafetyTests.swift */,
Expand Down Expand Up @@ -340,6 +349,9 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
A19700032026091900000002 /* DiskProcessSamplerTests.swift in Sources */,
A19700022026091900000002 /* CoreMonitorSingleInstancePolicyTests.swift in Sources */,
A19700012026091900000002 /* FollowupRegressionTests.swift in Sources */,
A19600032026091900000002 /* BatteryDetailFormatterTests.swift in Sources */,
A19600022026091900000002 /* HelperXPCClientTests.swift in Sources */,
A19600012026091900000002 /* RuntimeSafetyTests.swift in Sources */,
Expand Down
1 change: 1 addition & 0 deletions Core-Monitor/AlertManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ final class AlertManager: NSObject, ObservableObject {

privacySettings.$processInsightsEnabled
.removeDuplicates()
.receive(on: RunLoop.main)
.sink { [weak self] enabled in
guard let self else { return }
self.processInsightsEnabled = enabled
Expand Down
6 changes: 3 additions & 3 deletions Core-Monitor/BatteryDetailFormatter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ enum BatteryDetailFormatter {
private static func localized(_ key: String, locale: Locale) -> String {
let language = Bundle.preferredLocalizations(from: Bundle.main.localizations, forPreferences: [locale.identifier]).first ?? "en"
guard let path = Bundle.main.path(forResource: language, ofType: "lproj"), let bundle = Bundle(path: path) else { return key }
let existing = bundle.localizedString(forKey: key, value: key, table: nil)
if existing != key { return existing }
return bundle.localizedString(forKey: key, value: key, table: "BatteryDetails")
let battery = bundle.localizedString(forKey: key, value: key, table: "BatteryDetails")
if battery != key { return battery }
return bundle.localizedString(forKey: key, value: key, table: nil)
}
}
Loading