Don't convert the enum values to int, use some Qt magic to get the enum value names instead and store them.

Warning: If you have been using rev. 689148 or higher, you need to manually run kconf_update before starting KMail or you will lose your account settings. See kmail.upd for details.

svn path=/trunk/KDE/kdepim/; revision=689633
wilder-work
Thomas McGuire 19 years ago
parent 15f12d36ab
commit 3949f1af77
  1. 3
      accountmanager.cpp
  2. 23
      kconf_update/kmail-4.0-misc.pl
  3. 7
      kconf_update/kmail.upd
  4. 2
      kmaccount.cpp

@ -89,8 +89,7 @@ void AccountManager::readConfig(void)
groupName.sprintf("Account %d", i);
KConfigGroup group(config, groupName);
KAccount::Type acctType = static_cast<KAccount::Type>( group.readEntry(
"Type", 42 ) );
KAccount::Type acctType = KAccount::typeForName( group.readEntry( "Type" ) );
acctName = group.readEntry("Name");
id = group.readEntry( "Id", 0 );
if (acctName.isEmpty()) acctName = i18n("Account %1", i);

@ -22,23 +22,24 @@ while ( <> ) {
my @accountGroups = grep { /^\[Account \d+\]/ } keys %configFile;
# create new account type
my $newType = 30;
my $newType;
foreach my $accountGroup (@accountGroups) {
my $oldType = $configFile{$accountGroup}{'Type'};
if ( $oldType eq "pop" ) {
$newType = "6";
$newType = $oldType;
if ( $oldType eq "pop" or $oldType eq "6" ) {
$newType = "Pop";
}
if ( $oldType eq "cachedimap" ) {
$newType = "4";
if ( $oldType eq "cachedimap" or $oldType eq "4" ) {
$newType = "DImap";
}
if ( $oldType eq "local" ) {
$newType = "5";
if ( $oldType eq "local" or $oldType eq "5" ) {
$newType = "Local";
}
if ( $oldType eq "maildir" ) {
$newType = "2";
if ( $oldType eq "maildir" or $oldType eq "2" ) {
$newType = "Maildir";
}
if ( $oldType eq "imap" ) {
$newType = "0";
if ( $oldType eq "imap" or $oldType eq "0" ) {
$newType = "Imap";
}
# change the type entry this account

@ -165,6 +165,13 @@ Group=FolderSelectionDialog
RemoveKey=Size
# Misc settings for KMail in KDE 4
########## W A R N I N G #### W A R N I N G #### W A R N I N G #######
# collection of small adjustments. Since updates will be added to this
# script during the pre-4.0 development, trunk users should regularly
# remove the "4.0-{misc,moves}-xx" keys from their kmailrc and kconf_updaterc.
# For this to work, the script MUST be idempotent, ie. be robust
# against being run multiple times.
######################################################################
Id=4.0-misc
File=kmailrc
Script=kmail-4.0-misc.pl,perl

@ -167,7 +167,7 @@ void KMAccount::writeConfig(KConfigGroup& config)
// ID, Name
KAccount::writeConfig(config);
config.writeEntry("Type", static_cast<int> ( type() ) );
config.writeEntry("Type", KAccount::nameForType( type() ) );
config.writeEntry("Folder", mFolder ? mFolder->idString() : QString());
config.writeEntry("check-interval", mInterval);
config.writeEntry("check-exclude", mExclude);

Loading…
Cancel
Save