Updated the Tools menu to reflect current build.
[kdepim.git] / kalarm / kalarm-1.2.1-general.pl
bloba236b99250a34c1aa71d225158a1495938b4f109
1 #!/usr/bin/perl -w
2 # Convert KAlarm pre-1.2.1 General section settings.
4 use strict;
6 my $haveEmailFrom = 0;
7 my $haveEmailUseCtrlCentre = 0;
8 my $haveEmailBccUseCtrlCentre = 0;
9 my $emailUseCtrlCentre = 1; # default = true
10 my $emailBccUseCtrlCentre = 1; # default = true
11 my $emailAddress;
12 my $emailBccAddress;
14 while (<>)
16 chomp;
17 if (/^EmailFrom=(.*)$/) {
18 $haveEmailFrom = 1;
20 elsif (/^EmailUseControlCenter=(.*)$/) {
21 $haveEmailUseCtrlCentre = 1;
22 $emailUseCtrlCentre = ($1 eq "true");
24 elsif (/^EmailBccUseControlCenter=(.*)$/) {
25 $haveEmailBccUseCtrlCentre = 1;
26 $emailBccUseCtrlCentre = ($1 eq "true");
28 elsif (/^EmailAddress=(.*)$/) {
29 $emailAddress = $1;
31 elsif (/^EmailBccAddress=(.*)$/) {
32 $emailBccAddress = $1;
36 if (!$haveEmailFrom && $haveEmailUseCtrlCentre)
38 my $bccUseCC = $haveEmailBccUseCtrlCentre ? $emailBccUseCtrlCentre : $emailUseCtrlCentre;
39 print "EmailFrom=" . ($emailUseCtrlCentre ? "\@ControlCenter" : $emailAddress) . "\n";
40 print "EmailBccAddress=" . ($bccUseCC ? "\@ControlCenter" : $emailBccAddress) . "\n";
41 print "# DELETE EmailAddress\n";
42 if ($haveEmailUseCtrlCentre) {
43 print "# DELETE EmailUseControlCenter\n";
45 if ($haveEmailBccUseCtrlCentre) {
46 print "# DELETE EmailBccUseControlCenter\n";