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

#include "settingsbase.h"

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

class SettingsBaseHelper
{
  public:
    SettingsBaseHelper() : q(0) {}
    ~SettingsBaseHelper() { delete q; }
    SettingsBase *q;
};
K_GLOBAL_STATIC(SettingsBaseHelper, s_globalSettingsBase)
SettingsBase *SettingsBase::self()
{
  if (!s_globalSettingsBase->q) {
    new SettingsBase;
    s_globalSettingsBase->q->readConfig();
  }

  return s_globalSettingsBase->q;
}

SettingsBase::SettingsBase(  )
  : KConfigSkeleton( QLatin1String( "knavalbattlerc" ) )
{
  Q_ASSERT(!s_globalSettingsBase->q);
  s_globalSettingsBase->q = this;
  setCurrentGroup( QLatin1String( "network" ) );

  KConfigSkeleton::ItemString  *itemHostname;
  itemHostname = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "Hostname" ), mHostname, QLatin1String( "localhost" ) );
  addItem( itemHostname, QLatin1String( "Hostname" ) );
  KConfigSkeleton::ItemInt  *itemPort;
  itemPort = new KConfigSkeleton::ItemInt( currentGroup(), QLatin1String( "Port" ), mPort, 54321 );
  addItem( itemPort, QLatin1String( "Port" ) );

  setCurrentGroup( QLatin1String( "general" ) );

  KConfigSkeleton::ItemString  *itemNickname;
  itemNickname = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "Nickname" ), mNickname );
  addItem( itemNickname, QLatin1String( "Nickname" ) );
  KConfigSkeleton::ItemBool  *itemEnableSounds;
  itemEnableSounds = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "EnableSounds" ), mEnableSounds, false );
  addItem( itemEnableSounds, QLatin1String( "EnableSounds" ) );
  KConfigSkeleton::ItemBool  *itemAdjacentShips;
  itemAdjacentShips = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "AdjacentShips" ), mAdjacentShips, true );
  addItem( itemAdjacentShips, QLatin1String( "AdjacentShips" ) );
  KConfigSkeleton::ItemBool  *itemSeveralShips;
  itemSeveralShips = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "SeveralShips" ), mSeveralShips, false );
  addItem( itemSeveralShips, QLatin1String( "SeveralShips" ) );
}

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

