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

#include "PowerDevilActivitySettings.h"

using namespace PowerDevil;

ActivitySettings::ActivitySettings( const QString & ActivityId, QObject *parent )
  : KConfigSkeleton( QStringLiteral( "powerdevilrc" ) )
  , mParamActivityId(ActivityId)
{
  setParent(parent);
  KConfigCompilerSignallingItem::NotifyFunction notifyFunction = static_cast<KConfigCompilerSignallingItem::NotifyFunction>(&ActivitySettings::itemChanged);

  KConfigGroup cgActivities(this->config(), QStringLiteral( "Activities" ));
  KConfigGroup cgActivityId = cgActivities.group(QStringLiteral( "%1" ).arg( mParamActivityId ));
  KConfigCompilerSignallingItem  *itemInhibitScreenManagement;
  KConfigSkeleton::ItemBool  *innerItemInhibitScreenManagement;
  innerItemInhibitScreenManagement = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "InhibitScreenManagement" ), mInhibitScreenManagement, false );
  itemInhibitScreenManagement = new KConfigCompilerSignallingItem(innerItemInhibitScreenManagement, this, notifyFunction, signalInhibitScreenManagementChanged);
  itemInhibitScreenManagement->setGroup(cgActivityId);
  addItem( itemInhibitScreenManagement, QStringLiteral( "InhibitScreenManagement" ) );
  KConfigCompilerSignallingItem  *itemInhibitSuspend;
  KConfigSkeleton::ItemBool  *innerItemInhibitSuspend;
  innerItemInhibitSuspend = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "InhibitSuspend" ), mInhibitSuspend, false );
  itemInhibitSuspend = new KConfigCompilerSignallingItem(innerItemInhibitSuspend, this, notifyFunction, signalInhibitSuspendChanged);
  itemInhibitSuspend->setGroup(cgActivityId);
  addItem( itemInhibitSuspend, QStringLiteral( "InhibitSuspend" ) );
}

bool ActivitySettings::defaultInhibitScreenManagementValue_helper() const
{

  return false;
}

bool ActivitySettings::defaultInhibitSuspendValue_helper() const
{

  return false;
}

ActivitySettings::~ActivitySettings()
{
}


void ActivitySettings::itemChanged(quint64 signalFlag) {

  switch (signalFlag) {
  case signalInhibitScreenManagementChanged:
    Q_EMIT InhibitScreenManagementChanged();
    break;
  case signalInhibitSuspendChanged:
    Q_EMIT InhibitSuspendChanged();
    break;
  }
}
