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

#include "settings.h"

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

using namespace gui;

namespace gui {

class SettingsHelper
{
  public:
    SettingsHelper() : q(nullptr) {}
    ~SettingsHelper() { 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( "bovorc" ) )
{
  Q_ASSERT(!s_globalSettings()->q);
  s_globalSettings()->q = this;
  setCurrentGroup( QStringLiteral( "bovo" ) );

  KConfigSkeleton::ItemString  *itemTheme;
  itemTheme = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "theme" ), mTheme, QStringLiteral( "scribble" ) );
  addItem( itemTheme, QStringLiteral( "theme" ) );
  KConfigSkeleton::ItemInt  *itemPlaybackSpeed;
  itemPlaybackSpeed = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "playbackSpeed" ), mPlaybackSpeed, 400 );
  itemPlaybackSpeed->setMinValue(150);
  itemPlaybackSpeed->setMaxValue(2000);
  addItem( itemPlaybackSpeed, QStringLiteral( "playbackSpeed" ) );
  KConfigSkeleton::ItemBool  *itemAnimation;
  itemAnimation = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "animation" ), mAnimation, true );
  addItem( itemAnimation, QStringLiteral( "animation" ) );
  QList<KConfigSkeleton::ItemEnum::Choice> valuesai;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("Gabor");
    valuesai.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("Aron");
    valuesai.append( choice );
  }
  KConfigSkeleton::ItemEnum  *itemAi;
  itemAi = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "ai" ), mAi, valuesai, EnumAi::Gabor );
  addItem( itemAi, QStringLiteral( "ai" ) );
}

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

