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

#include "kanagramsettings.h"

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

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

  return s_globalKanagramSettings()->q;
}

KanagramSettings::KanagramSettings( )
  : KCoreConfigSkeleton( QStringLiteral( "kanagramrc" ) )
{
  Q_ASSERT(!s_globalKanagramSettings()->q);
  s_globalKanagramSettings()->q = this;
  setCurrentGroup( QStringLiteral( "kanagram" ) );

  KCoreConfigSkeleton::ItemInt  *itemCurrentVocabulary;
  itemCurrentVocabulary = new KCoreConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "currentVocabulary" ), mCurrentVocabulary, -1 );
  addItem( itemCurrentVocabulary, QStringLiteral( "currentVocabulary" ) );
  KCoreConfigSkeleton::ItemBool  *itemSinglePlayerMode;
  itemSinglePlayerMode = new KCoreConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "singlePlayerMode" ), mSinglePlayerMode, true );
  addItem( itemSinglePlayerMode, QStringLiteral( "singlePlayerMode" ) );
  KCoreConfigSkeleton::ItemString  *itemHintHideTime;
  itemHintHideTime = new KCoreConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "hintHideTime" ), mHintHideTime, QStringLiteral( "1" ) );
  addItem( itemHintHideTime, QStringLiteral( "hintHideTime" ) );
  KCoreConfigSkeleton::ItemString  *itemResolveTime;
  itemResolveTime = new KCoreConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "resolveTime" ), mResolveTime, QStringLiteral( "0" ) );
  addItem( itemResolveTime, QStringLiteral( "resolveTime" ) );
  KCoreConfigSkeleton::ItemString  *itemScoreTime;
  itemScoreTime = new KCoreConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "scoreTime" ), mScoreTime, QStringLiteral( "2" ) );
  addItem( itemScoreTime, QStringLiteral( "scoreTime" ) );
  KCoreConfigSkeleton::ItemString  *itemCorrectAnswerScore;
  itemCorrectAnswerScore = new KCoreConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "correctAnswerScore" ), mCorrectAnswerScore, QStringLiteral( "0" ) );
  addItem( itemCorrectAnswerScore, QStringLiteral( "correctAnswerScore" ) );
  KCoreConfigSkeleton::ItemString  *itemIncorrectAnswerScore;
  itemIncorrectAnswerScore = new KCoreConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "incorrectAnswerScore" ), mIncorrectAnswerScore, QStringLiteral( "0" ) );
  addItem( itemIncorrectAnswerScore, QStringLiteral( "incorrectAnswerScore" ) );
  KCoreConfigSkeleton::ItemString  *itemRevealAnswerScore;
  itemRevealAnswerScore = new KCoreConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "revealAnswerScore" ), mRevealAnswerScore, QStringLiteral( "0" ) );
  addItem( itemRevealAnswerScore, QStringLiteral( "revealAnswerScore" ) );
  KCoreConfigSkeleton::ItemString  *itemSkippedWordScore;
  itemSkippedWordScore = new KCoreConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "skippedWordScore" ), mSkippedWordScore, QStringLiteral( "0" ) );
  addItem( itemSkippedWordScore, QStringLiteral( "skippedWordScore" ) );
  KCoreConfigSkeleton::ItemBool  *itemUseSounds;
  itemUseSounds = new KCoreConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "useSounds" ), mUseSounds, true );
  addItem( itemUseSounds, QStringLiteral( "useSounds" ) );
  KCoreConfigSkeleton::ItemBool  *itemUppercaseOnly;
  itemUppercaseOnly = new KCoreConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "uppercaseOnly" ), mUppercaseOnly, false );
  addItem( itemUppercaseOnly, QStringLiteral( "uppercaseOnly" ) );
  KCoreConfigSkeleton::ItemBool  *itemEnablePronunciation;
  itemEnablePronunciation = new KCoreConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "enablePronunciation" ), mEnablePronunciation, true );
  addItem( itemEnablePronunciation, QStringLiteral( "enablePronunciation" ) );
  KCoreConfigSkeleton::ItemString  *itemDataLanguage;
  itemDataLanguage = new KCoreConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "dataLanguage" ), mDataLanguage );
  addItem( itemDataLanguage, QStringLiteral( "dataLanguage" ) );
}

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

