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

#include "prefs.h"

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

class PrefsHelper
{
  public:
    PrefsHelper() noexcept : q(nullptr) {}
    ~PrefsHelper() noexcept { delete q; q = nullptr; }
    PrefsHelper(const PrefsHelper&) = delete;
    PrefsHelper& operator=(const PrefsHelper&) = delete;
    Prefs *q;
};
Q_GLOBAL_STATIC(PrefsHelper, s_globalPrefs)
Prefs *Prefs::self()
{
  if (!s_globalPrefs()->q) {
    new Prefs;
    s_globalPrefs()->q->read();
  }

  return s_globalPrefs()->q;
}

Prefs::Prefs( )
  : KConfigSkeleton( QStringLiteral( "kwin4rc" ) )
{
  Q_ASSERT(!s_globalPrefs()->q);
  s_globalPrefs()->q = this;
  setCurrentGroup( QStringLiteral( "Parameter" ) );

  KConfigSkeleton::ItemInt  *itemPort;
  itemPort = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "port" ), mPort, 7442 );
  addItem( itemPort, QStringLiteral( "port" ) );
  KConfigSkeleton::ItemString  *itemGamename;
  itemGamename = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "gamename" ), mGamename );
  addItem( itemGamename, QStringLiteral( "gamename" ) );
  KConfigSkeleton::ItemString  *itemHost;
  itemHost = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "host" ), mHost, QStringLiteral( "localhost" ) );
  addItem( itemHost, QStringLiteral( "host" ) );
  KConfigSkeleton::ItemInt  *itemLevel;
  itemLevel = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "level" ), mLevel, 3 );
  itemLevel->setMinValue(1);
  itemLevel->setMaxValue(7);
  addItem( itemLevel, QStringLiteral( "level" ) );

        QString playerName1 = i18nc("default name of first player", "Player 1");
      
  KConfigSkeleton::ItemString  *itemName1;
  itemName1 = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "Name1" ), mName1, playerName1 );
  addItem( itemName1, QStringLiteral( "Name1" ) );

        QString playerName2 = i18nc("default name of second player", "Player 2");
      
  KConfigSkeleton::ItemString  *itemName2;
  itemName2 = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "Name2" ), mName2, playerName2 );
  addItem( itemName2, QStringLiteral( "Name2" ) );
  KConfigSkeleton::ItemBool  *itemInput0mouse;
  itemInput0mouse = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "input0mouse" ), mInput0mouse, true );
  addItem( itemInput0mouse, QStringLiteral( "input0mouse" ) );
  KConfigSkeleton::ItemBool  *itemInput0key;
  itemInput0key = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "input0key" ), mInput0key, false );
  addItem( itemInput0key, QStringLiteral( "input0key" ) );
  KConfigSkeleton::ItemBool  *itemInput0ai;
  itemInput0ai = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "input0ai" ), mInput0ai, false );
  addItem( itemInput0ai, QStringLiteral( "input0ai" ) );
  KConfigSkeleton::ItemBool  *itemInput1mouse;
  itemInput1mouse = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "input1mouse" ), mInput1mouse, true );
  addItem( itemInput1mouse, QStringLiteral( "input1mouse" ) );
  KConfigSkeleton::ItemBool  *itemInput1key;
  itemInput1key = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "input1key" ), mInput1key, false );
  addItem( itemInput1key, QStringLiteral( "input1key" ) );
  KConfigSkeleton::ItemBool  *itemInput1ai;
  itemInput1ai = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "input1ai" ), mInput1ai, false );
  addItem( itemInput1ai, QStringLiteral( "input1ai" ) );
  KConfigSkeleton::ItemBool  *itemStartcolourred;
  itemStartcolourred = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "startcolourred" ), mStartcolourred, true );
  addItem( itemStartcolourred, QStringLiteral( "startcolourred" ) );
  KConfigSkeleton::ItemBool  *itemStartcolouryellow;
  itemStartcolouryellow = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "startcolouryellow" ), mStartcolouryellow, false );
  addItem( itemStartcolouryellow, QStringLiteral( "startcolouryellow" ) );
  KConfigSkeleton::ItemBool  *itemLearning;
  itemLearning = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "learning" ), mLearning, true );
  addItem( itemLearning, QStringLiteral( "learning" ) );
  KConfigSkeleton::ItemBool  *itemAilock;
  itemAilock = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ailock" ), mAilock, false );
  addItem( itemAilock, QStringLiteral( "ailock" ) );
}

Prefs::~Prefs()
{
  if (s_globalPrefs.exists() && !s_globalPrefs.isDestroyed()) {
    s_globalPrefs()->q = nullptr;
  }
}

