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

#include "ksirksettings.h"

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

using namespace Ksirk;

namespace Ksirk {

class KsirkSettingsHelper
{
  public:
    KsirkSettingsHelper() noexcept : q(nullptr) {}
    ~KsirkSettingsHelper() noexcept { delete q; q = nullptr; }
    KsirkSettingsHelper(const KsirkSettingsHelper&) = delete;
    KsirkSettingsHelper& operator=(const KsirkSettingsHelper&) = delete;
    KsirkSettings *q;
};

}
Q_GLOBAL_STATIC(KsirkSettingsHelper, s_globalKsirkSettings)
KsirkSettings *KsirkSettings::self()
{
  if (!s_globalKsirkSettings()->q) {
    new KsirkSettings;
    s_globalKsirkSettings()->q->read();
  }

  return s_globalKsirkSettings()->q;
}

KsirkSettings::KsirkSettings( )
  : KConfigSkeleton( QStringLiteral( "ksirkrc" ) )
{
  Q_ASSERT(!s_globalKsirkSettings()->q);
  s_globalKsirkSettings()->q = this;
  setCurrentGroup( QStringLiteral( "General" ) );

  KConfigSkeleton::ItemInt  *itemSpritesSpeed;
  itemSpritesSpeed = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "spritesSpeed" ), mSpritesSpeed, 1 );
  addItem( itemSpritesSpeed, QStringLiteral( "spritesSpeed" ) );
  KConfigSkeleton::ItemBool  *itemSoundEnabled;
  itemSoundEnabled = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "soundEnabled" ), mSoundEnabled, true );
  addItem( itemSoundEnabled, QStringLiteral( "soundEnabled" ) );
  KConfigSkeleton::ItemBool  *itemHelpEnabled;
  itemHelpEnabled = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "helpEnabled" ), mHelpEnabled, true );
  addItem( itemHelpEnabled, QStringLiteral( "helpEnabled" ) );
  KConfigSkeleton::ItemBool  *itemShowArmiesNumbers;
  itemShowArmiesNumbers = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "showArmiesNumbers" ), mShowArmiesNumbers, false );
  addItem( itemShowArmiesNumbers, QStringLiteral( "showArmiesNumbers" ) );
  KConfigSkeleton::ItemString  *itemTheme;
  itemTheme = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "Theme" ), mTheme );
  addItem( itemTheme, QStringLiteral( "Theme" ) );
}

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

