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

#include "prefs.h"

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

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

  return s_globalPreferences()->q;
}

Preferences::Preferences( )
  : KConfigSkeleton( QStringLiteral( "katomicrc" ) )
{
  Q_ASSERT(!s_globalPreferences()->q);
  s_globalPreferences()->q = this;
  setCurrentGroup( QStringLiteral( "Game" ) );

  QList<KConfigSkeleton::ItemEnum::Choice> valuesAnimationSpeed;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("Slow");
    valuesAnimationSpeed.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("Normal");
    valuesAnimationSpeed.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("Fast");
    valuesAnimationSpeed.append( choice );
  }
  KConfigSkeleton::ItemEnum  *itemAnimationSpeed;
  itemAnimationSpeed = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "AnimationSpeed" ), mAnimationSpeed, valuesAnimationSpeed, EnumAnimationSpeed::Normal );
  addItem( itemAnimationSpeed, QStringLiteral( "AnimationSpeed" ) );

  setCurrentGroup( QStringLiteral( "General" ) );

  KConfigSkeleton::ItemInt  *itemSavedBackgroundWidth;
  itemSavedBackgroundWidth = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "SavedBackgroundWidth" ), mSavedBackgroundWidth, -1 );
  addItem( itemSavedBackgroundWidth, QStringLiteral( "SavedBackgroundWidth" ) );
  KConfigSkeleton::ItemInt  *itemSavedBackgroundHeight;
  itemSavedBackgroundHeight = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "SavedBackgroundHeight" ), mSavedBackgroundHeight, -1 );
  addItem( itemSavedBackgroundHeight, QStringLiteral( "SavedBackgroundHeight" ) );
  KConfigSkeleton::ItemString  *itemLastPlayedLevelSet;
  itemLastPlayedLevelSet = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "LastPlayedLevelSet" ), mLastPlayedLevelSet, QStringLiteral( "default_levels" ) );
  addItem( itemLastPlayedLevelSet, QStringLiteral( "LastPlayedLevelSet" ) );
}

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

