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

#include "smserversettings.h"

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

  setCurrentGroup( QStringLiteral( "General" ) );

  KConfigCompilerSignallingItem  *itemConfirmLogout;
  KConfigSkeleton::ItemBool  *innerItemConfirmLogout;
  innerItemConfirmLogout = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "confirmLogout" ), mConfirmLogout, true );
  itemConfirmLogout = new KConfigCompilerSignallingItem(innerItemConfirmLogout, this, notifyFunction, signalConfirmLogoutChanged);
  itemConfirmLogout->setWriteFlags(KConfigBase::Notify);
  addItem( itemConfirmLogout, QStringLiteral( "confirmLogout" ) );
  KConfigCompilerSignallingItem  *itemOfferShutdown;
  KConfigSkeleton::ItemBool  *innerItemOfferShutdown;
  innerItemOfferShutdown = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "offerShutdown" ), mOfferShutdown, true );
  itemOfferShutdown = new KConfigCompilerSignallingItem(innerItemOfferShutdown, this, notifyFunction, signalOfferShutdownChanged);
  itemOfferShutdown->setWriteFlags(KConfigBase::Notify);
  addItem( itemOfferShutdown, QStringLiteral( "offerShutdown" ) );
  KConfigCompilerSignallingItem  *itemShutdownType;
  KConfigSkeleton::ItemInt  *innerItemShutdownType;
  innerItemShutdownType = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "shutdownType" ), mShutdownType, 0 );
  itemShutdownType = new KConfigCompilerSignallingItem(innerItemShutdownType, this, notifyFunction, signalShutdownTypeChanged);
  itemShutdownType->setWriteFlags(KConfigBase::Notify);
  addItem( itemShutdownType, QStringLiteral( "shutdownType" ) );
  QList<KConfigSkeleton::ItemEnum::Choice> valuesloginMode;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("restorePreviousLogout");
    valuesloginMode.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("restoreSavedSession");
    valuesloginMode.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("emptySession");
    valuesloginMode.append( choice );
  }
  KConfigCompilerSignallingItem  *itemLoginMode;
  KConfigSkeleton::ItemEnum  *innerItemLoginMode;
  innerItemLoginMode = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "loginMode" ), mLoginMode, valuesloginMode, restorePreviousLogout );
  itemLoginMode = new KConfigCompilerSignallingItem(innerItemLoginMode, this, notifyFunction, signalLoginModeChanged);
  itemLoginMode->setWriteFlags(KConfigBase::Notify);
  addItem( itemLoginMode, QStringLiteral( "loginMode" ) );
  KConfigCompilerSignallingItem  *itemExcludeApps;
  KConfigSkeleton::ItemString  *innerItemExcludeApps;
  innerItemExcludeApps = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "excludeApps" ), mExcludeApps );
  itemExcludeApps = new KConfigCompilerSignallingItem(innerItemExcludeApps, this, notifyFunction, signalExcludeAppsChanged);
  itemExcludeApps->setWriteFlags(KConfigBase::Notify);
  addItem( itemExcludeApps, QStringLiteral( "excludeApps" ) );
}

bool SMServerSettings::defaultConfirmLogoutValue_helper() const
{

  return true;
}

bool SMServerSettings::defaultOfferShutdownValue_helper() const
{

  return true;
}

int SMServerSettings::defaultShutdownTypeValue_helper() const
{

  return 0;
}

int SMServerSettings::defaultLoginModeValue_helper() const
{

  return restorePreviousLogout;
}

SMServerSettings::~SMServerSettings()
{
}


void SMServerSettings::itemChanged(quint64 flags) {

  if ( flags & signalConfirmLogoutChanged ) {
    Q_EMIT confirmLogoutChanged();
  }
  if ( flags & signalOfferShutdownChanged ) {
    Q_EMIT offerShutdownChanged();
  }
  if ( flags & signalShutdownTypeChanged ) {
    Q_EMIT shutdownTypeChanged();
  }
  if ( flags & signalLoginModeChanged ) {
    Q_EMIT loginModeChanged();
  }
  if ( flags & signalExcludeAppsChanged ) {
    Q_EMIT excludeAppsChanged();
  }
}

#include "smserversettings.moc"

