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

#include "textautogeneratetextglobalconfig.h"

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

using namespace TextAutoGenerateText;

namespace TextAutoGenerateText {

class TextAutogenerateTextGlobalConfigHelper
{
  public:
    TextAutogenerateTextGlobalConfigHelper() noexcept : q(nullptr) {}
    ~TextAutogenerateTextGlobalConfigHelper() noexcept { delete q; q = nullptr; }
    TextAutogenerateTextGlobalConfigHelper(const TextAutogenerateTextGlobalConfigHelper&) = delete;
    TextAutogenerateTextGlobalConfigHelper& operator=(const TextAutogenerateTextGlobalConfigHelper&) = delete;
    TextAutogenerateTextGlobalConfig *q;
};

}
Q_GLOBAL_STATIC(TextAutogenerateTextGlobalConfigHelper, s_globalTextAutogenerateTextGlobalConfig)
TextAutogenerateTextGlobalConfig *TextAutogenerateTextGlobalConfig::self()
{
  if (!s_globalTextAutogenerateTextGlobalConfig()->q) {
    new TextAutogenerateTextGlobalConfig;
    s_globalTextAutogenerateTextGlobalConfig()->q->read();
  }

  return s_globalTextAutogenerateTextGlobalConfig()->q;
}

TextAutogenerateTextGlobalConfig::TextAutogenerateTextGlobalConfig( )
  : KConfigSkeleton( QStringLiteral( "autogeneratetextrc" ) )
{
  Q_ASSERT(!s_globalTextAutogenerateTextGlobalConfig()->q);
  s_globalTextAutogenerateTextGlobalConfig()->q = this;
  setCurrentGroup( QStringLiteral( "View" ) );

  mEnableTextToSpeechItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "EnableTextToSpeech" ), mEnableTextToSpeech, false );
  addItem( mEnableTextToSpeechItem, QStringLiteral( "EnableTextToSpeech" ) );

  setCurrentGroup( QStringLiteral( "Font" ) );

  mUseCustomFontItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "UseCustomFont" ), mUseCustomFont, false );
  addItem( mUseCustomFontItem, QStringLiteral( "UseCustomFont" ) );
  mGeneralFontItem = new KConfigSkeleton::ItemFont( currentGroup(), QStringLiteral( "GeneralFont" ), mGeneralFont, QFontDatabase::systemFont(QFontDatabase::GeneralFont) );
  addItem( mGeneralFontItem, QStringLiteral( "GeneralFont" ) );
}

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

