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

#include "prefs.h"

#include <kglobal.h>
#include <QtCore/QFile>

class PrefsHelper
{
  public:
    PrefsHelper() : q(0) {}
    ~PrefsHelper() { delete q; }
    Prefs *q;
};
K_GLOBAL_STATIC(PrefsHelper, s_globalPrefs)
Prefs *Prefs::self()
{
  if (!s_globalPrefs->q) {
    new Prefs;
    s_globalPrefs->q->readConfig();
  }

  return s_globalPrefs->q;
}

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

  KConfigSkeleton::ItemString  *itemTileSet;
  itemTileSet = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "Tileset_file" ), mTileSet );
  addItem( itemTileSet, QLatin1String( "TileSet" ) );
  KConfigSkeleton::ItemString  *itemBackground;
  itemBackground = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "Background_file" ), mBackground );
  addItem( itemBackground, QLatin1String( "Background" ) );
  KConfigSkeleton::ItemString  *itemLayout;
  itemLayout = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "Layout_file" ), mLayout );
  addItem( itemLayout, QLatin1String( "Layout" ) );
  KConfigSkeleton::ItemInt  *itemAngle;
  itemAngle = new KConfigSkeleton::ItemInt( currentGroup(), QLatin1String( "Angle" ), mAngle, 0 );
  addItem( itemAngle, QLatin1String( "Angle" ) );
  KConfigSkeleton::ItemBool  *itemRandomLayout;
  itemRandomLayout = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "RandomLayout" ), mRandomLayout, false );
  addItem( itemRandomLayout, QLatin1String( "RandomLayout" ) );
  KConfigSkeleton::ItemBool  *itemSolvableGames;
  itemSolvableGames = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "Solvable_game" ), mSolvableGames, true );
  addItem( itemSolvableGames, QLatin1String( "SolvableGames" ) );
  KConfigSkeleton::ItemBool  *itemShowMatchingTiles;
  itemShowMatchingTiles = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "ShowMatchingTiles" ), mShowMatchingTiles, false );
  addItem( itemShowMatchingTiles, QLatin1String( "ShowMatchingTiles" ) );
  KConfigSkeleton::ItemRect  *itemEditorGeometry;
  itemEditorGeometry = new KConfigSkeleton::ItemRect( currentGroup(), QLatin1String( "EditorGeometry" ), mEditorGeometry );
  addItem( itemEditorGeometry, QLatin1String( "EditorGeometry" ) );
}

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

