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

#include "pppdbus.h"

#include "ppp.h"

PppDbus::PppDbus(Knm::PppSetting * setting) : SettingDbus(setting)
{
}

PppDbus::~PppDbus()
{
}

void PppDbus::fromMap(const QVariantMap & map)
{
  Knm::PppSetting * setting = static_cast<Knm::PppSetting *>(m_setting);
  if (map.contains(QLatin1String(NM_SETTING_PPP_NOAUTH))) {
    setting->setNoauth(map.value(QLatin1String(NM_SETTING_PPP_NOAUTH)).value<bool>());
  }
  if (map.contains(QLatin1String(NM_SETTING_PPP_REFUSE_EAP))) {
    setting->setRefuseeap(map.value(QLatin1String(NM_SETTING_PPP_REFUSE_EAP)).value<bool>());
  }
  if (map.contains(QLatin1String(NM_SETTING_PPP_REFUSE_PAP))) {
    setting->setRefusepap(map.value(QLatin1String(NM_SETTING_PPP_REFUSE_PAP)).value<bool>());
  }
  if (map.contains(QLatin1String(NM_SETTING_PPP_REFUSE_CHAP))) {
    setting->setRefusechap(map.value(QLatin1String(NM_SETTING_PPP_REFUSE_CHAP)).value<bool>());
  }
  if (map.contains(QLatin1String(NM_SETTING_PPP_REFUSE_MSCHAP))) {
    setting->setRefusemschap(map.value(QLatin1String(NM_SETTING_PPP_REFUSE_MSCHAP)).value<bool>());
  }
  if (map.contains(QLatin1String(NM_SETTING_PPP_REFUSE_MSCHAPV2))) {
    setting->setRefusemschapv2(map.value(QLatin1String(NM_SETTING_PPP_REFUSE_MSCHAPV2)).value<bool>());
  }
  if (map.contains(QLatin1String(NM_SETTING_PPP_NOBSDCOMP))) {
    setting->setNobsdcomp(map.value(QLatin1String(NM_SETTING_PPP_NOBSDCOMP)).value<bool>());
  }
  if (map.contains(QLatin1String(NM_SETTING_PPP_NODEFLATE))) {
      setting->setNodeflate(map.value(QLatin1String(NM_SETTING_PPP_NODEFLATE)).value<bool>());
  }
  if (map.contains(QLatin1String(NM_SETTING_PPP_NO_VJ_COMP))) {
    setting->setNovjcomp(map.value(QLatin1String(NM_SETTING_PPP_NO_VJ_COMP)).value<bool>());
  }
  if (map.contains(QLatin1String(NM_SETTING_PPP_REQUIRE_MPPE))) {
    setting->setRequiremppe(map.value(QLatin1String(NM_SETTING_PPP_REQUIRE_MPPE)).value<bool>());
  }
  if (map.contains(QLatin1String(NM_SETTING_PPP_REQUIRE_MPPE_128))) {
    setting->setRequiremppe128(map.value(QLatin1String(NM_SETTING_PPP_REQUIRE_MPPE_128)).value<bool>());
  }
  if (map.contains(QLatin1String(NM_SETTING_PPP_MPPE_STATEFUL))) {
    setting->setMppestateful(map.value(QLatin1String(NM_SETTING_PPP_MPPE_STATEFUL)).value<bool>());
  }
  if (map.contains(QLatin1String(NM_SETTING_PPP_CRTSCTS))) {
    setting->setCrtscts(map.value(QLatin1String(NM_SETTING_PPP_CRTSCTS)).value<bool>());
  }
  if (map.contains(QLatin1String(NM_SETTING_PPP_BAUD))) {
    setting->setBaud(map.value(QLatin1String(NM_SETTING_PPP_BAUD)).value<uint>());
  }
  if (map.contains(QLatin1String(NM_SETTING_PPP_MRU))) {
    setting->setMru(map.value(QLatin1String(NM_SETTING_PPP_MRU)).value<uint>());
  }
  if (map.contains(QLatin1String(NM_SETTING_PPP_MTU))) {
    setting->setMtu(map.value(QLatin1String(NM_SETTING_PPP_MTU)).value<uint>());
  }
  if (map.contains(QLatin1String(NM_SETTING_PPP_LCP_ECHO_FAILURE))) {
    setting->setLcpechofailure(map.value(QLatin1String(NM_SETTING_PPP_LCP_ECHO_FAILURE)).value<uint>());
  }
  if (map.contains(QLatin1String(NM_SETTING_PPP_LCP_ECHO_INTERVAL))) {
    setting->setLcpechointerval(map.value(QLatin1String(NM_SETTING_PPP_LCP_ECHO_INTERVAL)).value<uint>());
  }
}

QVariantMap PppDbus::toMap()
{
  QVariantMap map;
  Knm::PppSetting * setting = static_cast<Knm::PppSetting *>(m_setting);
  map.insert(QLatin1String(NM_SETTING_PPP_NOAUTH), setting->noauth());
  map.insert(QLatin1String(NM_SETTING_PPP_REFUSE_EAP), setting->refuseeap());
  map.insert(QLatin1String(NM_SETTING_PPP_REFUSE_PAP), setting->refusepap());
  map.insert(QLatin1String(NM_SETTING_PPP_REFUSE_CHAP), setting->refusechap());
  map.insert(QLatin1String(NM_SETTING_PPP_REFUSE_MSCHAP), setting->refusemschap());
  map.insert(QLatin1String(NM_SETTING_PPP_REFUSE_MSCHAPV2), setting->refusemschapv2());
  map.insert(QLatin1String(NM_SETTING_PPP_NOBSDCOMP), setting->nobsdcomp());
  map.insert(QLatin1String(NM_SETTING_PPP_NODEFLATE), setting->nodeflate());
  map.insert(QLatin1String(NM_SETTING_PPP_NO_VJ_COMP), setting->novjcomp());
  if (setting->requiremppe()) {
      map.insert(QLatin1String(NM_SETTING_PPP_REQUIRE_MPPE), true);
      map.insert(QLatin1String(NM_SETTING_PPP_REQUIRE_MPPE_128), setting->requiremppe128());
      map.insert(QLatin1String(NM_SETTING_PPP_MPPE_STATEFUL), setting->mppestateful());
  }
  map.insert(QLatin1String(NM_SETTING_PPP_CRTSCTS), setting->crtscts());
  insertIfNonZero(map, NM_SETTING_PPP_BAUD, setting->baud());
  insertIfNonZero(map, NM_SETTING_PPP_MRU, setting->mru());
  insertIfNonZero(map, NM_SETTING_PPP_MTU, setting->mtu());
  insertIfNonZero(map, NM_SETTING_PPP_LCP_ECHO_FAILURE, setting->lcpechofailure());
  insertIfNonZero(map, NM_SETTING_PPP_LCP_ECHO_INTERVAL, setting->lcpechointerval());
  return map;
}

QVariantMap PppDbus::toSecretsMap()
{
  QVariantMap map;
  return map;
}

