KConfig 5.109.0
kconfigwatcher.h
1/*
2 SPDX-FileCopyrightText: 2018 David Edmundson <davidedmundson@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#ifndef KCONFIGWATCHER_H
8#define KCONFIGWATCHER_H
9
10#include <QObject>
11#include <QSharedPointer>
12
13#include <KConfigGroup>
14#include <KSharedConfig>
15
16#include <kconfigcore_export.h>
17
18class KConfigWatcherPrivate;
19
26class KCONFIGCORE_EXPORT KConfigWatcher : public QObject
27{
28 Q_OBJECT
29public:
30 typedef QSharedPointer<KConfigWatcher> Ptr;
31
37 static Ptr create(const KSharedConfig::Ptr &config);
38
39 ~KConfigWatcher() override;
40
45 KSharedConfig::Ptr config() const;
46
47Q_SIGNALS:
55 void configChanged(const KConfigGroup &group, const QByteArrayList &names);
56
57private Q_SLOTS:
58 KCONFIGCORE_NO_EXPORT void onConfigChangeNotification(const QHash<QString, QByteArrayList> &changes);
59
60private:
61 KCONFIGCORE_NO_EXPORT explicit KConfigWatcher(const KSharedConfig::Ptr &config);
62 Q_DISABLE_COPY(KConfigWatcher)
63 const QScopedPointer<KConfigWatcherPrivate> d;
64};
65
66#endif
A class for one specific group in a KConfig object.
Definition kconfiggroup.h:39
Notifies when another client has updated this config file with the Notify flag set.
Definition kconfigwatcher.h:27
void configChanged(const KConfigGroup &group, const QByteArrayList &names)
Emitted when a config group has changed The config will be reloaded before this signal is emitted.
static Ptr create(const KSharedConfig::Ptr &config)
Instantiate a ConfigWatcher for a given config.
KSharedConfig::Ptr config() const
Returns the config being watched.