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

#include "settings.h"

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

class SettingsHelper
{
  public:
    SettingsHelper() : q(0) {}
    ~SettingsHelper() { delete q; }
    Settings *q;
};
K_GLOBAL_STATIC(SettingsHelper, s_globalSettings)
Settings *Settings::self()
{
  if (!s_globalSettings->q) {
    new Settings;
    s_globalSettings->q->readConfig();
  }

  return s_globalSettings->q;
}

Settings::Settings(  )
  : KConfigSkeleton( QLatin1String( "ksnakeduelrc" ) )
{
  Q_ASSERT(!s_globalSettings->q);
  s_globalSettings->q = this;
  setCurrentGroup( QLatin1String( "General" ) );

  KConfigSkeleton::ItemString  *itemTheme;
  itemTheme = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "Theme" ), mTheme, QLatin1String( "themes/default.desktop" ) );
  addItem( itemTheme, QLatin1String( "Theme" ) );

  setCurrentGroup( QLatin1String( "Game" ) );

  KConfigSkeleton::ItemBool  *itemAcceleratorBlocked;
  itemAcceleratorBlocked = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "AcceleratorBlocked" ), mAcceleratorBlocked, false );
  addItem( itemAcceleratorBlocked, QLatin1String( "AcceleratorBlocked" ) );
  KConfigSkeleton::ItemString  *itemNamePlayer1;
  itemNamePlayer1 = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "Name_Pl1" ), mNamePlayer1 );
  addItem( itemNamePlayer1, QLatin1String( "NamePlayer1" ) );
  KConfigSkeleton::ItemString  *itemNamePlayer2;
  itemNamePlayer2 = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "Name_Pl2" ), mNamePlayer2 );
  addItem( itemNamePlayer2, QLatin1String( "NamePlayer2" ) );
  QList<KConfigSkeleton::ItemEnum::Choice2> valuesGameType;
  {
    KConfigSkeleton::ItemEnum::Choice2 choice;
    choice.name = QLatin1String("PlayerVSComputer");
    valuesGameType.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice2 choice;
    choice.name = QLatin1String("PlayerVSPlayer");
    valuesGameType.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice2 choice;
    choice.name = QLatin1String("Snake");
    valuesGameType.append( choice );
  }
  KConfigSkeleton::ItemEnum  *itemGameType;
  itemGameType = new KConfigSkeleton::ItemEnum( currentGroup(), QLatin1String( "GameType" ), mGameType, valuesGameType, EnumGameType::PlayerVSComputer );
  addItem( itemGameType, QLatin1String( "GameType" ) );
}

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

