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

#include "PowerDevilSettings.h"

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

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

  return s_globalPowerDevilSettings()->q;
}

PowerDevilSettings::PowerDevilSettings( )
  : KConfigSkeleton( QStringLiteral( "powerdevilrc" ) )
{
  Q_ASSERT(!s_globalPowerDevilSettings()->q);
  s_globalPowerDevilSettings()->q = this;
  setCurrentGroup( QStringLiteral( "General" ) );

  KConfigSkeleton::ItemBool  *itemDoNotInhibitOnLidClose;
  itemDoNotInhibitOnLidClose = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "doNotInhibitOnLidClose" ), mDoNotInhibitOnLidClose, true );
  addItem( itemDoNotInhibitOnLidClose, QStringLiteral( "doNotInhibitOnLidClose" ) );
  KConfigSkeleton::ItemBool  *itemPausePlayersOnSuspend;
  itemPausePlayersOnSuspend = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "pausePlayersOnSuspend" ), mPausePlayersOnSuspend, true );
  addItem( itemPausePlayersOnSuspend, QStringLiteral( "pausePlayersOnSuspend" ) );

  setCurrentGroup( QStringLiteral( "Brightness" ) );

  KConfigSkeleton::ItemInt  *itemBrightnessAnimationDuration;
  itemBrightnessAnimationDuration = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "brightnessAnimationDuration" ), mBrightnessAnimationDuration, 250 );
  addItem( itemBrightnessAnimationDuration, QStringLiteral( "brightnessAnimationDuration" ) );
  KConfigSkeleton::ItemInt  *itemBrightnessAnimationThreshold;
  itemBrightnessAnimationThreshold = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "brightnessAnimationThreshold" ), mBrightnessAnimationThreshold, 100 );
  addItem( itemBrightnessAnimationThreshold, QStringLiteral( "brightnessAnimationThreshold" ) );

  setCurrentGroup( QStringLiteral( "BatteryManagement" ) );

  KConfigSkeleton::ItemInt  *itemBatteryLowLevel;
  itemBatteryLowLevel = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "BatteryLowLevel" ), mBatteryLowLevel, 10 );
  addItem( itemBatteryLowLevel, QStringLiteral( "BatteryLowLevel" ) );
  KConfigSkeleton::ItemInt  *itemBatteryCriticalLevel;
  itemBatteryCriticalLevel = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "BatteryCriticalLevel" ), mBatteryCriticalLevel, 5 );
  addItem( itemBatteryCriticalLevel, QStringLiteral( "BatteryCriticalLevel" ) );
  KConfigSkeleton::ItemInt  *itemBatteryCriticalAction;
  itemBatteryCriticalAction = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "BatteryCriticalAction" ), mBatteryCriticalAction, 2 );
  addItem( itemBatteryCriticalAction, QStringLiteral( "BatteryCriticalAction" ) );
  KConfigSkeleton::ItemInt  *itemPeripheralBatteryLowLevel;
  itemPeripheralBatteryLowLevel = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "PeripheralBatteryLowLevel" ), mPeripheralBatteryLowLevel, 10 );
  addItem( itemPeripheralBatteryLowLevel, QStringLiteral( "PeripheralBatteryLowLevel" ) );
}

PowerDevilSettings::~PowerDevilSettings()
{
  s_globalPowerDevilSettings()->q = nullptr;
}

