diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 4aed2c8219774f5d797760606b8489a92ddc5163 (patch) | |
tree | 3f8c130f7d269626bf6a9447407ef6c35954426a /klipper/klipper-1-2.pl | |
download | tdebase-4aed2c8219774f5d797760606b8489a92ddc5163.tar.gz tdebase-4aed2c8219774f5d797760606b8489a92ddc5163.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'klipper/klipper-1-2.pl')
-rw-r--r-- | klipper/klipper-1-2.pl | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/klipper/klipper-1-2.pl b/klipper/klipper-1-2.pl new file mode 100644 index 000000000..b9cd337fb --- /dev/null +++ b/klipper/klipper-1-2.pl @@ -0,0 +1,63 @@ +#!/usr/bin/perl + +my ($section, %data); + +#read in all the data, split it up into hashes. Thanks again to malte for much input +while (<>) { + if (/\[(.*)\]/) { + $sections{$section} = {%data} if $section; + $section = $1; + undef %data; + next; + } + $data{$1} = $2 if /^([^=]*)=(.*)$/; +} + +$sections{$section} = {%data} if $section; + +# not used up to now +# $version = $sections{'General'}->{'Version'}; + +# if "Action description" is not available, we have a new, fresh configuration +# without any need for conversion. +if ( ! $sections{'Action_0'}->{'Action description'} ) { + exit; +} + +$numActions = $sections{'General'}->{'Number of Actions'}; +for my $i (0..($numActions - 1)) { + my $actionGroup = "Action_$i"; + my $numCommands = $sections{$actionGroup}->{'Number of commands'}; + + print "[$actionGroup]\n"; + # rename some keys + print "Description=$sections{$actionGroup}->{'Action description'}\n"; + print "Regexp=$sections{$actionGroup}->{'Action regexp'}\n"; + print "Number of commands=$numCommands\n"; + + # move the command entries from "Action_x" to "Action_x/Command_y" + for my $k (0..($numCommands - 1)) { + my $command = "Command_$k"; + my $commandGroup = "$actionGroup/$command"; + print "\n[$commandGroup]\n"; + my $value = $sections{$actionGroup}->{"$command: commandline"}; + print "Commandline=$value\n"; + $value = $sections{$actionGroup}->{"$command: description"}; + print "Description=$value\n"; + $value = $sections{$actionGroup}->{"$command: enabled"}; + print "Enabled=$value\n"; + } + print "\n"; +} + +©Section( "General" ); +©Section( "Global Keys" ); + +sub copySection() +{ + my ($group) = @_; + print "\n[$group]\n"; + while (($key,$value) = each(%{$sections{$group}})) { + print "$key=$value\n"; + } +} |