mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
Wallpaper: renamed/migrated randomEnabled => automationEnabled.
This commit is contained in:
@@ -30,13 +30,13 @@ QtObject {
|
||||
"id": templateId,
|
||||
"enabled": true
|
||||
});
|
||||
logger.d("Migration39", "Migrated enabled template: " + templateId);
|
||||
logger.d("Migration40", "Migrated enabled template: " + templateId);
|
||||
}
|
||||
}
|
||||
|
||||
// Write the new format
|
||||
adapter.templates.activeTemplates = activeTemplates;
|
||||
logger.i("Migration39", "Migrated " + activeTemplates.length + " templates to new array format");
|
||||
logger.i("Migration40", "Migrated " + activeTemplates.length + " templates to new array format");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
import QtQuick
|
||||
|
||||
QtObject {
|
||||
id: root
|
||||
|
||||
function migrate(adapter, logger, rawJson) {
|
||||
logger.i("Migration42", "Migrating randomEnabled to automationEnabled");
|
||||
|
||||
const wallpaper = rawJson?.wallpaper;
|
||||
if (!wallpaper) {
|
||||
logger.d("Migration42", "No wallpaper section found, skipping migration");
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check if already migrated (has automationEnabled)
|
||||
if (wallpaper.automationEnabled !== undefined) {
|
||||
logger.d("Migration42", "Already has automationEnabled, skipping migration");
|
||||
return true;
|
||||
}
|
||||
|
||||
// Migrate randomEnabled to automationEnabled
|
||||
const oldValue = wallpaper.randomEnabled ?? false;
|
||||
adapter.wallpaper.automationEnabled = oldValue;
|
||||
logger.i("Migration42", "Migrated randomEnabled=" + oldValue + " to automationEnabled=" + oldValue);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,8 @@ QtObject {
|
||||
36: migration36Component,
|
||||
37: migration37Component,
|
||||
38: migration38Component,
|
||||
40: migration39Component
|
||||
40: migration40Component,
|
||||
42: migration42Component
|
||||
})
|
||||
|
||||
// Migration components
|
||||
@@ -27,5 +28,6 @@ QtObject {
|
||||
property Component migration36Component: Migration36 {}
|
||||
property Component migration37Component: Migration37 {}
|
||||
property Component migration38Component: Migration38 {}
|
||||
property Component migration39Component: Migration40 {}
|
||||
property Component migration40Component: Migration40 {}
|
||||
property Component migration42Component: Migration42 {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user