Commit 0676646a authored by Andrey Butirsky's avatar Andrey Butirsky

fix: keyboard variants display incorrectly on upgrade

Earlier, keyboard variants were embedded in layouts in config.
It is displayed incorrectly with new QML Keyboard Layout applet.

Now we need to update the config to split variants into separate
configuration entry.

The code is still compatible with the old format, but should be
refactored in the future.

Config update script sample:
	- Input:
	LayoutList=us,us(intl),ru,gb(dvorak),gb

	- Output:
	LayoutList=us,us,ru,gb,gb
	VariantList=,intl,,dvorak
	# DELETE LayoutList

CCBUG: 390079
parent 08301318
......@@ -131,6 +131,8 @@ install(TARGETS kcm_keyboard DESTINATION ${KDE_INSTALL_PLUGINDIR} )
install( FILES kcm_keyboard.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR} )
add_subdirectory(kconf_update)
# Images
add_subdirectory( pics )
......
install(FILES kxkb_variants.upd
DESTINATION ${KDE_INSTALL_KCONFUPDATEDIR})
install(PROGRAMS kxkb_variants.awk
DESTINATION ${KDE_INSTALL_KCONFUPDATEDIR})
#! /usr/bin/awk -f
# - Input:
# LayoutList=us,us(intl),ru,gb(dvorak),gb
#
# - Output:
# LayoutList=us,us,ru,gb,gb
# VariantList=,intl,,dvorak
# # DELETE LayoutList
BEGIN { OFS = FS = "," }
/^LayoutList=/ {
layouts = $0
gsub(/\([^()]*\)/, "", layouts)
for (f = 1; f <= NF; ++f) {
match($f, /\((.*)\)/, variant)
$f = variant[1]
}
sub(/,*$/, "")
print layouts
if (length())
print "VariantList=" $0
print "# DELETE LayoutList"
}
Version=5
# Split keyboard layouts and variants into separate configuration entries
Id=split-variants
File=kxkbrc
Group=Layout
Script=kxkb_variants.awk
Markdown is supported
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