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

#include "settings.h"

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

class BomberSettingsHelper
{
  public:
    BomberSettingsHelper() : q(nullptr) {}
    ~BomberSettingsHelper() { delete q; q = nullptr; }
    BomberSettingsHelper(const BomberSettingsHelper&) = delete;
    BomberSettingsHelper& operator=(const BomberSettingsHelper&) = delete;
    BomberSettings *q;
};
Q_GLOBAL_STATIC(BomberSettingsHelper, s_globalBomberSettings)
BomberSettings *BomberSettings::self()
{
  if (!s_globalBomberSettings()->q) {
    new BomberSettings;
    s_globalBomberSettings()->q->read();
  }

  return s_globalBomberSettings()->q;
}

BomberSettings::BomberSettings( )
  : KConfigSkeleton( QStringLiteral( "bomberrc" ) )
{
  Q_ASSERT(!s_globalBomberSettings()->q);
  s_globalBomberSettings()->q = this;
  setCurrentGroup( QStringLiteral( "Sound" ) );

  KConfigSkeleton::ItemBool  *itemPlaySounds;
  itemPlaySounds = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "PlaySounds" ), mPlaySounds, false );
  addItem( itemPlaySounds, QStringLiteral( "PlaySounds" ) );
}

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

