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

#include "vpn.h"
#include "vpnsecrets.h"

QDBusArgument &operator<<(QDBusArgument &argument, const QStringMap & mydict)
{
    argument.beginMap( QVariant::String, QVariant::String );

    QMapIterator<QString, QString> i(mydict);
    while (i.hasNext()) {
        i.next();
        argument.beginMapEntry();
        argument << i.key() << i.value();
        argument.endMapEntry();
    }
    argument.endMap();
    return argument;
}

const QDBusArgument &operator>>(const QDBusArgument &argument, QStringMap & mydict)
{
    argument.beginMap();
    mydict.clear();

    while (!argument.atEnd()) {
        QString key;
        QString value;
        argument.beginMapEntry();
        argument >> key >> value;
        argument.endMapEntry();
        mydict.insert(key, value);
    }

    argument.endMap();
    return argument;
}

using namespace Knm;

VpnSetting::VpnSetting() : Setting(Setting::Vpn)
{
  qDBusRegisterMetaType<QStringMap>();

  m_secretsObject = new VpnSecrets(this);
}

VpnSetting::VpnSetting(VpnSetting *setting) : Setting(setting)
{
    qDBusRegisterMetaType<QStringMap>();
    m_secretsObject = new VpnSecrets(static_cast<VpnSecrets*>(setting->getSecretsObject()), this);

    setServiceType(setting->serviceType());
    setData(setting->data());
    setUserName(setting->userName());
    setVpnSecrets(setting->vpnSecrets());
    setPluginName(setting->pluginName());
}

VpnSetting::~VpnSetting()
{
}

QString VpnSetting::name() const
{
  return QLatin1String("vpn");
}
bool VpnSetting::hasSecrets() const
{
  return true;
}
