mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
23 lines
890 B
QML
23 lines
890 B
QML
import QtQuick
|
|
|
|
QtObject {
|
|
id: root
|
|
|
|
// Migrate battery thresholds from notifications to systemMonitor
|
|
function migrate(adapter, logger, rawJson) {
|
|
logger.i("Settings", "Migrating settings to v48");
|
|
|
|
if (rawJson?.notifications?.batteryWarningThreshold !== undefined) {
|
|
adapter.systemMonitor.batteryWarningThreshold = rawJson.notifications.batteryWarningThreshold;
|
|
logger.i("Settings", "Migrated notifications.batteryWarningThreshold to systemMonitor: " + adapter.systemMonitor.batteryWarningThreshold);
|
|
}
|
|
|
|
if (rawJson?.notifications?.batteryCriticalThreshold !== undefined) {
|
|
adapter.systemMonitor.batteryCriticalThreshold = rawJson.notifications.batteryCriticalThreshold;
|
|
logger.i("Settings", "Migrated notifications.batteryCriticalThreshold to systemMonitor: " + adapter.systemMonitor.batteryCriticalThreshold);
|
|
}
|
|
|
|
return true;
|
|
}
|
|
}
|