Switched to qmlformat.

This commit is contained in:
ItsLemmy
2025-11-16 17:07:03 -05:00
parent 32905224b9
commit 3ff5b7639f
223 changed files with 9970 additions and 9658 deletions
+30 -30
View File
@@ -18,82 +18,82 @@ Singleton {
function getName(p) {
if (!available)
return "Unknown"
return "Unknown";
const prof = (p !== undefined) ? p : profile
const prof = (p !== undefined) ? p : profile;
switch (prof) {
case PowerProfile.Performance:
return "Performance"
return "Performance";
case PowerProfile.Balanced:
return "Balanced"
return "Balanced";
case PowerProfile.PowerSaver:
return "Power saver"
return "Power saver";
default:
return "Unknown"
return "Unknown";
}
}
function getIcon(p) {
if (!available)
return "balanced"
return "balanced";
const prof = (p !== undefined) ? p : profile
const prof = (p !== undefined) ? p : profile;
switch (prof) {
case PowerProfile.Performance:
return "performance"
return "performance";
case PowerProfile.Balanced:
return "balanced"
return "balanced";
case PowerProfile.PowerSaver:
return "powersaver"
return "powersaver";
default:
return "balanced"
return "balanced";
}
}
function init() {
Logger.d("PowerProfileService", "Service started")
Logger.d("PowerProfileService", "Service started");
}
function setProfile(p) {
if (!available)
return
return;
try {
powerProfiles.profile = p
powerProfiles.profile = p;
} catch (e) {
Logger.e("PowerProfileService", "Failed to set profile:", e)
Logger.e("PowerProfileService", "Failed to set profile:", e);
}
}
function cycleProfile() {
if (!available)
return
const current = powerProfiles.profile
return;
const current = powerProfiles.profile;
if (current === PowerProfile.Performance)
setProfile(PowerProfile.PowerSaver)
setProfile(PowerProfile.PowerSaver);
else if (current === PowerProfile.Balanced)
setProfile(PowerProfile.Performance)
setProfile(PowerProfile.Performance);
else if (current === PowerProfile.PowerSaver)
setProfile(PowerProfile.Balanced)
setProfile(PowerProfile.Balanced);
}
function isDefault() {
if (!available)
return true
return (profile === PowerProfile.Balanced)
return true;
return (profile === PowerProfile.Balanced);
}
Connections {
target: powerProfiles
function onProfileChanged() {
root.profile = powerProfiles.profile
root.profile = powerProfiles.profile;
// Only show toast if we have a valid profile name (not "Unknown")
const profileName = root.getName()
const profileName = root.getName();
if (profileName !== "Unknown") {
ToastService.showNotice(I18n.tr("toast.power-profile.changed"), I18n.tr("toast.power-profile.profile-name", {
"profile": profileName
}), profileName.toLowerCase().replace(" ", ""))
}), profileName.toLowerCase().replace(" ", ""));
}
}
}
@@ -103,18 +103,18 @@ Singleton {
// - Turning animation off
// - Do Not Disturb
function toggleNoctaliaPerformance() {
noctaliaPerformanceMode = !noctaliaPerformanceMode
noctaliaPerformanceMode = !noctaliaPerformanceMode;
}
function setNoctaliaPerformance(value) {
noctaliaPerformanceMode = value
noctaliaPerformanceMode = value;
}
onNoctaliaPerformanceModeChanged: {
if (noctaliaPerformanceMode) {
ToastService.showNotice(I18n.tr("toast.noctalia-performance.label"), I18n.tr("toast.noctalia-performance.enabled"), "rocket")
ToastService.showNotice(I18n.tr("toast.noctalia-performance.label"), I18n.tr("toast.noctalia-performance.enabled"), "rocket");
} else {
ToastService.showNotice(I18n.tr("toast.noctalia-performance.label"), I18n.tr("toast.noctalia-performance.disabled"), "rocket-off")
ToastService.showNotice(I18n.tr("toast.noctalia-performance.label"), I18n.tr("toast.noctalia-performance.disabled"), "rocket-off");
}
}
}