// This file is generated by kconfig_compiler_kf6 from kmail.kcfg.
// All changes you do to this file will be lost.

#include "globalsettings_kmail.h"

#include <klocalizedstring.h>

#include <qglobal.h>
#include <QFile>

class GlobalSettingsBaseHelper
{
  public:
    GlobalSettingsBaseHelper() : q(nullptr) {}
    ~GlobalSettingsBaseHelper() { delete q; q = nullptr; }
    GlobalSettingsBaseHelper(const GlobalSettingsBaseHelper&) = delete;
    GlobalSettingsBaseHelper& operator=(const GlobalSettingsBaseHelper&) = delete;
    GlobalSettingsBase *q;
};
Q_GLOBAL_STATIC(GlobalSettingsBaseHelper, s_globalGlobalSettingsBase)
GlobalSettingsBase *GlobalSettingsBase::self()
{
  if (!s_globalGlobalSettingsBase()->q) {
    new GlobalSettingsBase;
    s_globalGlobalSettingsBase()->q->read();
  }

  return s_globalGlobalSettingsBase()->q;
}

GlobalSettingsBase::GlobalSettingsBase( )
  : KConfigSkeleton( QStringLiteral( "kmail2rc" ) )
{
  Q_ASSERT(!s_globalGlobalSettingsBase()->q);
  s_globalGlobalSettingsBase()->q = this;
  setCurrentGroup( QStringLiteral( "Behaviour" ) );

  QList<KConfigSkeleton::ItemEnum::Choice> valuesActionEnterFolder;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("SelectFirstUnread");
    valuesActionEnterFolder.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("SelectLastSelected");
    valuesActionEnterFolder.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("SelectNewest");
    valuesActionEnterFolder.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("SelectOldest");
    valuesActionEnterFolder.append( choice );
  }
  mActionEnterFolderItem = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "ActionEnterFolder" ), mActionEnterFolder, valuesActionEnterFolder, EnumActionEnterFolder::SelectLastSelected );
  mActionEnterFolderItem->setLabel( i18nd("kmail", "ActionEnterFolder") );
  addItem( mActionEnterFolderItem, QStringLiteral( "ActionEnterFolder" ) );
  QList<KConfigSkeleton::ItemEnum::Choice> valuesNetworkState;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("Online");
    valuesNetworkState.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("Offline");
    valuesNetworkState.append( choice );
  }
  mNetworkStateItem = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "NetworkState" ), mNetworkState, valuesNetworkState, EnumNetworkState::Online );
  mNetworkStateItem->setLabel( i18nd("kmail", "NetworkState") );
  addItem( mNetworkStateItem, QStringLiteral( "NetworkState" ) );
  QList<KConfigSkeleton::ItemEnum::Choice> valuesLoopOnGotoUnread;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("DontLoop");
    valuesLoopOnGotoUnread.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("LoopInCurrentFolder");
    valuesLoopOnGotoUnread.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("LoopInAllFolders");
    valuesLoopOnGotoUnread.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("LoopInAllMarkedFolders");
    valuesLoopOnGotoUnread.append( choice );
  }
  mLoopOnGotoUnreadItem = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "LoopOnGotoUnread" ), mLoopOnGotoUnread, valuesLoopOnGotoUnread, EnumLoopOnGotoUnread::DontLoop );
  mLoopOnGotoUnreadItem->setLabel( i18nd("kmail", "LoopOnGotoUnread") );
  addItem( mLoopOnGotoUnreadItem, QStringLiteral( "LoopOnGotoUnread" ) );
  mEnableFolderDnDItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "EnableFolderDnD" ), mEnableFolderDnD, true );
  mEnableFolderDnDItem->setLabel( i18nd("kmail", "EnableFolderDnD") );
  addItem( mEnableFolderDnDItem, QStringLiteral( "EnableFolderDnD" ) );
  mShowPopupAfterDnDItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ShowPopupAfterDnD" ), mShowPopupAfterDnD, true );
  mShowPopupAfterDnDItem->setLabel( i18nd("kmail", "ShowPopupAfterDnD") );
  addItem( mShowPopupAfterDnDItem, QStringLiteral( "ShowPopupAfterDnD" ) );
  mExcludeImportantMailFromExpiryItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ExcludeImportantMailFromExpiry" ), mExcludeImportantMailFromExpiry, true );
  mExcludeImportantMailFromExpiryItem->setLabel( i18nd("kmail", "ExcludeImportantMailFromExpiry") );
  mExcludeImportantMailFromExpiryItem->setWhatsThis( i18nd("kmail", "This prevents the automatic expiry of old messages in a folder from deleting (or moving to an archive folder) the messages that are marked 'Important' or 'Action Item'") );
  addItem( mExcludeImportantMailFromExpiryItem, QStringLiteral( "ExcludeImportantMailFromExpiry" ) );
  mAllowLocalFlagsItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "AllowLocalFlags" ), mAllowLocalFlags, false );
  mAllowLocalFlagsItem->setLabel( i18nd("kmail", "Allow local flags in read-only folders") );
  addItem( mAllowLocalFlagsItem, QStringLiteral( "AllowLocalFlags" ) );
  QList<KConfigSkeleton::ItemEnum::Choice> valuesSendOnCheck;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("DontSendOnCheck");
    valuesSendOnCheck.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("SendOnManualChecks");
    valuesSendOnCheck.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("SendOnAllChecks");
    valuesSendOnCheck.append( choice );
  }
  mSendOnCheckItem = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "SendOnCheck" ), mSendOnCheck, valuesSendOnCheck, EnumSendOnCheck::DontSendOnCheck );
  mSendOnCheckItem->setLabel( i18nd("kmail", "Send queued mail on mail check") );
  mSendOnCheckItem->setWhatsThis( i18nd("kmail", "<qt><p>Select whether you want KMail to send all messages in the outbox on manual or all mail checks, or whether you do not want messages to be sent automatically at all. </p></qt>") );
  addItem( mSendOnCheckItem, QStringLiteral( "SendOnCheck" ) );

  setCurrentGroup( QStringLiteral( "FolderSelectionDialog" ) );

  mLastSelectedFolderItem = new KConfigSkeleton::ItemLongLong( currentGroup(), QStringLiteral( "LastSelectedFolder" ), mLastSelectedFolder, -1 );
  mLastSelectedFolderItem->setLabel( i18nd("kmail", "LastSelectedFolder") );
  mLastSelectedFolderItem->setWhatsThis( i18nd("kmail", "The most recently selected folder in the folder selection dialog.") );
  addItem( mLastSelectedFolderItem, QStringLiteral( "LastSelectedFolder" ) );

  setCurrentGroup( QStringLiteral( "General" ) );

  mPlasmaActivitySupportItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "PlasmaActivitySupport" ), mPlasmaActivitySupport, false );
  mPlasmaActivitySupportItem->setLabel( i18nd("kmail", "PlasmaActivitySupport") );
  addItem( mPlasmaActivitySupportItem, QStringLiteral( "PlasmaActivitySupport" ) );
  mWarnBeforeExpireItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "warn-before-expire" ), mWarnBeforeExpire, true );
  mWarnBeforeExpireItem->setLabel( i18nd("kmail", "warn-before-expire") );
  addItem( mWarnBeforeExpireItem, QStringLiteral( "WarnBeforeExpire" ) );
  mSystemTrayEnabledItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "SystemTrayEnabled" ), mSystemTrayEnabled, false );
  mSystemTrayEnabledItem->setLabel( i18nd("kmail", "Enable system tray icon") );
  addItem( mSystemTrayEnabledItem, QStringLiteral( "SystemTrayEnabled" ) );
  mStartInTrayItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "StartInTray" ), mStartInTray, false );
  mStartInTrayItem->setLabel( i18nd("kmail", "Start minimized to tray") );
  addItem( mStartInTrayItem, QStringLiteral( "StartInTray" ) );
  mShowUnreadInTaskbarItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ShowUnreadInTaskbar" ), mShowUnreadInTaskbar, true );
  mShowUnreadInTaskbarItem->setLabel( i18nd("kmail", "Show Unread Email in TaskBar") );
  addItem( mShowUnreadInTaskbarItem, QStringLiteral( "ShowUnreadInTaskbar" ) );
  mExternalEditorItem = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "external-editor" ), mExternalEditor, QStringLiteral( "kwrite %f" ) );
  mExternalEditorItem->setLabel( i18nd("kmail", "Specify e&ditor:") );
  addItem( mExternalEditorItem, QStringLiteral( "ExternalEditor" ) );
  mUseExternalEditorItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "use-external-editor" ), mUseExternalEditor, false );
  mUseExternalEditorItem->setLabel( i18nd("kmail", "Use e&xternal editor instead of composer") );
  addItem( mUseExternalEditorItem, QStringLiteral( "UseExternalEditor" ) );
  mCustomMessageHeadersCountItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "mime-header-count" ), mCustomMessageHeadersCount );
  mCustomMessageHeadersCountItem->setLabel( i18nd("kmail", "mime-header-count") );
  addItem( mCustomMessageHeadersCountItem, QStringLiteral( "CustomMessageHeadersCount" ) );
  mCloseToQuotaThresholdItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "CloseToQuotaThreshold" ), mCloseToQuotaThreshold, 80 );
  mCloseToQuotaThresholdItem->setLabel( i18nd("kmail", "The threshold for when to warn the user that a folder is nearing its quota limit.") );
  addItem( mCloseToQuotaThresholdItem, QStringLiteral( "CloseToQuotaThreshold" ) );
  mEmptyTrashOnExitItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "empty-trash-on-exit" ), mEmptyTrashOnExit, false );
  mEmptyTrashOnExitItem->setLabel( i18nd("kmail", "Empty the local trash folder on program exit") );
  addItem( mEmptyTrashOnExitItem, QStringLiteral( "EmptyTrashOnExit" ) );
  mDeleteMessageWithoutConfirmationItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "delete-messages-without-confirmation" ), mDeleteMessageWithoutConfirmation, false );
  mDeleteMessageWithoutConfirmationItem->setLabel( i18nd("kmail", "Delete messages without confirmation") );
  addItem( mDeleteMessageWithoutConfirmationItem, QStringLiteral( "DeleteMessageWithoutConfirmation" ) );
  mStartSpecificFolderAtStartupItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "startSpecificFolderAtStatup" ), mStartSpecificFolderAtStartup, true );
  mStartSpecificFolderAtStartupItem->setLabel( i18nd("kmail", "Allow to start specific folder") );
  addItem( mStartSpecificFolderAtStartupItem, QStringLiteral( "StartSpecificFolderAtStartup" ) );
  mStartupFolderItem = new KConfigSkeleton::ItemLongLong( currentGroup(), QStringLiteral( "startupFolder" ), mStartupFolder, -1 );
  mStartupFolderItem->setLabel( i18nd("kmail", "Specify the folder to open when the program is started") );
  addItem( mStartupFolderItem, QStringLiteral( "StartupFolder" ) );
  mCheckCollectionsIndexingItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "check-collections-indexing" ), mCheckCollectionsIndexing, true );
  mCheckCollectionsIndexingItem->setLabel( i18nd("kmail", "check-collections-indexing") );
  addItem( mCheckCollectionsIndexingItem, QStringLiteral( "CheckCollectionsIndexing" ) );
  mAutoExpiringItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "auto-expiring" ), mAutoExpiring, true );
  mAutoExpiringItem->setLabel( i18nd("kmail", "auto-expiring") );
  addItem( mAutoExpiringItem, QStringLiteral( "AutoExpiring" ) );
  mFirstStartItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "first-start" ), mFirstStart, true );
  mFirstStartItem->setLabel( i18nd("kmail", "first-start") );
  addItem( mFirstStartItem, QStringLiteral( "FirstStart" ) );
  mShowMenuBarItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ShowMenuBar" ), mShowMenuBar, true );
  mShowMenuBarItem->setLabel( i18nd("kmail", "ShowMenuBar") );
  addItem( mShowMenuBarItem, QStringLiteral( "ShowMenuBar" ) );
  mReaderShowMenuBarItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ReaderShowMenuBar" ), mReaderShowMenuBar, true );
  mReaderShowMenuBarItem->setLabel( i18nd("kmail", "ReaderShowMenuBar") );
  addItem( mReaderShowMenuBarItem, QStringLiteral( "ReaderShowMenuBar" ) );
  mComposerShowMenuBarItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ComposerShowMenuBar" ), mComposerShowMenuBar, true );
  mComposerShowMenuBarItem->setLabel( i18nd("kmail", "ComposerShowMenuBar") );
  addItem( mComposerShowMenuBarItem, QStringLiteral( "ComposerShowMenuBar" ) );
  mAskEnableUnifiedMailboxesItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "AskEnableUnifiedMailboxes" ), mAskEnableUnifiedMailboxes, true );
  mAskEnableUnifiedMailboxesItem->setLabel( i18nd("kmail", "Whether to ask if users wants to enable Unified Mailboxes if more than one email accounts are detected. We only ever ask once.") );
  addItem( mAskEnableUnifiedMailboxesItem, QStringLiteral( "AskEnableUnifiedMailboxes" ) );

  setCurrentGroup( QStringLiteral( "Internal" ) );

  mPreviousNewFeaturesMD5Item = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "PreviousNewFeaturesMD5" ), mPreviousNewFeaturesMD5 );
  mPreviousNewFeaturesMD5Item->setLabel( i18nd("kmail", "PreviousNewFeaturesMD5") );
  mPreviousNewFeaturesMD5Item->setWhatsThis( i18nd("kmail", "This value is used to decide whether the KMail Introduction should be displayed.") );
  addItem( mPreviousNewFeaturesMD5Item, QStringLiteral( "PreviousNewFeaturesMD5" ) );

  setCurrentGroup( QStringLiteral( "UserInterface" ) );

  mEnableFolderQuickSearchItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "EnableFolderQuickSearch" ), mEnableFolderQuickSearch, false );
  mEnableFolderQuickSearchItem->setLabel( i18nd("kmail", "Show folder quick search line edit") );
  addItem( mEnableFolderQuickSearchItem, QStringLiteral( "EnableFolderQuickSearch" ) );

  setCurrentGroup( QStringLiteral( "Composer" ) );

  mForwardingInlineByDefaultItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ForwardingInlineByDefault" ), mForwardingInlineByDefault, false );
  mForwardingInlineByDefaultItem->setLabel( i18nd("kmail", "Forward Inline As Default.") );
  addItem( mForwardingInlineByDefaultItem, QStringLiteral( "ForwardingInlineByDefault" ) );
  mTooManyRecipientsItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "too-many-recipients" ), mTooManyRecipients, false );
  mTooManyRecipientsItem->setLabel( i18nd("kmail", "Warn if the number of recipients is more than:") );
  mTooManyRecipientsItem->setWhatsThis( i18nd("kmail", "If the number of recipients is larger than this value, KMail will warn and ask for a confirmation before sending the mail. The warning can be turned off.") );
  addItem( mTooManyRecipientsItem, QStringLiteral( "TooManyRecipients" ) );
  mRecipientThresholdItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "recipient-threshold" ), mRecipientThreshold, 5 );
  mRecipientThresholdItem->setMinValue(1);
  mRecipientThresholdItem->setMaxValue(100);
  mRecipientThresholdItem->setLabel( i18nd("kmail", "recipient-threshold") );
  mRecipientThresholdItem->setWhatsThis( i18nd("kmail", "If the number of recipients is larger than this value, KMail will warn and ask for a confirmation before sending the mail. The warning can be turned off.") );
  addItem( mRecipientThresholdItem, QStringLiteral( "RecipientThreshold" ) );
  mPreviousIdentityItem = new KConfigSkeleton::ItemUInt( currentGroup(), QStringLiteral( "previous-identity" ), mPreviousIdentity );
  mPreviousIdentityItem->setLabel( i18nd("kmail", "previous-identity") );
  addItem( mPreviousIdentityItem, QStringLiteral( "PreviousIdentity" ) );
  mPreviousFccItem = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "previous-fcc" ), mPreviousFcc );
  mPreviousFccItem->setLabel( i18nd("kmail", "previous-fcc") );
  addItem( mPreviousFccItem, QStringLiteral( "PreviousFcc" ) );
  mPreviousDictionaryItem = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "PreviousDictionary" ), mPreviousDictionary );
  mPreviousDictionaryItem->setLabel( i18nd("kmail", "PreviousDictionary") );
  addItem( mPreviousDictionaryItem, QStringLiteral( "PreviousDictionary" ) );
  mCurrentTransportItem = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "current-transport" ), mCurrentTransport );
  mCurrentTransportItem->setLabel( i18nd("kmail", "current-transport") );
  addItem( mCurrentTransportItem, QStringLiteral( "CurrentTransport" ) );
  mUseHtmlMarkupItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "html-markup" ), mUseHtmlMarkup, false );
  mUseHtmlMarkupItem->setLabel( i18nd("kmail", "html-markup") );
  addItem( mUseHtmlMarkupItem, QStringLiteral( "UseHtmlMarkup" ) );
  mAlwaysEncryptDraftsItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "always-encrypt-drafts" ), mAlwaysEncryptDrafts, true );
  mAlwaysEncryptDraftsItem->setLabel( i18nd("kmail", "always-encrypt-drafts") );
  addItem( mAlwaysEncryptDraftsItem, QStringLiteral( "AlwaysEncryptDrafts" ) );
  mConfirmBeforeSendItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "confirm-before-send" ), mConfirmBeforeSend, false );
  mConfirmBeforeSendItem->setLabel( i18nd("kmail", "Confirm &before send") );
  addItem( mConfirmBeforeSendItem, QStringLiteral( "ConfirmBeforeSend" ) );
  mConfirmBeforeSendWhenUseShortcutItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "confirm-before-send-when-use-shortcut" ), mConfirmBeforeSendWhenUseShortcut, false );
  mConfirmBeforeSendWhenUseShortcutItem->setLabel( i18nd("kmail", "confirm-before-send-when-use-shortcut") );
  addItem( mConfirmBeforeSendWhenUseShortcutItem, QStringLiteral( "ConfirmBeforeSendWhenUseShortcut" ) );
  mCheckSpellingBeforeSendItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "check-spelling-before-send" ), mCheckSpellingBeforeSend, false );
  mCheckSpellingBeforeSendItem->setLabel( i18nd("kmail", "Check spelling before send") );
  addItem( mCheckSpellingBeforeSendItem, QStringLiteral( "CheckSpellingBeforeSend" ) );
  mRequestMDNItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "request-mdn" ), mRequestMDN, false );
  mRequestMDNItem->setLabel( i18nd("kmail", "Automatically request &message disposition notifications") );
  mRequestMDNItem->setWhatsThis( i18nd("kmail", "<qt><p>Enable this option if you want KMail to request Message Disposition Notifications (MDNs) for each of your outgoing messages.</p><p>This option only affects the default; you can still enable or disable MDN requesting on a per-message basis in the composer, menu item <em>Options</em>-><em>Request Disposition Notification</em>.</p></qt>") );
  addItem( mRequestMDNItem, QStringLiteral( "RequestMDN" ) );
  mHeadersItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "headers" ), mHeaders, KMail::Composer::HDR_SUBJECT|KMail::Composer::HDR_FROM );
  mHeadersItem->setLabel( i18nd("kmail", "headers") );
  addItem( mHeadersItem, QStringLiteral( "Headers" ) );
  mCompletionModeItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "Completion Mode" ), mCompletionMode, KCompletion::CompletionPopup );
  mCompletionModeItem->setLabel( i18nd("kmail", "Completion Mode") );
  addItem( mCompletionModeItem, QStringLiteral( "CompletionMode" ) );
  mAutoSpellCheckingItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "autoSpellChecking" ), mAutoSpellChecking, true );
  mAutoSpellCheckingItem->setLabel( i18nd("kmail", "autoSpellChecking") );
  addItem( mAutoSpellCheckingItem, QStringLiteral( "AutoSpellChecking" ) );
  mShowForgottenAttachmentWarningItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "showForgottenAttachmentWarning" ), mShowForgottenAttachmentWarning, true );
  mShowForgottenAttachmentWarningItem->setLabel( i18nd("kmail", "showForgottenAttachmentWarning") );
  addItem( mShowForgottenAttachmentWarningItem, QStringLiteral( "ShowForgottenAttachmentWarning" ) );
  mAttachmentKeywordsItem = new KConfigSkeleton::ItemStringList( currentGroup(), QStringLiteral( "attachment-keywords" ), mAttachmentKeywords, 
        MessageComposer::Util::AttachmentKeywords()
         );
  mAttachmentKeywordsItem->setLabel( i18nd("kmail", "attachment-keywords") );
  addItem( mAttachmentKeywordsItem, QStringLiteral( "AttachmentKeywords" ) );
  mAutosaveIntervalItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "autosave" ), mAutosaveInterval, 2 );
  mAutosaveIntervalItem->setLabel( i18nd("kmail", "Autosave interval:") );
  mAutosaveIntervalItem->setWhatsThis( i18nd("kmail", "A backup copy of the text in the composer window can be created regularly. The interval used to create the backups is set here. You can disable autosaving by setting it to the value 0.") );
  addItem( mAutosaveIntervalItem, QStringLiteral( "AutosaveInterval" ) );
  mCustomTemplatesItem = new KConfigSkeleton::ItemStringList( currentGroup(), QStringLiteral( "CustomTemplates" ), mCustomTemplates );
  mCustomTemplatesItem->setLabel( i18nd("kmail", "CustomTemplates") );
  addItem( mCustomTemplatesItem, QStringLiteral( "CustomTemplates" ) );
  mShowSnippetManagerItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ShowSnippetManager" ), mShowSnippetManager, false );
  mShowSnippetManagerItem->setLabel( i18nd("kmail", "Show the Text Snippet Management and Insertion Panel in the composer.") );
  addItem( mShowSnippetManagerItem, QStringLiteral( "ShowSnippetManager" ) );
  QList<int> defaultSnippetSplitterPosition;

  mSnippetSplitterPositionItem = new KConfigSkeleton::ItemIntList( currentGroup(), QStringLiteral( "SnippetSplitterPosition" ), mSnippetSplitterPosition, defaultSnippetSplitterPosition );
  mSnippetSplitterPositionItem->setLabel( i18nd("kmail", "SnippetSplitterPosition") );
  addItem( mSnippetSplitterPositionItem, QStringLiteral( "SnippetSplitterPosition" ) );
  mCryptoStoreEncryptedItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "crypto-store-encrypted" ), mCryptoStoreEncrypted, true );
  mCryptoStoreEncryptedItem->setLabel( i18nd("kmail", "When check, sent messages will be stored in the encrypted form") );
  addItem( mCryptoStoreEncryptedItem, QStringLiteral( "CryptoStoreEncrypted" ) );
  mRecentUrlsItem = new KConfigSkeleton::ItemStringList( currentGroup(), QStringLiteral( "recent-urls" ), mRecentUrls, 
        QStringList()
         );
  mRecentUrlsItem->setLabel( i18nd("kmail", "A list of all the recently used URLs") );
  addItem( mRecentUrlsItem, QStringLiteral( "RecentUrls" ) );
  mRecentEncodingsItem = new KConfigSkeleton::ItemStringList( currentGroup(), QStringLiteral( "recent-encoding" ), mRecentEncodings, 
        QStringList()
         );
  mRecentEncodingsItem->setLabel( i18nd("kmail", "A list of all the recently used encodings") );
  addItem( mRecentEncodingsItem, QStringLiteral( "RecentEncodings" ) );
  mShowCryptoLabelIndicatorItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ShowCryptoLabelIndicator" ), mShowCryptoLabelIndicator, true );
  mShowCryptoLabelIndicatorItem->setLabel( i18nd("kmail", "Show crypto label indicator") );
  addItem( mShowCryptoLabelIndicatorItem, QStringLiteral( "ShowCryptoLabelIndicator" ) );
  mCheckSendDefaultActionShortcutItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "CheckSendDefaultActionShortcut" ), mCheckSendDefaultActionShortcut, false );
  mCheckSendDefaultActionShortcutItem->setLabel( i18nd("kmail", "Validate Send Default Shortcut") );
  addItem( mCheckSendDefaultActionShortcutItem, QStringLiteral( "CheckSendDefaultActionShortcut" ) );

  setCurrentGroup( QStringLiteral( "Fonts" ) );

  mComposerFontItem = new KConfigSkeleton::ItemFont( currentGroup(), QStringLiteral( "composer-font" ), mComposerFont, QFontDatabase::systemFont(QFontDatabase::GeneralFont) );
  mComposerFontItem->setLabel( i18nd("kmail", "composer-font") );
  addItem( mComposerFontItem, QStringLiteral( "ComposerFont" ) );

  setCurrentGroup( QStringLiteral( "Geometry" ) );

  mComposerSizeItem = new KConfigSkeleton::ItemSize( currentGroup(), QStringLiteral( "composer" ), mComposerSize, QSize(800,600) );
  mComposerSizeItem->setLabel( i18nd("kmail", "composer") );
  addItem( mComposerSizeItem, QStringLiteral( "ComposerSize" ) );
  mIdentityDialogSizeItem = new KConfigSkeleton::ItemSize( currentGroup(), QStringLiteral( "Identity Dialog size" ), mIdentityDialogSize, QSize() );
  mIdentityDialogSizeItem->setLabel( i18nd("kmail", "Identity Dialog size") );
  addItem( mIdentityDialogSizeItem, QStringLiteral( "IdentityDialogSize" ) );
  mSearchWidgetWidthItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "SearchWidgetWidth" ), mSearchWidgetWidth, 0 );
  mSearchWidgetWidthItem->setLabel( i18nd("kmail", "SearchWidgetWidth") );
  addItem( mSearchWidgetWidthItem, QStringLiteral( "SearchWidgetWidth" ) );
  mSearchWidgetHeightItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "SearchWidgetHeight" ), mSearchWidgetHeight, 0 );
  mSearchWidgetHeightItem->setLabel( i18nd("kmail", "SearchWidgetHeight") );
  addItem( mSearchWidgetHeightItem, QStringLiteral( "SearchWidgetHeight" ) );
  mConfigureDialogWidthItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "ConfigureDialogWidth" ), mConfigureDialogWidth, 800 );
  mConfigureDialogWidthItem->setLabel( i18nd("kmail", "ConfigureDialogWidth") );
  addItem( mConfigureDialogWidthItem, QStringLiteral( "ConfigureDialogWidth" ) );
  mConfigureDialogHeightItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "ConfigureDialogHeight" ), mConfigureDialogHeight, 600 );
  mConfigureDialogHeightItem->setLabel( i18nd("kmail", "ConfigureDialogHeight") );
  addItem( mConfigureDialogHeightItem, QStringLiteral( "ConfigureDialogHeight" ) );
  mFolderViewWidthItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "FolderViewWidth" ), mFolderViewWidth, 250 );
  mFolderViewWidthItem->setLabel( i18nd("kmail", "FolderViewWidth") );
  addItem( mFolderViewWidthItem, QStringLiteral( "FolderViewWidth" ) );
  mFolderViewHeightItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "FolderViewHeight" ), mFolderViewHeight, 500 );
  mFolderViewHeightItem->setLabel( i18nd("kmail", "FolderViewHeight") );
  addItem( mFolderViewHeightItem, QStringLiteral( "FolderViewHeight" ) );
  mFolderTreeHeightItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "FolderTreeHeight" ), mFolderTreeHeight, 400 );
  mFolderTreeHeightItem->setLabel( i18nd("kmail", "FolderTreeHeight") );
  addItem( mFolderTreeHeightItem, QStringLiteral( "FolderTreeHeight" ) );
  mSearchAndHeaderHeightItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "SearchAndHeaderHeight" ), mSearchAndHeaderHeight, 180 );
  mSearchAndHeaderHeightItem->setLabel( i18nd("kmail", "SearchAndHeaderHeight") );
  addItem( mSearchAndHeaderHeightItem, QStringLiteral( "SearchAndHeaderHeight" ) );
  mSearchAndHeaderWidthItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "SearchAndHeaderWidth" ), mSearchAndHeaderWidth, 450 );
  mSearchAndHeaderWidthItem->setLabel( i18nd("kmail", "SearchAndHeaderWidth") );
  addItem( mSearchAndHeaderWidthItem, QStringLiteral( "SearchAndHeaderWidth" ) );
  mReaderWindowWidthItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "ReaderWindowWidth" ), mReaderWindowWidth, 200 );
  mReaderWindowWidthItem->setLabel( i18nd("kmail", "ReaderWindowWidth") );
  addItem( mReaderWindowWidthItem, QStringLiteral( "ReaderWindowWidth" ) );
  mReaderWindowHeightItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "ReaderWindowHeight" ), mReaderWindowHeight, 320 );
  mReaderWindowHeightItem->setLabel( i18nd("kmail", "ReaderWindowHeight") );
  addItem( mReaderWindowHeightItem, QStringLiteral( "ReaderWindowHeight" ) );
  QList<KConfigSkeleton::ItemEnum::Choice> valuesreaderWindowMode;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("hide");
    choice.label = i18nd("kmail", "Do not show a message preview pane");
    valuesreaderWindowMode.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("below");
    choice.label = i18nd("kmail", "Show the message preview pane below the message list");
    valuesreaderWindowMode.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("right");
    choice.label = i18nd("kmail", "Show the message preview pane next to the message list");
    valuesreaderWindowMode.append( choice );
  }
  mReaderWindowModeItem = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "readerWindowMode" ), mReaderWindowMode, valuesreaderWindowMode, EnumReaderWindowMode::below );
  mReaderWindowModeItem->setLabel( i18nd("kmail", "Message preview pane:") );
  addItem( mReaderWindowModeItem, QStringLiteral( "readerWindowMode" ) );
  QList<KConfigSkeleton::ItemEnum::Choice> valuesFolderList;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("longlist");
    choice.label = i18nd("kmail", "Long folder list");
    valuesFolderList.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("shortlist");
    choice.label = i18nd("kmail", "Short folder list");
    valuesFolderList.append( choice );
  }
  mFolderListItem = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "FolderList" ), mFolderList, valuesFolderList, EnumFolderList::longlist );
  mFolderListItem->setLabel( i18nd("kmail", "Folder list:") );
  addItem( mFolderListItem, QStringLiteral( "FolderList" ) );

  setCurrentGroup( QStringLiteral( "GlobalTemplates" ) );

  mTemplateNewMessageItem = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "TemplateNewMessage" ), mTemplateNewMessage, TemplateParser::DefaultTemplates::defaultNewMessage() );
  mTemplateNewMessageItem->setLabel( i18nd("kmail", "Message template for new message") );
  addItem( mTemplateNewMessageItem, QStringLiteral( "TemplateNewMessage" ) );
  mTemplateReplyItem = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "TemplateReply" ), mTemplateReply, TemplateParser::DefaultTemplates::defaultReply() );
  mTemplateReplyItem->setLabel( i18nd("kmail", "Message template for reply") );
  addItem( mTemplateReplyItem, QStringLiteral( "TemplateReply" ) );
  mTemplateReplyAllItem = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "TemplateReplyAll" ), mTemplateReplyAll, TemplateParser::DefaultTemplates::defaultReplyAll() );
  mTemplateReplyAllItem->setLabel( i18nd("kmail", "Message template for reply to all") );
  addItem( mTemplateReplyAllItem, QStringLiteral( "TemplateReplyAll" ) );
  mTemplateForwardItem = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "TemplateForward" ), mTemplateForward, TemplateParser::DefaultTemplates::defaultForward() );
  mTemplateForwardItem->setLabel( i18nd("kmail", "Message template for forward") );
  addItem( mTemplateForwardItem, QStringLiteral( "TemplateForward" ) );
  mQuoteStringItem = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "QuoteString" ), mQuoteString, TemplateParser::DefaultTemplates::defaultQuoteString() );
  mQuoteStringItem->setLabel( i18nd("kmail", "Quote characters") );
  addItem( mQuoteStringItem, QStringLiteral( "QuoteString" ) );

  setCurrentGroup( QStringLiteral( "Search" ) );

  mLastSearchCollectionIdItem = new KConfigSkeleton::ItemLongLong( currentGroup(), QStringLiteral( "LastSearchCollectionId" ), mLastSearchCollectionId, -1 );
  mLastSearchCollectionIdItem->setLabel( i18nd("kmail", "LastSearchCollectionId") );
  addItem( mLastSearchCollectionIdItem, QStringLiteral( "LastSearchCollectionId" ) );

  setCurrentGroup( QStringLiteral( "MainFolderView" ) );

  mToolTipDisplayPolicyItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "ToolTipDisplayPolicy" ), mToolTipDisplayPolicy, 0 );
  mToolTipDisplayPolicyItem->setLabel( i18nd("kmail", "Specifies the policy used when displaying policy") );
  addItem( mToolTipDisplayPolicyItem, QStringLiteral( "ToolTipDisplayPolicy" ) );

  setCurrentGroup( QStringLiteral( "SearchDialog" ) );

  mCollectionWidthItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "CollectionWidth" ), mCollectionWidth, 150 );
  mCollectionWidthItem->setLabel( i18nd("kmail", "CollectionWidth") );
  addItem( mCollectionWidthItem, QStringLiteral( "CollectionWidth" ) );
  mSubjectWidthItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "SubjectWidth" ), mSubjectWidth, 150 );
  mSubjectWidthItem->setLabel( i18nd("kmail", "SubjectWidth") );
  addItem( mSubjectWidthItem, QStringLiteral( "SubjectWidth" ) );
  mSenderWidthItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "SenderWidth" ), mSenderWidth, 120 );
  mSenderWidthItem->setLabel( i18nd("kmail", "SenderWidth") );
  addItem( mSenderWidthItem, QStringLiteral( "SenderWidth" ) );
  mReceiverWidthItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "ReceiverWidth" ), mReceiverWidth, 120 );
  mReceiverWidthItem->setLabel( i18nd("kmail", "ReceiverWidth") );
  addItem( mReceiverWidthItem, QStringLiteral( "ReceiverWidth" ) );
  mDateWidthItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "DateWidth" ), mDateWidth, 120 );
  mDateWidthItem->setLabel( i18nd("kmail", "DateWidth") );
  addItem( mDateWidthItem, QStringLiteral( "DateWidth" ) );
  mFolderWidthItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "FolderWidth" ), mFolderWidth, 100 );
  mFolderWidthItem->setLabel( i18nd("kmail", "FolderWidth") );
  addItem( mFolderWidthItem, QStringLiteral( "FolderWidth" ) );

  setCurrentGroup( QStringLiteral( "UndoSend" ) );

  mEnabledUndoSendItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "EnabledUndoSend" ), mEnabledUndoSend, false );
  mEnabledUndoSendItem->setLabel( i18nd("kmail", "EnabledUndoSend") );
  addItem( mEnabledUndoSendItem, QStringLiteral( "EnabledUndoSend" ) );
  mUndoSendDelayItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "UndoSendDelay" ), mUndoSendDelay, 10 );
  mUndoSendDelayItem->setLabel( i18nd("kmail", "UndoSendDelay") );
  addItem( mUndoSendDelayItem, QStringLiteral( "UndoSendDelay" ) );

  setCurrentGroup( QStringLiteral( "Activities" ) );

  mEnabledActivitiesItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "EnabledActivities" ), mEnabledActivities, false );
  mEnabledActivitiesItem->setLabel( i18nd("kmail", "EnabledActivities") );
  addItem( mEnabledActivitiesItem, QStringLiteral( "EnabledActivities" ) );
}

GlobalSettingsBase::~GlobalSettingsBase()
{
  if (s_globalGlobalSettingsBase.exists() && !s_globalGlobalSettingsBase.isDestroyed()) {
    s_globalGlobalSettingsBase()->q = nullptr;
  }
}

