// This file is generated by kconfig_compiler_kf5 from kmahjongg.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( "kmahjonggrc" ) )
{
  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" ) );
  KConfigSkeleton::ItemString  *itemLayout;
  itemLayout = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "Layout_file" ), mLayout );
  addItem( itemLayout, QStringLiteral( "Layout" ) );
  KConfigSkeleton::ItemInt  *itemAngle;
  itemAngle = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "Angle" ), mAngle, 0 );
  addItem( itemAngle, QStringLiteral( "Angle" ) );
  KConfigSkeleton::ItemBool  *itemRemovedTiles;
  itemRemovedTiles = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "RemovedTiles" ), mRemovedTiles, false );
  addItem( itemRemovedTiles, QStringLiteral( "RemovedTiles" ) );
  KConfigSkeleton::ItemBool  *itemRandomLayout;
  itemRandomLayout = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "RandomLayout" ), mRandomLayout, false );
  addItem( itemRandomLayout, QStringLiteral( "RandomLayout" ) );
  KConfigSkeleton::ItemBool  *itemSolvableGames;
  itemSolvableGames = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "Solvable_game" ), mSolvableGames, true );
  addItem( itemSolvableGames, QStringLiteral( "SolvableGames" ) );
  KConfigSkeleton::ItemBool  *itemShowMatchingTiles;
  itemShowMatchingTiles = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ShowMatchingTiles" ), mShowMatchingTiles, false );
  addItem( itemShowMatchingTiles, QStringLiteral( "ShowMatchingTiles" ) );
  KConfigSkeleton::ItemRect  *itemEditorGeometry;
  itemEditorGeometry = new KConfigSkeleton::ItemRect( currentGroup(), QStringLiteral( "EditorGeometry" ), mEditorGeometry );
  addItem( itemEditorGeometry, QStringLiteral( "EditorGeometry" ) );
}

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

