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

#include "settings.h"

#include <kstaticdeleter.h>

Settings *Settings::mSelf = 0;
static KStaticDeleter<Settings> staticSettingsDeleter;

Settings *Settings::self()
{
  if ( !mSelf ) {
    staticSettingsDeleter.setObject( mSelf, new Settings() );
    mSelf->readConfig();
  }

  return mSelf;
}

Settings::Settings(  )
  : KConfigSkeleton( QString::fromLatin1( "kasteroidsrc" ) )
{
  mSelf = this;
  setCurrentGroup( QString::fromLatin1( "Preferences" ) );

  KConfigSkeleton::ItemBool  *itemCanDestroyPowerups;
  itemCanDestroyPowerups = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "canDestroyPowerups" ), mCanDestroyPowerups, true );
  addItem( itemCanDestroyPowerups, QString::fromLatin1( "canDestroyPowerups" ) );
  KConfigSkeleton::ItemBool  *itemShowHiscores;
  itemShowHiscores = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "showHiscores" ), mShowHiscores, false );
  addItem( itemShowHiscores, QString::fromLatin1( "showHiscores" ) );
  KConfigSkeleton::ItemInt  *itemNumShips;
  itemNumShips = new KConfigSkeleton::ItemInt( currentGroup(), QString::fromLatin1( "numShips" ), mNumShips, 3 );
  addItem( itemNumShips, QString::fromLatin1( "numShips" ) );

  setCurrentGroup( QString::fromLatin1( "Sounds" ) );

  KConfigSkeleton::ItemBool  *itemPlaySounds;
  itemPlaySounds = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "PlaySounds" ), mPlaySounds, true );
  addItem( itemPlaySounds, QString::fromLatin1( "PlaySounds" ) );
  KConfigSkeleton::ItemPath  *itemSoundShipDestroyed;
  itemSoundShipDestroyed = new KConfigSkeleton::ItemPath( currentGroup(), QString::fromLatin1( "ShipDestroyed" ), mSoundShipDestroyed, QString::fromLatin1( "Explosion.wav" ) );
  addItem( itemSoundShipDestroyed, QString::fromLatin1( "SoundShipDestroyed" ) );
  KConfigSkeleton::ItemPath  *itemSoundRockDestroyed;
  itemSoundRockDestroyed = new KConfigSkeleton::ItemPath( currentGroup(), QString::fromLatin1( "RockDestroyed" ), mSoundRockDestroyed, QString::fromLatin1( "ploop.wav" ) );
  addItem( itemSoundRockDestroyed, QString::fromLatin1( "SoundRockDestroyed" ) );
}

Settings::~Settings()
{
  if ( mSelf == this )
    staticSettingsDeleter.setObject( mSelf, 0, false );
}

