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

#include "updatessettings.h"

UpdatesSettings::UpdatesSettings( QObject *parent )
  : KConfigSkeleton( QStringLiteral( "PlasmaDiscoverUpdates" ) )
{
  setParent(parent);
  KConfigCompilerSignallingItem::NotifyFunction notifyFunction = static_cast<KConfigCompilerSignallingItem::NotifyFunction>(&UpdatesSettings::itemChanged);

  setCurrentGroup( QStringLiteral( "Global" ) );

  KConfigCompilerSignallingItem  *itemUseUnattendedUpdates;
  KConfigSkeleton::ItemBool  *innerItemUseUnattendedUpdates;
  innerItemUseUnattendedUpdates = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "UseUnattendedUpdates" ), mUseUnattendedUpdates, false );
  itemUseUnattendedUpdates = new KConfigCompilerSignallingItem(innerItemUseUnattendedUpdates, this, notifyFunction, signalUseUnattendedUpdatesChanged);
  itemUseUnattendedUpdates->setWriteFlags(KConfigBase::Notify);
  addItem( itemUseUnattendedUpdates, QStringLiteral( "UseUnattendedUpdates" ) );
  KConfigCompilerSignallingItem  *itemLastUnattendedTrigger;
  KConfigSkeleton::ItemDateTime  *innerItemLastUnattendedTrigger;
  innerItemLastUnattendedTrigger = new KConfigSkeleton::ItemDateTime( currentGroup(), QStringLiteral( "LastUnattendedTrigger" ), mLastUnattendedTrigger );
  itemLastUnattendedTrigger = new KConfigCompilerSignallingItem(innerItemLastUnattendedTrigger, this, notifyFunction, signalLastUnattendedTriggerChanged);
  itemLastUnattendedTrigger->setWriteFlags(KConfigBase::Notify);
  addItem( itemLastUnattendedTrigger, QStringLiteral( "LastUnattendedTrigger" ) );
  KConfigCompilerSignallingItem  *itemRequiredNotificationInterval;
  KConfigSkeleton::ItemInt  *innerItemRequiredNotificationInterval;
  innerItemRequiredNotificationInterval = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "RequiredNotificationInterval" ), mRequiredNotificationInterval, 60 * 60 * 24 );
  itemRequiredNotificationInterval = new KConfigCompilerSignallingItem(innerItemRequiredNotificationInterval, this, notifyFunction, signalRequiredNotificationIntervalChanged);
  itemRequiredNotificationInterval->setWriteFlags(KConfigBase::Notify);
  addItem( itemRequiredNotificationInterval, QStringLiteral( "RequiredNotificationInterval" ) );
}

bool UpdatesSettings::defaultUseUnattendedUpdatesValue_helper() const
{

  return false;
}

int UpdatesSettings::defaultRequiredNotificationIntervalValue_helper() const
{

  return 60 * 60 * 24;
}

UpdatesSettings::~UpdatesSettings()
{
}


void UpdatesSettings::itemChanged(quint64 signalFlag) {

  switch (signalFlag) {
  case signalUseUnattendedUpdatesChanged:
    Q_EMIT UseUnattendedUpdatesChanged();
    break;
  case signalLastUnattendedTriggerChanged:
    Q_EMIT LastUnattendedTriggerChanged();
    break;
  case signalRequiredNotificationIntervalChanged:
    Q_EMIT RequiredNotificationIntervalChanged();
    break;
  }
}
