// This file is generated by kconfig_compiler_kf6 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  *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;
}

int SMServerSettings::defaultShutdownTypeValue_helper() const
{

  return 0;
}

int SMServerSettings::defaultLoginModeValue_helper() const
{

  return restorePreviousLogout;
}

SMServerSettings::~SMServerSettings()
{
}


void SMServerSettings::itemChanged(quint64 signalFlag) {

  switch (signalFlag) {
  case signalConfirmLogoutChanged:
    Q_EMIT confirmLogoutChanged();
    break;
  case signalShutdownTypeChanged:
    Q_EMIT shutdownTypeChanged();
    break;
  case signalLoginModeChanged:
    Q_EMIT loginModeChanged();
    break;
  case signalExcludeAppsChanged:
    Q_EMIT excludeAppsChanged();
    break;
  }
}
