NetworkManagerQt

template.cpp
1/*
2 SPDX-FileCopyrightText: 2012-2015 Jan Grulich <jgrulich@redhat.com>
3
4 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5*/
6
7#include "template.h"
8#include "template_p.h"
9
10// TODO: Uncomment and replace the template with the setting that you want to implement
11//#include <nm-setting-template.h>
12
13NetworkManager::TemplateSettingPrivate::TemplateSettingPrivate()
14// : name(NM_SETTING_TEMPLATE_SETTING_NAME)
15{
16}
17
18NetworkManager::TemplateSetting::TemplateSetting()
19 : /* TODO: Uncomment and replace the template with the setting that you want to implement
20 * This setting must also be added into the enum in base class
21 */
22 // Setting(Setting::Template),
23 d_ptr(new TemplateSettingPrivate())
24{
25}
26
27NetworkManager::TemplateSetting::TemplateSetting(const Ptr &other)
28 : Setting(other)
29 , d_ptr(new TemplateSettingPrivate())
30{
31 /*
32 * setFoo(setting->foo());
33 *
34 */
35}
36
37NetworkManager::TemplateSetting::~TemplateSetting()
38{
39 delete d_ptr;
40}
41
43{
44 Q_D(const TemplateSetting);
45
46 return d->name;
47}
48
49void NetworkManager::TemplateSetting::fromMap(const QVariantMap &setting)
50{
51 /*
52 * if (setting.contains(QLatin1String(NM_SETTING_TEMPLATE_FOO))) {
53 * setFoo(setting.value(QLatin1String(NM_SETTING_TEMPLATE_FOO)));
54 * }
55 *
56 */
57}
58
60{
61 QVariantMap setting;
62
63 /*
64 * if (!foo.isEmpty()) {
65 * setting.insert(QLatin1String(NM_SETTING_TEMPLATE_FOO), foo());
66 * }
67 *
68 */
69
70 return setting;
71}
72
73QDebug NetworkManager::operator<<(QDebug dbg, const NetworkManager::TemplateSetting &setting)
74{
75 dbg.nospace() << "type: " << setting.typeAsString(setting.type()) << '\n';
76 dbg.nospace() << "initialized: " << !setting.isNull() << '\n';
77
78 return dbg.maybeSpace();
79}
Represents generic setting.
Definition template.h:23
QString name() const override
Must be reimplemented, default implementationd does nothing.
Definition template.cpp:42
void fromMap(const QVariantMap &setting) override
Must be reimplemented, default implementation does nothing.
Definition template.cpp:49
QVariantMap toMap() const override
Must be reimplemented, default implementationd does nothing.
Definition template.cpp:59
QDebug & maybeSpace()
QDebug & nospace()
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 20 2024 11:59:05 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.