Commit 79fd3bba authored by Nate Graham's avatar Nate Graham
Browse files

Add migration script for the digital clock applet

This migration script changes:
displayTimezoneAsCode=false
to
displayTimezoneFormat=FullText

This supports
plasma-workspace!751,
which adds new options and alters the structure of the config key that
stores it.
parent 3e09df00
// Find all digital clock applets in all containments and change
// displayTimezoneAsCode=false
// to
// displayTimezoneFormat=FullText
// See https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/751
var containments = desktops().concat(panels());
for (var i in containments) {
var cont = containments[i];
for (var j in cont.widgetIds) {
var widget = cont.widgetById(cont.widgetIds[j]);
if (widget.type == "org.kde.plasma.digitalclock") {
widget.currentConfigGroup = new Array('Appearance')
if (widget.readConfig("displayTimezoneAsCode", true) == false) {
widget.writeConfig("displayTimezoneFormat", "FullText")
// Work around not being able to delete config file keys using widget interface
widget.writeConfig("displayTimezoneAsCode", "")
}
}
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment