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

#include "ppppersistence.h"

#include "ppp.h"

using namespace Knm;

PppPersistence::PppPersistence(PppSetting * setting, KSharedConfig::Ptr config, ConnectionPersistence::SecretStorageMode mode) : SettingPersistence(setting, config, mode)
{
}

PppPersistence::~PppPersistence()
{
}

void PppPersistence::load()
{
  PppSetting * setting = static_cast<PppSetting *>(m_setting);
  setting->setNoauth(m_config->readEntry("noauth", false));
  setting->setRefuseeap(m_config->readEntry("refuseeap", false));
  setting->setRefusepap(m_config->readEntry("refusepap", false));
  setting->setRefusechap(m_config->readEntry("refusechap", false));
  setting->setRefusemschap(m_config->readEntry("refusemschap", false));
  setting->setRefusemschapv2(m_config->readEntry("refusemschapv2", false));
  setting->setNobsdcomp(m_config->readEntry("nobsdcomp", false));
  setting->setNodeflate(m_config->readEntry("nodeflate", false));
  setting->setNovjcomp(m_config->readEntry("novjcomp", false));
  setting->setRequiremppe(m_config->readEntry("requiremppe", false));
  setting->setRequiremppe128(m_config->readEntry("requiremppe128", false));
  setting->setMppestateful(m_config->readEntry("mppestateful", false));
  setting->setCrtscts(m_config->readEntry("crtscts", false));
  setting->setBaud(m_config->readEntry("baud", 0));
  setting->setMru(m_config->readEntry("mru", 0));
  setting->setMtu(m_config->readEntry("mtu", 0));
  setting->setLcpechofailure(m_config->readEntry("lcpechofailure", 0));
  setting->setLcpechointerval(m_config->readEntry("lcpechointerval", 0));
  setting->setInitialized();
}

void PppPersistence::save()
{
  PppSetting * setting = static_cast<PppSetting *>(m_setting);
  m_config->writeEntry("noauth", setting->noauth());
  m_config->writeEntry("refuseeap", setting->refuseeap());
  m_config->writeEntry("refusepap", setting->refusepap());
  m_config->writeEntry("refusechap", setting->refusechap());
  m_config->writeEntry("refusemschap", setting->refusemschap());
  m_config->writeEntry("refusemschapv2", setting->refusemschapv2());
  m_config->writeEntry("nobsdcomp", setting->nobsdcomp());
  m_config->writeEntry("nodeflate", setting->nodeflate());
  m_config->writeEntry("novjcomp", setting->novjcomp());
  m_config->writeEntry("requiremppe", setting->requiremppe());
  m_config->writeEntry("requiremppe128", setting->requiremppe128());
  m_config->writeEntry("mppestateful", setting->mppestateful());
  m_config->writeEntry("crtscts", setting->crtscts());
  m_config->writeEntry("baud", setting->baud());
  m_config->writeEntry("mru", setting->mru());
  m_config->writeEntry("mtu", setting->mtu());
  m_config->writeEntry("lcpechofailure", setting->lcpechofailure());
  m_config->writeEntry("lcpechointerval", setting->lcpechointerval());
}

QMap<QString,QString> PppPersistence::secrets() const
{
  QMap<QString,QString> map;
  return map;
}

void PppPersistence::restoreSecrets(QMap<QString,QString> secrets) const
{
  if (m_storageMode == ConnectionPersistence::Secure) {
  Q_UNUSED(secrets);
  }
}
