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

#include "prefs.h"

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

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

  return s_globalPrefs()->q;
}

Prefs::Prefs( )
  : KConfigSkeleton( QStringLiteral( "kshisenrc" ) )
{
  Q_ASSERT(!s_globalPrefs()->q);
  s_globalPrefs()->q = this;
  setCurrentGroup( QStringLiteral( "General" ) );

  KConfigSkeleton::ItemString  *itemTileSet;
  itemTileSet = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "Tileset_file" ), mTileSet );
  addItem( itemTileSet, QStringLiteral( "TileSet" ) );
  KConfigSkeleton::ItemString  *itemBackground;
  itemBackground = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "Background_file" ), mBackground );
  addItem( itemBackground, QStringLiteral( "Background" ) );

  setCurrentGroup( QStringLiteral( "Game" ) );

  KConfigSkeleton::ItemBool  *itemChineseStyle;
  itemChineseStyle = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ChineseStyle" ), mChineseStyle, false );
  addItem( itemChineseStyle, QStringLiteral( "ChineseStyle" ) );
  KConfigSkeleton::ItemBool  *itemTilesCanSlide;
  itemTilesCanSlide = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "TilesCanSlide" ), mTilesCanSlide, false );
  addItem( itemTilesCanSlide, QStringLiteral( "TilesCanSlide" ) );
  KConfigSkeleton::ItemBool  *itemSolvable;
  itemSolvable = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "Solvable" ), mSolvable, false );
  addItem( itemSolvable, QStringLiteral( "Solvable" ) );
  KConfigSkeleton::ItemBool  *itemShowUnsolvableMessage;
  itemShowUnsolvableMessage = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ShowUnsolvableMessage" ), mShowUnsolvableMessage, true );
  addItem( itemShowUnsolvableMessage, QStringLiteral( "ShowUnsolvableMessage" ) );
  KConfigSkeleton::ItemBool  *itemGravity;
  itemGravity = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "Gravity" ), mGravity, true );
  addItem( itemGravity, QStringLiteral( "Gravity" ) );
  KConfigSkeleton::ItemBool  *itemSounds;
  itemSounds = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "Sounds" ), mSounds, true );
  addItem( itemSounds, QStringLiteral( "Sounds" ) );
  KConfigSkeleton::ItemInt  *itemSpeed;
  itemSpeed = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "Speed" ), mSpeed, 2 );
  itemSpeed->setMinValue(0);
  itemSpeed->setMaxValue(4);
  addItem( itemSpeed, QStringLiteral( "Speed" ) );
  KConfigSkeleton::ItemInt  *itemSize;
  itemSize = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "Size" ), mSize, 2 );
  itemSize->setMinValue(0);
  itemSize->setMaxValue(5);
  addItem( itemSize, QStringLiteral( "Size" ) );
  KConfigSkeleton::ItemInt  *itemLevel;
  itemLevel = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "Level" ), mLevel, 1 );
  itemLevel->setMinValue(0);
  itemLevel->setMaxValue(2);
  addItem( itemLevel, QStringLiteral( "Level" ) );
}

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

