Akonadi

agentconfigurationbase.cpp
1/*
2 SPDX-FileCopyrightText: 2018 Daniel Vrátil <dvratil@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "agentconfigurationbase.h"
8#include "akonadicore_debug.h"
9
10#include <KAboutData>
11#include <QSize>
12
13namespace Akonadi
14{
15class AgentConfigurationBasePrivate
16{
17public:
18 AgentConfigurationBasePrivate(const KSharedConfigPtr &config, QWidget *parentWidget, const QVariantList &args)
19 : config(config)
20 , parentWidget(parentWidget)
21 {
22 Q_ASSERT(!args.empty());
23 if (args.empty()) {
24 qCCritical(AKONADICORE_LOG, "AgentConfigurationBase instantiated with invalid arguments");
25 return;
26 }
27 identifier = args.at(0).toString();
28 }
29
30 KSharedConfigPtr config;
31 QString identifier;
33 QWidget *const parentWidget;
34};
35} // namespace Akonadi
36
37using namespace Akonadi;
38
39AgentConfigurationBase::AgentConfigurationBase(const KSharedConfigPtr &config, QWidget *parentWidget, const QVariantList &args)
40 : QObject(reinterpret_cast<QObject *>(parentWidget))
41 , d(new AgentConfigurationBasePrivate(config, parentWidget, args))
42{
43}
44
45AgentConfigurationBase::~AgentConfigurationBase()
46{
47}
48
49KSharedConfigPtr AgentConfigurationBase::config() const
50{
51 return d->config;
52}
53
55{
56 return d->identifier;
57}
58
60{
61 d->config->reparseConfiguration();
62}
63
65{
66 d->config->sync();
67 d->config->reparseConfiguration();
68 return true;
69}
70
71QWidget *AgentConfigurationBase::parentWidget() const
72{
73 return d->parentWidget;
74}
75
77{
78 d->aboutData.reset(new KAboutData(aboutData));
79}
80
82{
83 return d->aboutData.data();
84}
85
90
91void AgentConfigurationBase::saveDialogSize(const QSize & /*unused*/) // clazy:exclude=function-args-by-value
92{
93}
94
95QDialogButtonBox::StandardButtons AgentConfigurationBase::standardButtons() const
96{
98}
99
100#include "moc_agentconfigurationbase.cpp"
AgentConfigurationBase(const KSharedConfigPtr &config, QWidget *parentWidget, const QVariantList &args)
Creates a new AgentConfigurationBase objects.
virtual QSize restoreDialogSize() const
Reimplement to restore dialog size.
virtual void saveDialogSize(const QSize &size)
Reimplement to save dialog size.
QString identifier() const
Returns identifier of the Akonadi agent instance currently being configured.
void setKAboutData(const KAboutData &aboutData)
When KAboutData is provided the dialog will also contain KHelpMenu with access to user help etc.
KAboutData * aboutData() const
Returns about data for the currently configured component.
virtual void load()
Reimplement to load settings from the configuration object into widgets.
virtual bool save() const
Reimplement to save new settings into the configuration object.
KSharedConfigPtr config() const
Returns KConfig object belonging to the current Akonadi agent instance.
Helper integration between Akonadi and Qt.
typedef StandardButtons
const QChar at(qsizetype position) const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jun 21 2024 11:57:48 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.