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

#include "prefs_lokalize.h"

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

class SettingsHelper
{
  public:
    SettingsHelper() noexcept : q(nullptr) {}
    ~SettingsHelper() noexcept { delete q; q = nullptr; }
    SettingsHelper(const SettingsHelper&) = delete;
    SettingsHelper& operator=(const SettingsHelper&) = delete;
    Settings *q;
};
Q_GLOBAL_STATIC(SettingsHelper, s_globalSettings)
Settings *Settings::self()
{
  if (!s_globalSettings()->q) {
    new Settings;
    s_globalSettings()->q->read();
  }

  return s_globalSettings()->q;
}

Settings::Settings( )
  : KConfigSkeleton( QStringLiteral( "lokalizerc" ) )
{
  Q_ASSERT(!s_globalSettings()->q);
  s_globalSettings()->q = this;
  setCurrentGroup( QStringLiteral( "Identity" ) );

  mAuthorNameItem = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "authorName" ), mAuthorName, KEMailSettings().getSetting(KEMailSettings::RealName) );
  mAuthorNameItem->setLabel( QCoreApplication::translate("Settings", "authorName") );
  addItem( mAuthorNameItem, QStringLiteral( "authorName" ) );
  mAuthorLocalizedNameItem = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "authorLocalizedName" ), mAuthorLocalizedName, KEMailSettings().getSetting(KEMailSettings::RealName) );
  mAuthorLocalizedNameItem->setLabel( QCoreApplication::translate("Settings", "authorLocalizedName") );
  addItem( mAuthorLocalizedNameItem, QStringLiteral( "authorLocalizedName" ) );
  mOverrideLangTeamItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "overrideLangTeam" ), mOverrideLangTeam, false );
  mOverrideLangTeamItem->setLabel( QCoreApplication::translate("Settings", "overrideLangTeam") );
  addItem( mOverrideLangTeamItem, QStringLiteral( "overrideLangTeam" ) );
  mUserLangTeamItem = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "userLangTeam" ), mUserLangTeam );
  mUserLangTeamItem->setLabel( QCoreApplication::translate("Settings", "userLangTeam") );
  addItem( mUserLangTeamItem, QStringLiteral( "userLangTeam" ) );
  mAuthorEmailItem = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "authorEmail" ), mAuthorEmail, KEMailSettings().getSetting(KEMailSettings::EmailAddress) );
  mAuthorEmailItem->setLabel( QCoreApplication::translate("Settings", "authorEmail") );
  addItem( mAuthorEmailItem, QStringLiteral( "authorEmail" ) );
  mDefaultLangCodeItem = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "DefaultLangCode" ), mDefaultLangCode, QLocale::system().name() );
  mDefaultLangCodeItem->setLabel( QCoreApplication::translate("Settings", "DefaultLangCode") );
  addItem( mDefaultLangCodeItem, QStringLiteral( "DefaultLangCode" ) );
  mDefaultMailingListItem = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "DefaultMailingList" ), mDefaultMailingList, getMailingList() );
  mDefaultMailingListItem->setLabel( QCoreApplication::translate("Settings", "DefaultMailingList") );
  addItem( mDefaultMailingListItem, QStringLiteral( "DefaultMailingList" ) );

  setCurrentGroup( QStringLiteral( "Appearance" ) );

  mHighlightSpacesItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "HighlightSpaces" ), mHighlightSpaces, true );
  mHighlightSpacesItem->setLabel( QCoreApplication::translate("Settings", "HighlightSpaces") );
  addItem( mHighlightSpacesItem, QStringLiteral( "HighlightSpaces" ) );
  mMsgFontItem = new KConfigSkeleton::ItemFont( currentGroup(), QStringLiteral( "MsgFont" ), mMsgFont, QFontDatabase::systemFont(QFontDatabase::GeneralFont) );
  mMsgFontItem->setLabel( QCoreApplication::translate("Settings", "MsgFont") );
  addItem( mMsgFontItem, QStringLiteral( "MsgFont" ) );
  mLedsItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "Leds" ), mLeds, false );
  mLedsItem->setLabel( QCoreApplication::translate("Settings", "Leds") );
  addItem( mLedsItem, QStringLiteral( "Leds" ) );

  setCurrentGroup( QStringLiteral( "General" ) );

  mTabSwitchItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "TabSwitch" ), mTabSwitch, 0 );
  mTabSwitchItem->setLabel( QCoreApplication::translate("Settings", "TabSwitch") );
  addItem( mTabSwitchItem, QStringLiteral( "TabSwitch" ) );
  mRestoreRecentFilesOnStartupItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "RestoreRecentFilesOnStartup" ), mRestoreRecentFilesOnStartup, true );
  mRestoreRecentFilesOnStartupItem->setLabel( QCoreApplication::translate("Settings", "RestoreRecentFilesOnStartup") );
  addItem( mRestoreRecentFilesOnStartupItem, QStringLiteral( "RestoreRecentFilesOnStartup" ) );
  mCustomEditorEnabledItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "CustomEditorEnabled" ), mCustomEditorEnabled, false );
  mCustomEditorEnabledItem->setLabel( QCoreApplication::translate("Settings", "CustomEditorEnabled") );
  addItem( mCustomEditorEnabledItem, QStringLiteral( "CustomEditorEnabled" ) );
  mCustomEditorCommandItem = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "CustomEditorCommand" ), mCustomEditorCommand, QStringLiteral( "kate %1:%2" ) );
  mCustomEditorCommandItem->setLabel( QCoreApplication::translate("Settings", "CustomEditorCommand") );
  addItem( mCustomEditorCommandItem, QStringLiteral( "CustomEditorCommand" ) );
  mHideCompletedItemsItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "HideCompletedItems" ), mHideCompletedItems, false );
  mHideCompletedItemsItem->setLabel( QCoreApplication::translate("Settings", "HideCompletedItems") );
  addItem( mHideCompletedItemsItem, QStringLiteral( "HideCompletedItems" ) );
  mExpandUntranslatedFoldersItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ExpandUntranslatedFolders" ), mExpandUntranslatedFolders, false );
  mExpandUntranslatedFoldersItem->setLabel( QCoreApplication::translate("Settings", "ExpandUntranslatedFolders") );
  addItem( mExpandUntranslatedFoldersItem, QStringLiteral( "ExpandUntranslatedFolders" ) );

  setCurrentGroup( QStringLiteral( "Editor" ) );

  mAutoApproveItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "AutoApprove" ), mAutoApprove, true );
  mAutoApproveItem->setLabel( QCoreApplication::translate("Settings", "AutoApprove") );
  addItem( mAutoApproveItem, QStringLiteral( "AutoApprove" ) );
  mAutoSpellcheckItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "AutoSpellcheck" ), mAutoSpellcheck, true );
  mAutoSpellcheckItem->setLabel( QCoreApplication::translate("Settings", "AutoSpellcheck") );
  addItem( mAutoSpellcheckItem, QStringLiteral( "AutoSpellcheck" ) );
  mVisualizeSeparatorsItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "VisualizeSeparators" ), mVisualizeSeparators, false );
  mVisualizeSeparatorsItem->setLabel( QCoreApplication::translate("Settings", "VisualizeSeparators") );
  addItem( mVisualizeSeparatorsItem, QStringLiteral( "VisualizeSeparators" ) );
  mConvertXMLCharsItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ConvertXMLChars" ), mConvertXMLChars, false );
  mConvertXMLCharsItem->setLabel( QCoreApplication::translate("Settings", "ConvertXMLChars") );
  addItem( mConvertXMLCharsItem, QStringLiteral( "ConvertXMLChars" ) );
  mMouseWheelGoItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "MouseWheelGo" ), mMouseWheelGo, false );
  mMouseWheelGoItem->setLabel( QCoreApplication::translate("Settings", "MouseWheelGo") );
  addItem( mMouseWheelGoItem, QStringLiteral( "MouseWheelGo" ) );
  mWordCompletionLengthItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "WordCompletionLength" ), mWordCompletionLength, 4 );
  mWordCompletionLengthItem->setLabel( QCoreApplication::translate("Settings", "WordCompletionLength") );
  addItem( mWordCompletionLengthItem, QStringLiteral( "WordCompletionLength" ) );
  mAltTransViewEverShownWithDataItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "AltTransViewEverShownWithData" ), mAltTransViewEverShownWithData, false );
  mAltTransViewEverShownWithDataItem->setLabel( QCoreApplication::translate("Settings", "AltTransViewEverShownWithData") );
  addItem( mAltTransViewEverShownWithDataItem, QStringLiteral( "AltTransViewEverShownWithData" ) );

  setCurrentGroup( QStringLiteral( "TM" ) );

  mPrefetchTMItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "PrefetchTM" ), mPrefetchTM, false );
  mPrefetchTMItem->setLabel( QCoreApplication::translate("Settings", "PrefetchTM") );
  addItem( mPrefetchTMItem, QStringLiteral( "PrefetchTM" ) );
  mSuggCountItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "SuggCount" ), mSuggCount, 7 );
  mSuggCountItem->setLabel( QCoreApplication::translate("Settings", "SuggCount") );
  addItem( mSuggCountItem, QStringLiteral( "SuggCount" ) );
  mSuggScoreItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "SuggScore" ), mSuggScore, 0 );
  mSuggScoreItem->setLabel( QCoreApplication::translate("Settings", "SuggScore") );
  addItem( mSuggScoreItem, QStringLiteral( "SuggScore" ) );
  mAutoaddTMItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "AutoaddTM" ), mAutoaddTM, true );
  mAutoaddTMItem->setLabel( QCoreApplication::translate("Settings", "AutoaddTM") );
  addItem( mAutoaddTMItem, QStringLiteral( "AutoaddTM" ) );
  mScanToTMOnOpenItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ScanToTMOnOpen" ), mScanToTMOnOpen, false );
  mScanToTMOnOpenItem->setLabel( QCoreApplication::translate("Settings", "ScanToTMOnOpen") );
  addItem( mScanToTMOnOpenItem, QStringLiteral( "ScanToTMOnOpen" ) );
  mDeleteFromTMOnMissingItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "DeleteFromTMOnMissing" ), mDeleteFromTMOnMissing, false );
  mDeleteFromTMOnMissingItem->setLabel( QCoreApplication::translate("Settings", "DeleteFromTMOnMissing") );
  addItem( mDeleteFromTMOnMissingItem, QStringLiteral( "DeleteFromTMOnMissing" ) );

  setCurrentGroup( QStringLiteral( "Pology" ) );

  mPologyEnabledItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "PologyEnabled" ), mPologyEnabled, false );
  mPologyEnabledItem->setLabel( QCoreApplication::translate("Settings", "PologyEnabled") );
  addItem( mPologyEnabledItem, QStringLiteral( "PologyEnabled" ) );
  mPologyCommandEntryItem = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "PologyCommandEntry" ), mPologyCommandEntry, QStringLiteral( "posieve -u %u check-rules %f" ) );
  mPologyCommandEntryItem->setLabel( QCoreApplication::translate("Settings", "PologyCommandEntry") );
  addItem( mPologyCommandEntryItem, QStringLiteral( "PologyCommandEntry" ) );
  mPologyCommandFileItem = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "PologyCommandFile" ), mPologyCommandFile, QStringLiteral( "posieve -s lokalize check-rules %f" ) );
  mPologyCommandFileItem->setLabel( QCoreApplication::translate("Settings", "PologyCommandFile") );
  addItem( mPologyCommandFileItem, QStringLiteral( "PologyCommandFile" ) );

  setCurrentGroup( QStringLiteral( "LanguageTool" ) );

  mLanguageToolCustomItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "LanguageToolCustom" ), mLanguageToolCustom, false );
  mLanguageToolCustomItem->setLabel( QCoreApplication::translate("Settings", "LanguageToolCustom") );
  addItem( mLanguageToolCustomItem, QStringLiteral( "LanguageToolCustom" ) );
  mLanguageToolInstancePathItem = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "LanguageToolInstancePath" ), mLanguageToolInstancePath );
  mLanguageToolInstancePathItem->setLabel( QCoreApplication::translate("Settings", "LanguageToolInstancePath") );
  addItem( mLanguageToolInstancePathItem, QStringLiteral( "LanguageToolInstancePath" ) );
  mLanguageToolDelayItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "LanguageToolDelay" ), mLanguageToolDelay, 0 );
  mLanguageToolDelayItem->setLabel( QCoreApplication::translate("Settings", "LanguageToolDelay") );
  addItem( mLanguageToolDelayItem, QStringLiteral( "LanguageToolDelay" ) );
}

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

