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

#include "settingsbase.h"

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

class SettingsBaseHelper
{
  public:
    SettingsBaseHelper() : q(nullptr) {}
    ~SettingsBaseHelper() { delete q; }
    SettingsBase *q;
};
Q_GLOBAL_STATIC(SettingsBaseHelper, s_globalSettingsBase)
SettingsBase *SettingsBase::self()
{
  if (!s_globalSettingsBase()->q) {
    new SettingsBase;
    s_globalSettingsBase()->q->read();
  }

  return s_globalSettingsBase()->q;
}

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

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

  setCurrentGroup( QStringLiteral( "general" ) );

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

SettingsBase::~SettingsBase()
{
  s_globalSettingsBase()->q = nullptr;
}

