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

#include "settings.h"

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

class SettingsHelper
{
  public:
    SettingsHelper() : q(nullptr) {}
    ~SettingsHelper() { delete q; }
    Settings *q;
};
Q_GLOBAL_STATIC(SettingsHelper, s_globalSettings)
Settings *Settings::self()
{
  if (!s_globalSettings()->q) {
    new Settings;
    s_globalSettings()->q->read();
  }

  return s_globalSettings()->q;
}

Settings::Settings(  )
  : KConfigSkeleton( QStringLiteral( "ksquaresrc" ) )
{
  Q_ASSERT(!s_globalSettings()->q);
  s_globalSettings()->q = this;
  setCurrentGroup( QStringLiteral( "Game Settings" ) );

  KConfigSkeleton::ItemInt  *itemNumOfPlayers;
  itemNumOfPlayers = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "NumOfPlayers" ), mNumOfPlayers, 2 );
  addItem( itemNumOfPlayers, QStringLiteral( "NumOfPlayers" ) );
  KConfigSkeleton::ItemStringList  *itemPlayerNames;
  itemPlayerNames = new KConfigSkeleton::ItemStringList( currentGroup(), QStringLiteral( "PlayerNames" ), mPlayerNames );
  addItem( itemPlayerNames, QStringLiteral( "PlayerNames" ) );
  QList<int> defaultHumanList;
  defaultHumanList.append( 2 );
  defaultHumanList.append( 2 );
  defaultHumanList.append( 2 );
  defaultHumanList.append( 2 );

  KConfigSkeleton::ItemIntList  *itemHumanList;
  itemHumanList = new KConfigSkeleton::ItemIntList( currentGroup(), QStringLiteral( "HumanList" ), mHumanList, defaultHumanList );
  addItem( itemHumanList, QStringLiteral( "HumanList" ) );
  KConfigSkeleton::ItemInt  *itemBoardWidth;
  itemBoardWidth = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "BoardWidth" ), mBoardWidth, 10 );
  addItem( itemBoardWidth, QStringLiteral( "BoardWidth" ) );
  KConfigSkeleton::ItemInt  *itemBoardHeight;
  itemBoardHeight = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "BoardHeight" ), mBoardHeight, 7 );
  addItem( itemBoardHeight, QStringLiteral( "BoardHeight" ) );
  KConfigSkeleton::ItemInt  *itemQuickStart;
  itemQuickStart = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "QuickStart" ), mQuickStart, 0 );
  addItem( itemQuickStart, QStringLiteral( "QuickStart" ) );

  setCurrentGroup( QStringLiteral( "AI" ) );

  KConfigSkeleton::ItemInt  *itemDifficulty;
  itemDifficulty = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "Difficulty" ), mDifficulty, 0 );
  addItem( itemDifficulty, QStringLiteral( "Difficulty" ) );

  setCurrentGroup( QStringLiteral( "Display" ) );

  KConfigSkeleton::ItemColor  *itemLineColor;
  itemLineColor = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "LineColor" ), mLineColor, QColor( 0,0,0 ) );
  addItem( itemLineColor, QStringLiteral( "LineColor" ) );
  KConfigSkeleton::ItemColor  *itemIndicatorLineColor;
  itemIndicatorLineColor = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "IndicatorLineColor" ), mIndicatorLineColor, QColor( 255,255,0 ) );
  addItem( itemIndicatorLineColor, QStringLiteral( "IndicatorLineColor" ) );
  KConfigSkeleton::ItemColor  *itemHighlightColor;
  itemHighlightColor = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "HighlightColor" ), mHighlightColor, QColor( 220,100,100 ) );
  addItem( itemHighlightColor, QStringLiteral( "HighlightColor" ) );
}

Settings::~Settings()
{
  s_globalSettings()->q = nullptr;
}

