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

#include "kscreensaversettings.h"

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

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

  return s_globalKScreenSaverSettings()->q;
}

KScreenSaverSettings::KScreenSaverSettings( )
  : KConfigSkeleton( QStringLiteral( "kscreenlockerrc" ) )
{
  Q_ASSERT(!s_globalKScreenSaverSettings()->q);
  s_globalKScreenSaverSettings()->q = this;
  setCurrentGroup( QStringLiteral( "Daemon" ) );

  KConfigSkeleton::ItemBool  *itemAutolock;
  itemAutolock = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "Autolock" ), mAutolock, true );
  addItem( itemAutolock, QStringLiteral( "Autolock" ) );
  KConfigSkeleton::ItemInt  *itemTimeout;
  itemTimeout = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "Timeout" ), mTimeout, 5 );
  itemTimeout->setMinValue(1);
  addItem( itemTimeout, QStringLiteral( "Timeout" ) );
  KConfigSkeleton::ItemBool  *itemLock;
  itemLock = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "Lock" ), mLock, true );
  addItem( itemLock, QStringLiteral( "Lock" ) );
  KConfigSkeleton::ItemInt  *itemLockGrace;
  itemLockGrace = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "LockGrace" ), mLockGrace, 5 );
  itemLockGrace->setMinValue(0);
  itemLockGrace->setMaxValue(300);
  addItem( itemLockGrace, QStringLiteral( "LockGrace" ) );
  KConfigSkeleton::ItemBool  *itemLockOnResume;
  itemLockOnResume = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "LockOnResume" ), mLockOnResume, true );
  addItem( itemLockOnResume, QStringLiteral( "LockOnResume" ) );

  setCurrentGroup( QStringLiteral( "Greeter" ) );

  KConfigSkeleton::ItemString  *itemTheme;
  itemTheme = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "Theme" ), mTheme );
  addItem( itemTheme, QStringLiteral( "Theme" ) );
  KConfigSkeleton::ItemString  *itemThemeBackground;
  itemThemeBackground = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "ThemeBackground" ), mThemeBackground );
  addItem( itemThemeBackground, QStringLiteral( "ThemeBackground" ) );
}

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

