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

#include "settings.h"

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

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

  return s_globalKBounceSettings()->q;
}

KBounceSettings::KBounceSettings( )
  : KConfigSkeleton( QStringLiteral( "kbouncerc" ) )
{
  Q_ASSERT(!s_globalKBounceSettings()->q);
  s_globalKBounceSettings()->q = this;
  setCurrentGroup( QStringLiteral( "General" ) );

  KConfigSkeleton::ItemBool  *itemUseRandomBackgroundPictures;
  itemUseRandomBackgroundPictures = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "UseRandomBackgroundPictures" ), mUseRandomBackgroundPictures, false );
  addItem( itemUseRandomBackgroundPictures, QStringLiteral( "UseRandomBackgroundPictures" ) );
  KConfigSkeleton::ItemString  *itemBackgroundPicturePath;
  itemBackgroundPicturePath = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "BackgroundPicturePath" ), mBackgroundPicturePath );
  addItem( itemBackgroundPicturePath, QStringLiteral( "BackgroundPicturePath" ) );

  setCurrentGroup( QStringLiteral( "Sound" ) );

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

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

