Add kconfig update script for autolock

commit 65045cb50a split the timeout config
option into two values, this is a kconf_update script for updating it
wilder-5.14
David Edmundson 11 years ago
parent c4c7e6d53f
commit 8de8af873e
  1. 6
      ksmserver/screenlocker/CMakeLists.txt
  2. 5
      ksmserver/screenlocker/updaters/kscreenlocker.upd
  3. 37
      ksmserver/screenlocker/updaters/ksreenlocker_5_3_separate_autologin.pl

@ -76,5 +76,11 @@ install(FILES ${screensaver_dbusXML}
DESTINATION ${DBUS_INTERFACES_INSTALL_DIR}
RENAME kf5_org.freedesktop.ScreenSaver.xml)
install(FILES updaters/kscreenlocker.upd DESTINATION ${DATA_INSTALL_DIR}/kconf_update)
install(PROGRAMS updaters/ksreenlocker_5_3_separate_autologin.pl
DESTINATION ${DATA_INSTALL_DIR}/kconf_update)
add_subdirectory(autotests)
add_subdirectory(tests)

@ -0,0 +1,5 @@
Version=5
Id=0.1-autolock
File=kscreenlockerrc
Group=Daemon
Script=ksreenlocker_5_3_separate_autologin.pl,perl

@ -0,0 +1,37 @@
#! /usr/bin/perl
use strict;
my $key;
my $value;
my $alreadyHasAutolockKey = 0;
while (<>)
{
chomp;
if ( /^\[/ )
{
next;
}
($key, $value) = ($_ =~ /([^=]+)=[ \t]*([^\n]+)/);
if ($key eq "Autolock")
{
$alreadyHasAutolockKey = 1;
}
if ($key eq "Timeout" && $alreadyHasAutolockKey == 0)
{
if ($value eq "0")
{
print("Autolock=false\n");
}
else
{
print("Autolock=true\n");
}
}
print "$_\n"
}
Loading…
Cancel
Save