Bug 89446 - JJ: Convert KMail configuration to KConfigXT
Summary: JJ: Convert KMail configuration to KConfigXT
Status: RESOLVED WAITINGFORINFO
Alias: None
Product: kmail
Classification: Unmaintained
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords: junior-jobs
Depends on:
Blocks:
 
Reported: 2004-09-13 23:10 UTC by Ingo Klöcker
Modified: 2012-08-19 00:49 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Changes most of kmcomposer to kconfigXT (31.09 KB, patch)
2004-09-17 15:16 UTC, earlgrey
Details
mostly kmcomposer (55.11 KB, patch)
2004-09-28 08:03 UTC, earlgrey
Details
mostly kmcomposer and the missing files (57.68 KB, patch)
2004-10-04 15:42 UTC, earlgrey
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ingo Klöcker 2004-09-13 23:10:37 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources

Your task, if you choose to accept it, will be to port KMail to KConfigXT. This means:
- Removal of code that reads/writes config options.
- Adding corresponding entries for those config options to kmail.kcfg.
- Changing all references to the config options in KMail's code.

The nice thing about this task is that the conversion can easily be done one by one.
Comment 1 David Faure 2004-09-13 23:15:37 UTC
Can KConfigXT support variable group names, as needed for folders and accounts?

Comment 2 Cornelius Schumacher 2004-09-14 00:47:45 UTC
It can in some way. E.g. KResourcePrefs in libkdepim works around this problem. You basically have to change the group after creating the object of the kconfig_compiler generated class.
Comment 3 earlgrey 2004-09-17 15:16:58 UTC
Created attachment 7560 [details]
Changes most of kmcomposer to kconfigXT

Currently a config option is read into a member variable, and eventually the
config option is saved from the member variable.
Should the member variable be taken out and use the config variable directly?
Comment 4 David Faure 2004-09-17 15:38:01 UTC
On Friday 17 September 2004 15:16, earl grey wrote:
> Currently a config option is read into a member variable, and eventually the
> config option is saved from the member variable.
> Should the member variable be taken out and use the config variable directly?

Yes, that's the whole point of KConfigXT - it provides you with the variables.

Comment 5 Till Adam 2004-09-17 22:31:46 UTC
> Changes most of kmcomposer to kconfigXT

Thanks for that. A few comments:

+#define MGC GlobalSettings::self()

Are those really necessary? I might be a neat freak (in code matters ;), but I 
severely dislike these kinds of obfuscating defines. If you want to avoid 
typing GlobalSettings, I suggest using a modern editor with autocompletion 
(such as vim ;).

+  mCustomFontCheck->setChecked( ! GlobalSettings::defaultFonts() );

I wold prefer something that makes it clear that the option is boolean, such 
as useDefaultFonts() and setUseDefaultFonts( bool ).

In general I think we should use the opportunity to consistently rename the 
options and provide an update script for those we change. My personal taste 
goes towards very verbose and as clear as possible names, such as 
useFeatureWithVeryLongNameEvenOnThurdsdays() even if they look ugly. Making 
them self documenting is worth it, imho. Feel free to disagree.

What about the commented out bits?

Again, thanks a lot for working on this, and feel free to get rid of 
intermediary members storing config values, that's what XT gives us.

Till
Comment 6 earlgrey 2004-09-28 08:03:02 UTC
Created attachment 7707 [details]
mostly kmcomposer

The previous attachment was pointless.
I thought an upgrade script at the end is better that 5 little ones.
Comment 7 earlgrey 2004-10-04 15:42:11 UTC
Created attachment 7780 [details]
mostly kmcomposer and the missing files

apologies for turning it into a 'Mr beans' skit
Comment 8 Till Adam 2004-10-17 08:56:42 UTC
Could be that it's too early and and I haven't had my coffee yet, but there seem to be a few widgets which are not written back to the config variable now, such as mSmartQuoteCheck and several others?
Comment 9 Carsten Niehaus 2006-04-07 00:18:07 UTC
The patch is now 1.5 years old. I guess this bug is either "fixed" as in "patch applied" or can invalidated as for KDE4 many config-changes will take place so that KConfigXT itself won't be available any longer... Can somebody with more knowledge update the status?
Comment 10 Ingo Klöcker 2006-04-07 23:58:35 UTC
The patch has been applied, but the task is far from being completed. There's a lot more configuration related code to be ported.
Comment 11 Naga 2008-03-11 20:20:40 UTC
Is this still a candidate for JJ fixing (as it's about 2 years since the last comment)?
If so is it still KConfigXT that is supposed to be used?
Comment 12 Thomas McGuire 2008-03-11 20:29:27 UTC
> Is this still a candidate for JJ fixing (as it's about 2 years since the last comment)? 
> If so is it still KConfigXT that is supposed to be used? 

Yes, it is still a JJ candidate. There are more than 500 calls to readEntry() in KMail, which should eventually be replaced with KConfigXT.
Comment 13 Alex Brandt 2010-03-22 17:38:02 UTC
With KMail having gone through significant growth since this was last touched is this bug still relevant?
Comment 14 Ingo Klöcker 2010-03-22 20:59:50 UTC
Yes, it's still relevant. In the current trunk version of KMail there are still more than 200 calls to readEntry().
Comment 15 George Metaxas 2011-01-02 18:27:30 UTC
commit e76e0e84f75ff5c7cd3f44512fa32674b937f49e
branch master
Author: George Metaxas <gmetal31@gmail.com>
Date:   Sun Jan 2 19:13:45 2011 +0200

    Ported the majority of KMail to the KConfigXT architecture, by converting the
    readEntry() and writeEntry() calls to the corresponding GlobalSettings
    generated methods.
    
    At present, I do not think that the remaining calls can be ported, as they
    either specify multiple items of the same type (e.g. Akonadi resources,
    antispam tool configuration) or are not configuration files.
    
    Because the KConfigXT may be augmented in the future with additional features
    that may allow us to remove all readEntry/writeEntry calls, I am not marking
    this one as closed yet.
    
    CCBUG: 89446

diff --git a/kmail/configuredialog.cpp b/kmail/configuredialog.cpp
index d02cbad..49dc5f3 100644
--- a/kmail/configuredialog.cpp
+++ b/kmail/configuredialog.cpp
@@ -223,9 +223,8 @@ ConfigureDialog::ConfigureDialog( QWidget *parent, bool modal )
   // the KCMultiDialog starts with the size of the first kcm, not
   // the largest one. This way at least after the first showing of
   // the largest kcm the size is kept.
-  KConfigGroup geometry( KMKernel::self()->config(), "Geometry" );
-  int width = geometry.readEntry( "ConfigureDialogWidth", 0 );
-  int height = geometry.readEntry( "ConfigureDialogHeight", 0 );
+  int width = GlobalSettings::self()->configureDialogWidth();
+  int height = GlobalSettings::self()->configureDialogHeight();
   if ( width != 0 && height != 0 ) {
      resize( width, height );
   }
@@ -234,9 +233,8 @@ ConfigureDialog::ConfigureDialog( QWidget *parent, bool modal )
 
 void ConfigureDialog::hideEvent( QHideEvent *ev )
 {
-  KConfigGroup geometry( KMKernel::self()->config(), "Geometry" );
-  geometry.writeEntry( "ConfigureDialogWidth", width() );
-  geometry.writeEntry( "ConfigureDialogHeight",height() );
+  GlobalSettings::self()->setConfigureDialogWidth( width() );
+  GlobalSettings::self()->setConfigureDialogHeight( height() );
   KDialog::hideEvent( ev );
 }
 
@@ -635,15 +633,13 @@ void AccountsPage::ReceivingTab::doLoadFromGlobalSettings()
 
 void AccountsPage::ReceivingTab::doLoadOther()
 {
-  KConfigGroup general( KMKernel::self()->config(), "General" );
-  mAccountsReceiving.mBeepNewMailCheck->setChecked( general.readEntry( "beep-on-mail", false ) );
+  mAccountsReceiving.mBeepNewMailCheck->setChecked( GlobalSettings::self()->beepOnMail() );
 }
 
 void AccountsPage::ReceivingTab::save()
 {
   // Save Mail notification settings
-  KConfigGroup general( KMKernel::self()->config(), "General" );
-  general.writeEntry( "beep-on-mail", mAccountsReceiving.mBeepNewMailCheck->isChecked() );
+  GlobalSettings::self()->setBeepOnMail( mAccountsReceiving.mBeepNewMailCheck->isChecked() );
   GlobalSettings::self()->setVerboseNewMailNotification( mAccountsReceiving.mVerboseNotificationCheck->isChecked() );
 
   const QString resourceGroupPattern( "Resource %1" );
@@ -1006,7 +1002,7 @@ void AppearancePage::ColorsTab::doLoadOther()
   KConfigGroup messageListView( KMKernel::self()->config(), "MessageListView::Colors" );
 
   mCustomColorCheck->setChecked( !MessageCore::GlobalSettings::self()->useDefaultColors() );
-  mRecycleColorCheck->setChecked( reader.readEntry( "RecycleQuoteColors", false ) );
+  mRecycleColorCheck->setChecked( MessageViewer::GlobalSettings::self()->recycleQuoteColors() );
   mCloseToQuotaThreshold->setValue( GlobalSettings::self()->closeToQuotaThreshold() );
   KColorScheme scheme( QPalette::Active, KColorScheme::View );
 
@@ -1070,7 +1066,7 @@ void AppearancePage::ColorsTab::save()
         reader.writeEntry( configName, mColorList->color(i) );
     }
   }
-  reader.writeEntry( "RecycleQuoteColors", mRecycleColorCheck->isChecked() );
+  MessageViewer::GlobalSettings::self()->setRecycleQuoteColors( mRecycleColorCheck->isChecked() );
   GlobalSettings::self()->setCloseToQuotaThreshold( mCloseToQuotaThreshold->value() );
 }
 
@@ -1148,8 +1144,7 @@ void AppearancePage::LayoutTab::doLoadOther()
   loadWidget( mReaderWindowModeGroupBox, mReaderWindowModeGroup, GlobalSettings::self()->readerWindowModeItem() );
   mFavoriteFolderViewCB->setChecked( GlobalSettings::self()->enableFavoriteCollectionView() );
   mFolderQuickSearchCB->setChecked( GlobalSettings::self()->enableFolderQuickSearch() );
-  const KConfigGroup mainFolderView( KMKernel::self()->config(), "MainFolderView" );
-  const int checkedFolderToolTipsPolicy = mainFolderView.readEntry( "ToolTipDisplayPolicy", 0 );
+  const int checkedFolderToolTipsPolicy = GlobalSettings::self()->toolTipDisplayPolicy();
   if ( checkedFolderToolTipsPolicy < mFolderToolTipsGroup->buttons().size() && checkedFolderToolTipsPolicy >= 0 )
     mFolderToolTipsGroup->buttons()[ checkedFolderToolTipsPolicy ]->setChecked( true );
 }
@@ -1160,8 +1155,7 @@ void AppearancePage::LayoutTab::save()
   saveButtonGroup( mReaderWindowModeGroup, GlobalSettings::self()->readerWindowModeItem() );
   GlobalSettings::self()->setEnableFavoriteCollectionView( mFavoriteFolderViewCB->isChecked() );
   GlobalSettings::self()->setEnableFolderQuickSearch( mFolderQuickSearchCB->isChecked() );
-  KConfigGroup mainFolderView( KMKernel::self()->config(), "MainFolderView" );
-  mainFolderView.writeEntry( "ToolTipDisplayPolicy", mFolderToolTipsGroup->checkedId() );
+  GlobalSettings::self()->setToolTipDisplayPolicy( mFolderToolTipsGroup->checkedId() );
 }
 
 //
@@ -2847,8 +2841,7 @@ void ComposerPage::HeadersTab::doLoadOther()
 
   QTreeWidgetItem * item = 0;
 
-  const KConfigGroup general( KMKernel::self()->config(), "General" );
-  int count = general.readEntry( "mime-header-count", 0 );
+  int count = GlobalSettings::self()->customMessageHeadersCount();
   for( int i = 0 ; i < count ; i++ ) {
     KConfigGroup config( KMKernel::self()->config(),
                          QString("Mime #") + QString::number(i) );
@@ -2886,8 +2879,7 @@ void ComposerPage::HeadersTab::save()
       numValidEntries++;
     }
   }
-  KConfigGroup general( KMKernel::self()->config(), "General" );
-  general.writeEntry( "mime-header-count", numValidEntries );
+  GlobalSettings::self()->setCustomMessageHeadersCount( numValidEntries );
 }
 
 void ComposerPage::HeadersTab::doResetToDefaultsOther()
@@ -3110,12 +3102,10 @@ void SecurityPage::GeneralTab::doLoadOther()
 
   mSGTab.mAlwaysDecrypt->setChecked( MessageViewer::GlobalSettings::self()->alwaysDecrypt() );
 
-  const KConfigGroup mdn( KMKernel::self()->config(), "MDN" );
-
-  int num = mdn.readEntry( "default-policy", 0 );
+  int num = MessageViewer::GlobalSettings::self()->defaultPolicy();
   if ( num < 0 || num >= mMDNGroup->buttons().count() ) num = 0;
   mMDNGroup->button(num)->setChecked(true);
-  num = mdn.readEntry( "quote-message", 0 );
+  num = MessageViewer::GlobalSettings::self()->quoteMessage();
   if ( num < 0 || num >= mOrigQuoteGroup->buttons().count() ) num = 0;
   mOrigQuoteGroup->button(num)->setChecked(true);
   mSGTab.mNoMDNsWhenEncryptedCheck->setChecked( MessageViewer::GlobalSettings::self()->notSendWhenEncrypted() );
@@ -3124,7 +3114,6 @@ void SecurityPage::GeneralTab::doLoadOther()
 void SecurityPage::GeneralTab::save()
 {
   KConfigGroup reader( KMKernel::self()->config(), "Reader" );
-  KConfigGroup mdn( KMKernel::self()->config(), "MDN" );
 
   if ( MessageViewer::GlobalSettings::self()->htmlMail() != mSGTab.mHtmlMailCheck->isChecked())
   {
@@ -3145,8 +3134,8 @@ void SecurityPage::GeneralTab::save()
   MessageViewer::GlobalSettings::self()->setHtmlLoadExternal( mSGTab.mExternalReferences->isChecked() );
   MessageViewer::GlobalSettings::self()->setAutoImportKeys(
       mSGTab.mAutomaticallyImportAttachedKeysCheck->isChecked() );
-  mdn.writeEntry( "default-policy", mMDNGroup->checkedId() );
-  mdn.writeEntry( "quote-message", mOrigQuoteGroup->checkedId() );
+  MessageViewer::GlobalSettings::self()->setDefaultPolicy( mMDNGroup->checkedId() );
+  MessageViewer::GlobalSettings::self()->setQuoteMessage( mOrigQuoteGroup->checkedId() );
   MessageViewer::GlobalSettings::self()->setNotSendWhenEncrypted( mSGTab.mNoMDNsWhenEncryptedCheck->isChecked() );
   MessageViewer::GlobalSettings::self()->setAlwaysDecrypt( mSGTab.mAlwaysDecrypt->isChecked() );
 }
@@ -3178,43 +3167,34 @@ SecurityPageComposerCryptoTab::SecurityPageComposerCryptoTab( QWidget * parent )
 
 void SecurityPage::ComposerCryptoTab::doLoadOther()
 {
-  const KConfigGroup composer( KMKernel::self()->config(), "Composer" );
-
   // If you change default values, sync messagecomposer.cpp too
 
-  mWidget->mAutoSignature->setChecked(
-      composer.readEntry( "pgp-auto-sign", false ) );
+  mWidget->mAutoSignature->setChecked( GlobalSettings::self()->pgpAutoSign() );
 
-  mWidget->mEncToSelf->setChecked(
-      composer.readEntry( "crypto-encrypt-to-self", true ) );
+  mWidget->mEncToSelf->setChecked( GlobalSettings::self()->cryptoEncryptToSelf() );
   mWidget->mShowEncryptionResult->setChecked( false ); //composer.readBoolEntry( "crypto-show-encryption-result", true ) );
   mWidget->mShowEncryptionResult->hide();
-  mWidget->mShowKeyApprovalDlg->setChecked(
-      composer.readEntry( "crypto-show-keys-for-approval", true ) );
+  mWidget->mShowKeyApprovalDlg->setChecked( GlobalSettings::self()->cryptoShowKeysForApproval() );
 
-  mWidget->mAutoEncrypt->setChecked(
-      composer.readEntry( "pgp-auto-encrypt", false ) );
+  mWidget->mAutoEncrypt->setChecked( GlobalSettings::self()->pgpAutoEncrypt() ) ;
   mWidget->mNeverEncryptWhenSavingInDrafts->setChecked(
-      composer.readEntry( "never-encrypt-drafts", true ) );
+      GlobalSettings::self()->neverEncryptDrafts() );
 
-  mWidget->mStoreEncrypted->setChecked(
-      composer.readEntry( "crypto-store-encrypted", true ) );
+  mWidget->mStoreEncrypted->setChecked( GlobalSettings::self()->cryptoStoreEncrypted() );
 }
 
 void SecurityPage::ComposerCryptoTab::save()
 {
-  KConfigGroup composer( KMKernel::self()->config(), "Composer" );
+  GlobalSettings::self()->setPgpAutoSign( mWidget->mAutoSignature->isChecked() );
 
-  composer.writeEntry( "pgp-auto-sign", mWidget->mAutoSignature->isChecked() );
+  GlobalSettings::self()->setCryptoEncryptToSelf( mWidget->mEncToSelf->isChecked() );
+  GlobalSettings::self()->setCryptoShowEncryptionResult( mWidget->mShowEncryptionResult->isChecked() );
+  GlobalSettings::self()->setCryptoShowKeysForApproval( mWidget->mShowKeyApprovalDlg->isChecked() );
 
-  composer.writeEntry( "crypto-encrypt-to-self", mWidget->mEncToSelf->isChecked() );
-  composer.writeEntry( "crypto-show-encryption-result", mWidget->mShowEncryptionResult->isChecked() );
-  composer.writeEntry( "crypto-show-keys-for-approval", mWidget->mShowKeyApprovalDlg->isChecked() );
+  GlobalSettings::self()->setPgpAutoEncrypt( mWidget->mAutoEncrypt->isChecked() );
+  GlobalSettings::self()->setNeverEncryptDrafts( mWidget->mNeverEncryptWhenSavingInDrafts->isChecked() );
 
-  composer.writeEntry( "pgp-auto-encrypt", mWidget->mAutoEncrypt->isChecked() );
-  composer.writeEntry( "never-encrypt-drafts", mWidget->mNeverEncryptWhenSavingInDrafts->isChecked() );
-
-  composer.writeEntry( "crypto-store-encrypted", mWidget->mStoreEncrypted->isChecked() );
+  GlobalSettings::self()->setCryptoStoreEncrypted( mWidget->mStoreEncrypted->isChecked() );
 }
 
 QString SecurityPage::WarningTab::helpAnchor() const
@@ -3245,38 +3225,36 @@ SecurityPageWarningTab::SecurityPageWarningTab( QWidget * parent )
 
 void SecurityPage::WarningTab::doLoadOther()
 {
-  const KConfigGroup composer( KMKernel::self()->config(), "Composer" );
-
   mWidget->warnUnencryptedCB->setChecked(
-      composer.readEntry( "crypto-warning-unencrypted", false ) );
+      MessageComposer::MessageComposerSettings::self()->cryptoWarningUnencrypted() );
   mWidget->mWarnUnsigned->setChecked(
-      composer.readEntry( "crypto-warning-unsigned", false ) );
+      MessageComposer::MessageComposerSettings::self()->cryptoWarningUnsigned() );
   mWidget->warnReceiverNotInCertificateCB->setChecked(
-      composer.readEntry( "crypto-warn-recv-not-in-cert", true ) );
+      MessageComposer::MessageComposerSettings::self()->cryptoWarnRecvNotInCert() );
 
   // The "-int" part of the key name is because there used to be a separate boolean
   // config entry for enabling/disabling. This is done with the single bool value now.
   mWidget->warnGroupBox->setChecked(
-      composer.readEntry( "crypto-warn-when-near-expire", true ) );
+      MessageComposer::MessageComposerSettings::self()->cryptoWarnWhenNearExpire() );
 
   mWidget->mWarnSignKeyExpiresSB->setValue(
-      composer.readEntry( "crypto-warn-sign-key-near-expire-int", 14 ) );
+      MessageComposer::MessageComposerSettings::self()->cryptoWarnSignKeyNearExpiryThresholdDays() );
   mWidget->mWarnSignKeyExpiresSB->setSuffix(ki18np(" day", " days"));
   mWidget->mWarnSignChainCertExpiresSB->setValue(
-      composer.readEntry( "crypto-warn-sign-chaincert-near-expire-int", 14 ) );
+      MessageComposer::MessageComposerSettings::self()->cryptoWarnSignChaincertNearExpiryThresholdDays() );
   mWidget->mWarnSignChainCertExpiresSB->setSuffix(ki18np(" day", " days"));
   mWidget->mWarnSignRootCertExpiresSB->setValue(
-      composer.readEntry( "crypto-warn-sign-root-near-expire-int", 14 ) );
+      MessageComposer::MessageComposerSettings::self()->cryptoWarnSignRootNearExpiryThresholdDays() );
   mWidget->mWarnSignRootCertExpiresSB->setSuffix(ki18np(" day", " days"));
 
   mWidget->mWarnEncrKeyExpiresSB->setValue(
-      composer.readEntry( "crypto-warn-encr-key-near-expire-int", 14 ) );
+      MessageComposer::MessageComposerSettings::self()->cryptoWarnEncrKeyNearExpiryThresholdDays() );
   mWidget->mWarnEncrKeyExpiresSB->setSuffix(ki18np(" day", " days"));
   mWidget->mWarnEncrChainCertExpiresSB->setValue(
-      composer.readEntry( "crypto-warn-encr-chaincert-near-expire-int", 14 ) );
+      MessageComposer::MessageComposerSettings::self()->cryptoWarnEncrChaincertNearExpiryThresholdDays() );
   mWidget->mWarnEncrChainCertExpiresSB->setSuffix(ki18np(" day", " days"));
   mWidget->mWarnEncrRootCertExpiresSB->setValue(
-      composer.readEntry( "crypto-warn-encr-root-near-expire-int", 14 ) );
+      MessageComposer::MessageComposerSettings::self()->cryptoWarnEncrRootNearExpiryThresholdDays() );
   mWidget->mWarnEncrRootCertExpiresSB->setSuffix(ki18np(" day", " days"));
 
   mWidget->enableAllWarningsPB->setEnabled( true );
@@ -3284,25 +3262,27 @@ void SecurityPage::WarningTab::doLoadOther()
 
 void SecurityPage::WarningTab::save()
 {
-  KConfigGroup composer( KMKernel::self()->config(), "Composer" );
-
-  composer.writeEntry( "crypto-warn-recv-not-in-cert", mWidget->warnReceiverNotInCertificateCB->isChecked() );
-  composer.writeEntry( "crypto-warning-unencrypted", mWidget->warnUnencryptedCB->isChecked() );
-  composer.writeEntry( "crypto-warning-unsigned", mWidget->mWarnUnsigned->isChecked() );
+  MessageComposer::MessageComposerSettings::self()->setCryptoWarnRecvNotInCert(
+                       mWidget->warnReceiverNotInCertificateCB->isChecked() );
+  MessageComposer::MessageComposerSettings::self()->setCryptoWarningUnencrypted(
+                       mWidget->warnUnencryptedCB->isChecked() );
+  MessageComposer::MessageComposerSettings::self()->setCryptoWarningUnsigned(
+                       mWidget->mWarnUnsigned->isChecked() );
 
-  composer.writeEntry( "crypto-warn-when-near-expire", mWidget->warnGroupBox->isChecked() );
-  composer.writeEntry( "crypto-warn-sign-key-near-expire-int",
+  MessageComposer::MessageComposerSettings::self()->setCryptoWarnWhenNearExpire(
+                       mWidget->warnGroupBox->isChecked() );
+  MessageComposer::MessageComposerSettings::self()->setCryptoWarnSignKeyNearExpiryThresholdDays(
                        mWidget->mWarnSignKeyExpiresSB->value() );
-  composer.writeEntry( "crypto-warn-sign-chaincert-near-expire-int",
+  MessageComposer::MessageComposerSettings::self()->setCryptoWarnSignChaincertNearExpiryThresholdDays(
                        mWidget->mWarnSignChainCertExpiresSB->value() );
-  composer.writeEntry( "crypto-warn-sign-root-near-expire-int",
+  MessageComposer::MessageComposerSettings::self()->setCryptoWarnSignRootNearExpiryThresholdDays(
                        mWidget->mWarnSignRootCertExpiresSB->value() );
 
-  composer.writeEntry( "crypto-warn-encr-key-near-expire-int",
+  MessageComposer::MessageComposerSettings::self()->setCryptoWarnEncrKeyNearExpiryThresholdDays(
                        mWidget->mWarnEncrKeyExpiresSB->value() );
-  composer.writeEntry( "crypto-warn-encr-chaincert-near-expire-int",
+  MessageComposer::MessageComposerSettings::self()->setCryptoWarnEncrChaincertNearExpiryThresholdDays(
                        mWidget->mWarnEncrChainCertExpiresSB->value() );
-  composer.writeEntry( "crypto-warn-encr-root-near-expire-int",
+  MessageComposer::MessageComposerSettings::self()->setCryptoWarnEncrRootNearExpiryThresholdDays(
                        mWidget->mWarnEncrRootCertExpiresSB->value() );
 }
 
@@ -3717,24 +3697,16 @@ void MiscPage::FolderTab::doLoadFromGlobalSettings()
 
 void MiscPage::FolderTab::doLoadOther()
 {
-  KConfigGroup general( KMKernel::self()->config(), "General" );
-
-  mMMTab.mEmptyTrashCheck->setChecked(
-      general.readEntry( "empty-trash-on-exit", false ) );
-  mOnStartupOpenFolder->setFolder( general.readEntry( "startupFolder",
-      QString::number(CommonKernel->inboxCollectionFolder().id() )) );
-  mMMTab.mEmptyFolderConfirmCheck->setChecked(
-      general.readEntry( "confirm-before-empty", true ) );
-
+  mMMTab.mEmptyTrashCheck->setChecked( GlobalSettings::self()->emptyTrashOnExit() );
+  mOnStartupOpenFolder->setFolder( GlobalSettings::self()->startupFolder() );
+  mMMTab.mEmptyFolderConfirmCheck->setChecked( GlobalSettings::self()->confirmBeforeEmpty() );
 }
 
 void MiscPage::FolderTab::save()
 {
-  KConfigGroup general( KMKernel::self()->config(), "General" );
-
-  general.writeEntry( "empty-trash-on-exit", mMMTab.mEmptyTrashCheck->isChecked() );
-  general.writeEntry( "confirm-before-empty", mMMTab.mEmptyFolderConfirmCheck->isChecked() );
-  general.writeEntry( "startupFolder", mOnStartupOpenFolder->folderCollection().isValid() ?
+  GlobalSettings::self()->setEmptyTrashOnExit( mMMTab.mEmptyTrashCheck->isChecked() );
+  GlobalSettings::self()->setConfirmBeforeEmpty( mMMTab.mEmptyFolderConfirmCheck->isChecked() );
+  GlobalSettings::self()->setStartupFolder( mOnStartupOpenFolder->folderCollection().isValid() ?
                                   QString::number(mOnStartupOpenFolder->folderCollection().id()) : QString() );
 
   MessageViewer::GlobalSettings::self()->setDelayedMarkAsRead( mMMTab.mDelayedMarkAsRead->isChecked() );
diff --git a/kmail/globalsettings_base.kcfgc b/kmail/globalsettings_base.kcfgc
index f9a0ea4..53db8f6 100644
--- a/kmail/globalsettings_base.kcfgc
+++ b/kmail/globalsettings_base.kcfgc
@@ -4,5 +4,5 @@ Mutators=true
 Singleton=true
 ItemAccessors=true
 SetUserTexts=true
-IncludeFiles=qapplication.h,defaulttemplates.h
+IncludeFiles=qapplication.h,defaulttemplates.h,mailkernel.h,kmversion.h
 
diff --git a/kmail/identitydialog.cpp b/kmail/identitydialog.cpp
index 0535966..00dacf0 100644
--- a/kmail/identitydialog.cpp
+++ b/kmail/identitydialog.cpp
@@ -38,6 +38,7 @@
 #include "simplestringlisteditor.h"
 #include "folderrequester.h"
 #ifndef KCM_KPIMIDENTITIES_STANDALONE
+#include "globalsettings.h"
 #include "kmkernel.h"
 #endif
 
@@ -516,9 +517,7 @@ namespace KMail {
 #endif
 
 #ifndef KCM_KPIMIDENTITIES_STANDALONE
-    KConfigGroup geometry( KMKernel::self()->config(), "Geometry" );
-    if ( geometry.hasKey( "Identity Dialog size" ) )
-      resize( geometry.readEntry( "Identity Dialog size", QSize() ));
+    resize( GlobalSettings::self()->identityDialogSize() );
 #endif
     mNameEdit->setFocus();
 
@@ -529,8 +528,7 @@ namespace KMail {
 
   IdentityDialog::~IdentityDialog() {
 #ifndef KCM_KPIMIDENTITIES_STANDALONE
-    KConfigGroup geometry( KMKernel::self()->config(), "Geometry" );
-    geometry.writeEntry( "Identity Dialog size", size() );
+    GlobalSettings::self()->setIdentityDialogSize( size() );
 #endif
   }
 
diff --git a/kmail/kmail.kcfg.cmake b/kmail/kmail.kcfg.cmake
index fadb2c1..ecc7224 100644
--- a/kmail/kmail.kcfg.cmake
+++ b/kmail/kmail.kcfg.cmake
@@ -114,7 +114,9 @@
         <label>Use e&amp;xternal editor instead of composer</label>
         <default>false</default>
       </entry>
-      <entry name="CustHeaderCount" type="Int" key="mime-header-count" />
+      <entry name="CustomMessageHeadersCount" type="Int" key="mime-header-count">
+        <label>Specifies the number of custom MIME header fields to be inserted in messages (for internal use only)</label>
+      </entry>
       <entry name="FolderLoadingTimeout" type="Int" hidden="true">
          <default>1000</default>
       </entry>
@@ -122,6 +124,34 @@
         <label>The threshold for when to warn the user that a folder is nearing its quota limit.</label>
          <default>80</default>
       </entry>
+      <entry name="BeepOnMail" type="Bool" key="beep-on-mail">
+        <label>Beep upon receiving new mail</label>
+        <default>false</default>
+      </entry>
+      <entry name="EmptyTrashOnExit" type="Bool" key="empty-trash-on-exit">
+        <label>Empty the local trash folder on program exit</label>
+        <default>false</default>
+      </entry>
+      <entry name="StartupFolder" type="String" key="startupFolder">
+        <label>Specify the folder to open when the program is started</label>
+        <default></default>
+      </entry>
+      <entry name="ConfirmBeforeEmpty" type="Bool" key="confirm-before-empty">
+        <label>Ask for confirmation before moving all messages to trash</label>
+        <default>true</default>
+      </entry>
+      <entry name="AutoExpiring" type="Bool" key="auto-expiring">
+        <label>Specifies whether the folders will expire in the background (for internal use only)</label>
+        <default>true</default>
+      </entry>
+      <entry name="FirstStart" type="Bool" key="first-start">
+        <label>Specifies whether this is the very first time that the application is run (for internal use only)</label>
+        <default>true</default>
+      </entry>
+      <entry name="PreviousVersion" type="String" key="previous-version">
+        <label>Specifies the version of the aplication that was last used (for internal use only)</label>
+        <default code="true">KMAIL_VERSION</default>
+      </entry>
     </group>
 <!-- General -->
 
@@ -259,6 +289,34 @@
           <default>false</default>
       </entry>
 
+      <entry name="CryptoEncryptToSelf" type="Bool" key="crypto-encrypt-to-self">
+        <label>When encrypting emails, always also encrypt to the certificate of my own identity</label>
+        <default>true</default>
+      </entry>
+      <entry name="CryptoShowEncryptionResult" type="Bool" key="crypto-show-encryption-result">
+        <label>Show signed/encrypted text after composing</label>
+        <default>true</default>
+      </entry>
+      <entry name="CryptoShowKeysForApproval" type="Bool" key="crypto-show-keys-for-approval">
+        <label>Always show the list of encryption keys to select the one which will be used</label>
+        <default>true</default>
+      </entry>
+      <entry name="CryptoStoreEncrypted" type="Bool" key="crypto-store-encrypted">
+        <label>When check, sent messages will be stored in the encrypted form</label>
+        <default>true</default>
+      </entry>
+      <entry name="RecentUrls" type="StringList" key="recent-urls">
+        <label>A list of all the recently used URLs</label>
+        <default code="true">
+        QStringList()
+        </default>
+      </entry>
+      <entry name="RecentEncodings" type="StringList" key="recent-encoding">
+        <label>A list of all the recently used encodings</label>
+        <default code="true">
+        QStringList()
+        </default>
+      </entry>
     </group>
 <!-- Composer -->
 
@@ -272,6 +330,30 @@
       <entry name="ComposerSize" type="Size" key="composer">
         <default>QSize(480,510)</default>
       </entry>
+      <entry name="FilterDialogSize" type="Size" key="filterDialogSize">
+        <label>The size of the filter dialog (for internal use only)</label>
+        <default>QSize()</default>
+      </entry>
+      <entry name="IdentityDialogSize" type="Size" key="Identity Dialog size">
+        <label>The size of the identity dialog (for internal use only)</label>
+        <default>QSize()</default>
+      </entry>
+      <entry name="SearchWidgetWidth" type="Int">
+        <label>The width of the search window (for internal use only)</label>
+        <default>0</default>
+      </entry>
+      <entry name="SearchWidgetHeight" type="Int">
+        <label>The height of the search window (for internal use only)</label>
+        <default>0</default>
+      </entry>
+      <entry name="ConfigureDialogWidth" type="Int">
+        <label>The width of the Configure KMail dialog (for internal use only)</label>
+        <default>0</default>
+      </entry>
+      <entry name="ConfigureDialogHeight" type="Int">
+        <label>The height of the Configure KMail dialog (for internal use only)</label>
+        <default>0</default>
+      </entry>
       <entry name="FolderViewWidth" type="Int">
         <default>250</default>
       </entry>
@@ -381,4 +463,39 @@
      <default>-1</default>
    </entry>
  </group>
+
+ <!-- Startup settings -->
+ <group name="Startup">
+   <entry name="UpdateLevel" type="Int" key="update-level">
+     <label>Specifies the number of updates to perform (for internal use only)</label>
+     <default>0</default>
+   </entry>
+ </group>
+ <!-- Main Folder View settings -->
+ <group name="MainFolderView">
+    <entry name="ToolTipDisplayPolicy" type="Int">
+      <label>Specifies the policy used when displaying policy</label>
+      <default>0</default>
+    </entry>
+ </group>
+
+ <!-- Search Dialog settings -->
+ <group name="SearchDialog">
+   <entry name="SubjectWidth" type="Int">
+     <label>Specifies the width of the subject field in the Search Window dialog (for internal use only)</label>
+     <default>150</default>
+   </entry>
+   <entry name="SenderWidth" type="Int">
+     <label>Specifies the width of the sender field in the Search Window dialog (for internal use only)</label>
+     <default>120</default>
+   </entry>
+   <entry name="DateWidth" type="Int">
+     <label>Specifies the width of the date field in the Search Window dialog (for internal use only)</label>
+     <default>120</default>
+   </entry>
+   <entry name="FolderWidth" type="Int">
+     <label>Specifies the width of the folder field in the Search Window dialog (for internal use only)</label>
+     <default>100</default>
+   </entry>
+ </group>
 </kcfg>
diff --git a/kmail/kmcommands.cpp b/kmail/kmcommands.cpp
index 2dfbec5..f664354 100644
--- a/kmail/kmcommands.cpp
+++ b/kmail/kmcommands.cpp
@@ -1310,8 +1310,7 @@ KMPrintCommand::KMPrintCommand( QWidget *parent, const Akonadi::Item &msg,
   if ( MessageCore::GlobalSettings::useDefaultFonts() )
     mOverrideFont = KGlobalSettings::generalFont();
   else {
-    KConfigGroup fonts( KMKernel::self()->config(), "Fonts" );
-    mOverrideFont = fonts.readEntry( "print-font", KGlobalSettings::generalFont() );
+    mOverrideFont = MessageCore::GlobalSettings::self()->printFont();
   }
 }
 
diff --git a/kmail/kmcomposereditor.cpp b/kmail/kmcomposereditor.cpp
index bdee9fb..1ec0cb8 100644
--- a/kmail/kmcomposereditor.cpp
+++ b/kmail/kmcomposereditor.cpp
@@ -83,15 +83,14 @@ void KMComposerEditor::setHighlighterColors(KPIMTextEdit::EMailQuoteHighlighter
   QColor misspelled = Qt::red;
 
   if ( !MessageCore::GlobalSettings::self()->useDefaultColors() ) {
-    KConfigGroup readerConfig( KMKernel::self()->config(), "Reader" );
-    color3 = readerConfig.readEntry( "QuotedText3", color3  );
-    color2 = readerConfig.readEntry( "QuotedText2", color2  );
-    color1 = readerConfig.readEntry( "QuotedText1", color1  );
-    misspelled = readerConfig.readEntry( "MisspelledColor", misspelled );
+    color1 = MessageCore::GlobalSettings::self()->quotedText1();
+    color2 = MessageCore::GlobalSettings::self()->quotedText2();
+    color3 = MessageCore::GlobalSettings::self()->quotedText3();
+    misspelled = MessageCore::GlobalSettings::self()->misspelledColor();
   }
 
   highlighter->setQuoteColor( Qt::black /* ignored anyway */,
-                              color3, color2, color1, misspelled );
+                              color1, color2, color3, misspelled );
 }
 
 QString KMComposerEditor::smartQuote( const QString & msg )
diff --git a/kmail/kmcomposewin.cpp b/kmail/kmcomposewin.cpp
index 17af19a..f31b170 100644
--- a/kmail/kmcomposewin.cpp
+++ b/kmail/kmcomposewin.cpp
@@ -340,8 +340,8 @@ KMComposeWin::KMComposeWin( const KMime::Message::Ptr &aMsg, Composer::TemplateC
     QColor signedColor = defaultSignedColor;
     QColor encryptedColor = defaultEncryptedColor;
     if ( !MessageCore::GlobalSettings::self()->useDefaultColors() ) {
-      signedColor = reader.readEntry( "PGPMessageOkKeyOk", defaultSignedColor );
-      encryptedColor = reader.readEntry( "PGPMessageEncr", defaultEncryptedColor );
+      signedColor = MessageCore::GlobalSettings::self()->pgpSignedMessageColor();
+      encryptedColor = MessageCore::GlobalSettings::self()->pgpEncryptedMessageColor();
     }
 
     p.setColor( QPalette::Window, signedColor );
@@ -1779,74 +1779,69 @@ void KMComposeWin::autoSaveMessage()
 bool KMComposeWin::encryptToSelf()
 {
   // return !Kpgp::Module::getKpgp() || Kpgp::Module::getKpgp()->encryptToSelf();
-  KConfigGroup group( KMKernel::self()->config(), "Composer" );
-  return group.readEntry( "crypto-encrypt-to-self", true );
+  return GlobalSettings::self()->cryptoEncryptToSelf();
 }
 
 bool KMComposeWin::showKeyApprovalDialog()
 {
-  KConfigGroup group( KMKernel::self()->config(), "Composer" );
-  return group.readEntry( "crypto-show-keys-for-approval", true );
+  return GlobalSettings::self()->cryptoShowKeysForApproval();
 }
 
 int KMComposeWin::encryptKeyNearExpiryWarningThresholdInDays() {
-  const KConfigGroup composer( KMKernel::self()->config(), "Composer" );
-  if ( ! composer.readEntry( "crypto-warn-when-near-expire", true ) ) {
+  if ( ! MessageComposer::MessageComposerSettings::self()->cryptoWarnWhenNearExpire() ) {
     return -1;
   }
-  const int num = composer.readEntry( "crypto-warn-encr-key-near-expire-int", 14 );
+  const int num =
+  MessageComposer::MessageComposerSettings::self()->cryptoWarnEncrKeyNearExpiryThresholdDays();
   return qMax( 1, num );
 }
 
 int KMComposeWin::signingKeyNearExpiryWarningThresholdInDays()
 {
-  const KConfigGroup composer( KMKernel::self()->config(), "Composer" );
-  if ( ! composer.readEntry( "crypto-warn-when-near-expire", true ) ) {
+  if ( ! MessageComposer::MessageComposerSettings::self()->cryptoWarnWhenNearExpire() ) {
     return -1;
   }
-  const int num = composer.readEntry( "crypto-warn-sign-key-near-expire-int", 14 );
+  const int num =
+  MessageComposer::MessageComposerSettings::self()->cryptoWarnSignKeyNearExpiryThresholdDays();
   return qMax( 1, num );
 }
 
 int KMComposeWin::encryptRootCertNearExpiryWarningThresholdInDays()
 {
-  const KConfigGroup composer( KMKernel::self()->config(), "Composer" );
-  if ( ! composer.readEntry( "crypto-warn-when-near-expire", true ) ) {
+  if ( ! MessageComposer::MessageComposerSettings::self()->cryptoWarnWhenNearExpire() ) {
     return -1;
   }
-  const int num = composer.readEntry( "crypto-warn-encr-root-near-expire-int", 14 );
+  const int num =
+  MessageComposer::MessageComposerSettings::self()->cryptoWarnEncrRootNearExpiryThresholdDays();
   return qMax( 1, num );
 }
 
 int KMComposeWin::signingRootCertNearExpiryWarningThresholdInDays() {
-  const KConfigGroup composer( KMKernel::self()->config(), "Composer" );
-  if ( ! composer.readEntry( "crypto-warn-when-near-expire", true ) ) {
+  if ( ! MessageComposer::MessageComposerSettings::self()->cryptoWarnWhenNearExpire() ) {
     return -1;
   }
   const int num =
-  composer.readEntry( "crypto-warn-sign-root-near-expire-int", 14 );
+  MessageComposer::MessageComposerSettings::self()->cryptoWarnSignRootNearExpiryThresholdDays();
   return qMax( 1, num );
 }
 
 int KMComposeWin::encryptChainCertNearExpiryWarningThresholdInDays()
 {
-  const KConfigGroup composer( KMKernel::self()->config(), "Composer" );
-  if ( ! composer.readEntry( "crypto-warn-when-near-expire", true ) ) {
+  if ( ! MessageComposer::MessageComposerSettings::self()->cryptoWarnWhenNearExpire() ) {
     return -1;
   }
   const int num =
-  composer.readEntry( "crypto-warn-encr-chaincert-near-expire-int", 14 );
+  MessageComposer::MessageComposerSettings::self()->cryptoWarnEncrChaincertNearExpiryThresholdDays();
   return qMax( 1, num );
 }
 
 int KMComposeWin::signingChainCertNearExpiryWarningThresholdInDays()
 {
-  const KConfigGroup composer( KMKernel::self()->config(), "Composer" );
-  if ( ! composer.readEntry( "crypto-warn-when-near-expire", true ) ) {
+  if ( ! MessageComposer::MessageComposerSettings::self()->cryptoWarnWhenNearExpire() ) {
     return -1;
   }
   const int num =
-  composer.readEntry( "crypto-warn-sign-chaincert-near-expire-int", 14 );
+  MessageComposer::MessageComposerSettings::self()->cryptoWarnSignChaincertNearExpiryThresholdDays();;
   return qMax( 1, num );
 }
 
@@ -1965,11 +1960,9 @@ void KMComposeWin::slotInsertFile()
   mRecentAction->addUrl( u );
   // Prevent race condition updating list when multiple composers are open
   {
-    KSharedConfig::Ptr config = KMKernel::self()->config();
-    KConfigGroup group( config, "Composer" );
     QString encoding = MessageViewer::NodeHelper::encodingForName( u.fileEncoding() ).toLatin1();
-    QStringList urls = group.readEntry( "recent-urls", QStringList() );
-    QStringList encodings = group.readEntry( "recent-encodings", QStringList() );
+    QStringList urls = GlobalSettings::self()->recentUrls();
+    QStringList encodings = GlobalSettings::self()->recentEncodings();
     // Prevent config file from growing without bound
     // Would be nicer to get this constant from KRecentFilesAction
     int mMaxRecentFiles = 30;
@@ -1984,9 +1977,9 @@ void KMComposeWin::slotInsertFile()
     }
     urls.prepend( u.prettyUrl() );
     encodings.prepend( encoding );
-    group.writeEntry( "recent-urls", urls );
-    group.writeEntry( "recent-encodings", encodings );
-    mRecentAction->saveEntries( config->group( QString() ) );
+    GlobalSettings::self()->setRecentUrls( urls );
+    GlobalSettings::self()->setRecentEncodings( encodings );
+    mRecentAction->saveEntries( KMKernel::self()->config()->group( QString() ) );
   }
   slotInsertRecentFile( u );
 }
@@ -2009,9 +2002,8 @@ void KMComposeWin::slotInsertRecentFile( const KUrl &u )
 
   // Get the encoding previously used when inserting this file
   QString encoding;
-  KConfigGroup group( KMKernel::self()->config(), "Composer" );
-  const QStringList urls = group.readEntry( "recent-urls", QStringList() );
-  const QStringList encodings = group.readEntry( "recent-encodings", QStringList() );
+  const QStringList urls = GlobalSettings::self()->recentUrls();
+  const QStringList encodings = GlobalSettings::self()->recentEncodings();
   const int index = urls.indexOf( u.prettyUrl() );
   if ( index != -1 ) {
     encoding = encodings[ index ];
diff --git a/kmail/kmfilterdlg.cpp b/kmail/kmfilterdlg.cpp
index 92d13e4..2d6855b 100644
--- a/kmail/kmfilterdlg.cpp
+++ b/kmail/kmfilterdlg.cpp
@@ -369,10 +369,8 @@ KMFilterDlg::KMFilterDlg(QWidget* parent, bool createDummyFilter )
   connect( mActionLister, SIGNAL( widgetRemoved() ), this, SLOT( slotDialogUpdated() ) );
   connect( mActionLister, SIGNAL( filterModified() ), this, SLOT( slotDialogUpdated() ) );
   
-  KConfigGroup geometry( KMKernel::self()->config(), "Geometry");
-  const char * configKey = "filterDialogSize";
-  if ( geometry.hasKey( configKey ) )
-    resize( geometry.readEntry( configKey, QSize() ));
+  if ( GlobalSettings::self()->filterDialogSize() != QSize()  )
+    resize( GlobalSettings::self()->filterDialogSize() );
   else
     adjustSize();
 
@@ -400,9 +398,8 @@ void KMFilterDlg::slotFinished() {
 	deleteLater();
 }
 
-void KMFilterDlg::slotSaveSize() {
-  KConfigGroup geometry( KMKernel::self()->config(), "Geometry" );
-  geometry.writeEntry( "filterDialogSize", size() );
+void KMFilterDlg::slotSaveSize() {  
+  GlobalSettings::self()->setFilterDialogSize( size() );
 }
 
 void KMFilterDlg::slotFilterSelected( MailFilter* aFilter )
diff --git a/kmail/kmkernel.cpp b/kmail/kmkernel.cpp
index 61e87a6..87a1a17 100644
--- a/kmail/kmkernel.cpp
+++ b/kmail/kmkernel.cpp
@@ -1091,13 +1091,10 @@ void KMKernel::init()
 {
   the_shuttingDown = false;
 
-  KSharedConfig::Ptr cfg = KMKernel::config();
-
-  KConfigGroup group(cfg, "General");
-  the_firstStart = group.readEntry("first-start", true );
-  group.writeEntry("first-start", false);
-  the_previousVersion = group.readEntry("previous-version");
-  group.writeEntry("previous-version", KMAIL_VERSION);
+  the_firstStart = GlobalSettings::self()->firstStart();
+  GlobalSettings::self()->setFirstStart( false );
+  the_previousVersion = GlobalSettings::self()->previousVersion();
+  GlobalSettings::self()->setPreviousVersion( KMAIL_VERSION );
 
   readConfig();
 
@@ -1208,10 +1205,9 @@ void KMKernel::cleanup(void)
   the_undoStack = 0;
 
   KSharedConfig::Ptr config =  KMKernel::config();
-  KConfigGroup group(config, "General");
   Akonadi::Collection trashCollection = CommonKernel->trashCollectionFolder();
   if ( trashCollection.isValid() ) {
-    if ( group.readEntry( "empty-trash-on-exit", false ) ) {
+    if ( GlobalSettings::self()->emptyTrashOnExit() ) {
       if ( trashCollection.statistics().count() > 0 ) {
         mFolderCollectionMonitor->expunge( trashCollection );
       }
@@ -1468,8 +1464,7 @@ void KMKernel::slotRunBackgroundTasks() // called regularly by timer
 {
   // Hidden KConfig keys. Not meant to be used, but a nice fallback in case
   // a stable kmail release goes out with a nasty bug in CompactionJob...
-  KConfigGroup generalGroup( config(), "General" );
-  if ( generalGroup.readEntry( "auto-expiring", true ) ) {
+  if ( GlobalSettings::self()->autoExpiring() ) {
       mFolderCollectionMonitor->expireAllFolders( false /*scheduled, not immediate*/, entityTreeModel() );
   }
 
diff --git a/kmail/kmmainwidget.cpp b/kmail/kmmainwidget.cpp
index b26e9ca..b0dae71 100644
--- a/kmail/kmmainwidget.cpp
+++ b/kmail/kmmainwidget.cpp
@@ -437,7 +437,7 @@ void KMMainWidget::slotEndCheckMail()
                           KNotification::CloseOnTimeout );
   }
 
-  if ( mBeepOnNew ) {
+  if ( GlobalSettings::self()->beepOnMail() ) {
     KNotification::beep();
   }
 }
@@ -832,9 +832,6 @@ void KMMainWidget::readConfig()
   }
 
   { // area for config group "General"
-    KConfigGroup group( config, "General" );
-    mBeepOnNew = group.readEntry( "beep-on-mail", false );
-    mConfirmEmpty = group.readEntry( "confirm-before-empty", true );
     if ( !mStartupDone )
     {
       // check mail on startup
@@ -1485,7 +1482,7 @@ void KMMainWidget::slotEmptyFolder()
 
   if (!mCurrentFolder) return;
   const bool isTrash = CommonKernel->folderIsTrash( mCurrentFolder->collection() );
-  if (mConfirmEmpty)
+  if ( GlobalSettings::self()->confirmBeforeEmpty() )
   {
     const QString title = (isTrash) ? i18n("Empty Trash") : i18n("Move to Trash");
     const QString text = (isTrash) ?
diff --git a/kmail/kmmainwidget.h b/kmail/kmmainwidget.h
index 0648189..efecdca 100644
--- a/kmail/kmmainwidget.h
+++ b/kmail/kmmainwidget.h
@@ -575,8 +575,6 @@ private:
     Akonadi::Collection mTemplateFolder;
     QMenu        *mViewMenu, *mBodyPartsMenu;
     KAction      *mlistFilterAction;
-    bool          mBeepOnNew;
-    bool          mConfirmEmpty;
     int           mMessageStatusId;
     KUrl          mUrlCurrent;
     QMenu        *mActMenu;
diff --git a/kmail/kmstartup.cpp b/kmail/kmstartup.cpp
index ef54d75..0a1aa74 100644
--- a/kmail/kmstartup.cpp
+++ b/kmail/kmstartup.cpp
@@ -79,15 +79,14 @@ void checkConfigUpdates() {
   // Warning: do not remove entries in the above array, or the update-level check below will break
 
   KSharedConfig::Ptr config = KMKernel::self()->config();
-  KConfigGroup startup( config, "Startup" );
-  const int configUpdateLevel = startup.readEntry( "update-level", 0 );
+  const int configUpdateLevel = GlobalSettings::self()->updateLevel();
   if ( configUpdateLevel == numUpdates ) // Optimize for the common case that everything is OK
     return;
 
   for ( int i = configUpdateLevel ; i < numUpdates ; ++i ) {
     config->checkUpdate( updates[i], "kmail.upd" );
   }
-  startup.writeEntry( "update-level", numUpdates );
+  GlobalSettings::self()->setUpdateLevel( numUpdates );
 }
 
 void lockOrDie() {
diff --git a/kmail/searchwindow.cpp b/kmail/searchwindow.cpp
index 4b5ccdc..fa1f3b0 100644
--- a/kmail/searchwindow.cpp
+++ b/kmail/searchwindow.cpp
@@ -100,7 +100,6 @@ SearchWindow::SearchWindow( KMMainWidget *widget, const Akonadi::Collection &col
                                                                IconSize( KIconLoader::Small ) ) );
 
   KSharedConfig::Ptr config = KMKernel::self()->config();
-  KConfigGroup group( config, "SearchDialog" );
 
   QWidget *searchWidget = new QWidget( this );
   QVBoxLayout *vbl = new QVBoxLayout( searchWidget );
@@ -269,8 +268,8 @@ SearchWindow::SearchWindow( KMMainWidget *widget, const Akonadi::Collection &col
   mStatusBar->insertPermanentItem( QString(), 1, 1 );
   mStatusBar->setItemAlignment( 1, Qt::AlignLeft | Qt::AlignVCenter );
 
-  const int mainWidth = group.readEntry( "SearchWidgetWidth", 0 );
-  const int mainHeight = group.readEntry( "SearchWidgetHeight", 0 );
+  const int mainWidth = GlobalSettings::self()->searchWidgetWidth();
+  const int mainHeight = GlobalSettings::self()->searchWidgetHeight();
 
   if ( mainWidth || mainHeight )
     resize( mainWidth, mainHeight );
@@ -357,16 +356,14 @@ SearchWindow::SearchWindow( KMMainWidget *widget, const Akonadi::Collection &col
 
 SearchWindow::~SearchWindow()
 {
-  if ( mResultModel ) {
-    KSharedConfig::Ptr config = KMKernel::self()->config();
-    KConfigGroup group( config, "SearchDialog" );
-    group.writeEntry( "SubjectWidth", mLbxMatches->columnWidth( 0 ) );
-    group.writeEntry( "SenderWidth", mLbxMatches->columnWidth( 1 ) );
-    group.writeEntry( "DateWidth", mLbxMatches->columnWidth( 2 ) );
-    group.writeEntry( "FolderWidth", mLbxMatches->columnWidth( 3 ) );
-    group.writeEntry( "SearchWidgetWidth", width() );
-    group.writeEntry( "SearchWidgetHeight", height() );
-    config->sync();
+  if ( mResultModel ) {    
+    GlobalSettings::self()->setSubjectWidth( mLbxMatches->columnWidth( 0 ) );
+    GlobalSettings::self()->setSenderWidth( mLbxMatches->columnWidth( 1 ) );
+    GlobalSettings::self()->setDateWidth( mLbxMatches->columnWidth( 2 ) );
+    GlobalSettings::self()->setFolderWidth( mLbxMatches->columnWidth( 3 ) );
+    GlobalSettings::self()->setSearchWidgetWidth( width() );
+    GlobalSettings::self()->setSearchWidgetHeight( height() );
+    GlobalSettings::self()->requestSync();
   }
 }
 
@@ -551,13 +548,10 @@ void SearchWindow::searchDone( KJob* job )
     mResultModel->setCollection( mFolder );
     mLbxMatches->setModel( mResultModel );
 
-    KSharedConfig::Ptr config = KMKernel::self()->config();
-    KConfigGroup group( config, "SearchDialog" );
-
-    mLbxMatches->setColumnWidth( 0, group.readEntry( "SubjectWidth", 150 ) );
-    mLbxMatches->setColumnWidth( 1, group.readEntry( "SenderWidth", 120 ) );
-    mLbxMatches->setColumnWidth( 2, group.readEntry( "DateWidth", 120 ) );
-    mLbxMatches->setColumnWidth( 3, group.readEntry( "FolderWidth", 100 ) );
+    mLbxMatches->setColumnWidth( 0, GlobalSettings::self()->subjectWidth() );
+    mLbxMatches->setColumnWidth( 1, GlobalSettings::self()->senderWidth() );
+    mLbxMatches->setColumnWidth( 2, GlobalSettings::self()->dateWidth() );
+    mLbxMatches->setColumnWidth( 3, GlobalSettings::self()->folderWidth() );
     mLbxMatches->setColumnWidth( 4, 0 );
     mLbxMatches->header()->setSortIndicator( 2, Qt::DescendingOrder );
     mLbxMatches->header()->setStretchLastSection( false );
diff --git a/messagecomposer/messagecomposer.kcfg.cmake b/messagecomposer/messagecomposer.kcfg.cmake
index 203668a3..0e93ba4 100644
--- a/messagecomposer/messagecomposer.kcfg.cmake
+++ b/messagecomposer/messagecomposer.kcfg.cmake
@@ -110,6 +110,46 @@ xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/sta
         <min>30</min>
         <max>998</max>
       </entry>
+    <entry name="CryptoWarningUnencrypted" type="Bool" key="crypto-warning-unencrypted">
+        <label>Warn before sending unencrypted messages.</label>
+        <default>false</default>
+    </entry>
+    <entry name="CryptoWarningUnsigned" type="Bool" key="crypto-warning-unsigned">
+        <label>Warn before sending unsigned messages</label>
+        <default>false</default>
+    </entry>
+    <entry name="CryptoWarnRecvNotInCert" type="Bool" key="crypto-warn-recv-not-in-cert">
+        <label>Warn if the receiver's address is not in the certificate</label>
+        <default>true</default>
+    </entry>
+    <entry name="CryptoWarnWhenNearExpire" type="Bool" key="crypto-warn-when-near-expire">
+        <label>Warn if certificates/keys expire soon (configure thresholds below)</label>
+        <default>true</default>
+    </entry>
+    <entry name="CryptoWarnSignKeyNearExpiryThresholdDays" type="Int" key="crypto-warn-sign-key-near-expire-int">
+        <label>The minimum number of days that the signature certificate should be valid before issuing a warning</label>
+        <default>14</default>
+    </entry>
+    <entry name="CryptoWarnSignChaincertNearExpiryThresholdDays" type="Int" key="crypto-warn-sign-chaincert-near-expire-int">
+        <label>The minimum number of days that the CA certificate should be valid before issuing a warning</label>
+        <default>14</default>
+    </entry>
+    <entry name="CryptoWarnSignRootNearExpiryThresholdDays" type="Int" key="crypto-warn-sign-root-near-expire-int">
+        <label>The minimum number of days that the root certificate should be valid before issuing a warning</label>
+        <default>14</default>
+    </entry>
+    <entry name="CryptoWarnEncrKeyNearExpiryThresholdDays" type="Int" key="crypto-warn-encr-key-near-expire-int">
+        <label>The minimum number of days that the encryption certificate should be valid before issuing a warning</label>
+        <default>14</default>
+    </entry>
+    <entry name="CryptoWarnEncrChaincertNearExpiryThresholdDays" type="Int" key="crypto-warn-encr-chaincert-near-expire-int">
+        <label>The minimum number of days that all certificates in the chain should be valid before issuing a warning</label>
+        <default>14</default>
+    </entry>
+    <entry name="CryptoWarnEncrRootNearExpiryThresholdDays" type="Int" key="crypto-warn-encr-root-near-expire-int">
+        <label>The minimum number of days that the root certificate should be valid before issuing a warning</label>
+        <default>14</default>
+    </entry>
   </group>
 
   <group name="sending mail">
diff --git a/messagecore/messagecore.kcfg b/messagecore/messagecore.kcfg
index f1a5425..ca5eb57 100644
--- a/messagecore/messagecore.kcfg
+++ b/messagecore/messagecore.kcfg
@@ -5,7 +5,8 @@
 
   <kcfgfile name="messagecorerc" />
   <include>qtextcodec.h</include>
-
+  <include>kglobalsettings.h</include>
+  
   <group name="General">
     <entry name="disregardUmask" type="Bool">
       <label>Disregard the user's umask setting and use "read-write for the user only" instead</label>
@@ -22,6 +23,10 @@
     <entry name="UseDefaultFonts" type="Bool" key="defaultFonts">
       <default>true</default>
     </entry>
+    <entry name="PrintFont" type="Font" key="print-font">
+      <label>Specifies the font to use for printing</label>
+      <default code="true">KGlobalSettings::generalFont()</default>
+    </entry>
   </group>
 
   <group name="Reader">
@@ -41,6 +46,30 @@
       <default></default>
       <whatsthis>Changing this from its default 'Auto' will force the use of the specified encoding for all emails, regardless of what they specify themselves.</whatsthis>
     </entry>
+    <entry name="QuotedText3" type="Color">
+      <label>This is the colour used in the 3rd level of quoted text</label>
+      <default>#006000</default>
+    </entry>
+    <entry name="QuotedText2" type="Color">
+      <label>This is the colour used in the 2nd level of quoted text</label>
+      <default>#007000</default>
+    </entry>
+    <entry name="QuotedText1" type="Color">
+      <label>This is the colour used in the 1st level of quoted text</label>
+      <default>#008000</default>
+    </entry>
+    <entry name="MisspelledColor" type="Color">
+      <label>This is the colour used to hightlight mispelled words</label>
+      <default>red</default>
+    </entry>
+    <entry name="PgpSignedMessageColor" type="Color" key="PGPMessageOkKeyOk">
+      <label>This is the colour used for hightlighting all signed messages</label>
+      <default code="yes">KColorScheme( QPalette::Active, KColorScheme::View ).background( KColorScheme::PositiveBackground ).color()</default>
+    </entry>
+    <entry name="PgpEncryptedMessageColor" type="Color" key="PGPMessageEncr">
+      <label>This is the colour used for highlighting all encrypted messages</label>
+      <default>#0080FF</default>
+    </entry>
   </group>
 
   <group name="Composer">
diff --git a/messageviewer/messageviewer.kcfg.cmake b/messageviewer/messageviewer.kcfg.cmake
index 3ae0f43..c712246 100644
--- a/messageviewer/messageviewer.kcfg.cmake
+++ b/messageviewer/messageviewer.kcfg.cmake
@@ -131,6 +131,10 @@ xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/sta
       <label>How attachments are shown</label>
       <default>Smart</default>
     </entry>
+    <entry name="RecycleQuoteColors" type="Bool">
+      <label>Specifies whether to reuse the quote colour, beyond the 3rd level</label>
+      <default>false</default>
+    </entry>
   </group>
 
   <group name="TextIndex">
@@ -145,6 +149,14 @@ xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/sta
       <label>Do not send MDNs in response to encrypted messages</label>
       <default>true</default>
     </entry>
+    <entry name="DefaultPolicy" type="Int" key="default-policy">
+      <label>Specifies the default policy to use, for the Message Disposition Notifications (for internal use only)</label>
+      <default>0</default>
+    </entry>
+    <entry name="QuoteMessage" type="Int" key="quote-message">
+      <label>Specifies the default quoting action to take, when replying to a message (for internal use only)</label>
+      <default>0</default>
+    </entry>
   </group>
 
   <group name="Behaviour">
Comment 16 Myriam Schweingruber 2012-08-18 08:33:58 UTC
Thank you for your feature request. Kmail1 is currently unmaintained so we are closing all wishes. Please feel free to reopen a feature request for Kmail2 if it has not already been implemented.
Thank you for your understanding.
Comment 17 Luigi Toscano 2012-08-19 00:49:11 UTC
Instead of creating a new feature request, please confirm here if the wishlist is still valid for kmail2.