7#include "teamsetting.h"
9#include "teamsetting_p.h"
11#define NM_SETTING_TEAM_INTERFACE_NAME "interface-name"
15NetworkManager::TeamSettingPrivate::TeamSettingPrivate()
16 : name(NM_SETTING_TEAM_SETTING_NAME)
20NetworkManager::TeamSetting::TeamSetting()
21 : Setting(Setting::Team)
22 , d_ptr(new TeamSettingPrivate())
26NetworkManager::TeamSetting::TeamSetting(
const Ptr &other)
28 , d_ptr(new TeamSettingPrivate())
30 setInterfaceName(other->interfaceName());
31 setConfig(other->config());
34NetworkManager::TeamSetting::~TeamSetting()
50 d->interfaceName = name;
53QString NetworkManager::TeamSetting::interfaceName()
const
57 return d->interfaceName;
60QString NetworkManager::TeamSetting::config()
const
62 Q_D(
const TeamSetting);
66void NetworkManager::TeamSetting::setConfig(
const QString &config)
74 if (setting.contains(
QLatin1String(NM_SETTING_TEAM_INTERFACE_NAME))) {
75 setInterfaceName(setting.value(
QLatin1String(NM_SETTING_TEAM_INTERFACE_NAME)).toString());
78 if (setting.contains(
QLatin1String(NM_SETTING_TEAM_CONFIG))) {
79 setConfig(setting.value(
QLatin1String(NM_SETTING_TEAM_CONFIG)).toString());
87 if (!interfaceName().isEmpty()) {
88 setting.insert(
QLatin1String(NM_SETTING_TEAM_INTERFACE_NAME), interfaceName());
90 if (!config().isEmpty()) {
91 setting.insert(
QLatin1String(NM_SETTING_TEAM_CONFIG), config());
99 dbg.
nospace() <<
"type: " << setting.typeAsString(setting.type()) <<
'\n';
100 dbg.
nospace() <<
"initialized: " << !setting.isNull() <<
'\n';
102 dbg.
nospace() << NM_SETTING_TEAM_INTERFACE_NAME <<
": " << setting.interfaceName() <<
'\n';
103 dbg.
nospace() << NM_SETTING_TEAM_CONFIG <<
": " << setting.config() <<
'\n';
void fromMap(const QVariantMap &setting) override
Must be reimplemented, default implementation does nothing.
void setInterfaceName(const QString &name)
QVariantMap toMap() const override
Must be reimplemented, default implementationd does nothing.
QString name() const override
Must be reimplemented, default implementationd does nothing.