shift-shell/kcms/virtualkeyboard/gsettingsitem.h
Devin Lin e147f98aea kcms: Move KCMs from plasma-settings
Having the KCMs that are mobile specific here makes more sense than in the settings application. Historically plasma-settings had a faster release cycle than Plasma, but the application is now moving to the Plasma release schedule and so it makes sense do this now.
2023-03-13 18:45:47 -07:00

46 lines
925 B
C++

/*
SPDX-FileCopyrightText: 2018 Nicolas Fella <nicolas.fella@gmx.de>
SPDX-License-Identifier: LGPL-2.1-only
*/
#ifndef GSETTINGSITEM_H
#define GSETTINGSITEM_H
#include <QObject>
#include <QStringList>
#include <QVariant>
#include <gio/gio.h>
class GSettingsItem : public QObject
{
Q_OBJECT
public:
explicit GSettingsItem(const QString &key, QObject *parent = nullptr);
virtual ~GSettingsItem() override;
QVariant value(const QString &key) const;
void set(const QString &key, const QVariant &val);
bool isValid() const;
Q_SIGNALS:
void subtreeChanged();
private:
GSettings *m_settings = nullptr;
static void settingChanged(GSettings *settings, const gchar *key, gpointer data)
{
Q_UNUSED(settings)
Q_UNUSED(key)
GSettingsItem *self = static_cast<GSettingsItem *>(data);
Q_EMIT self->subtreeChanged();
}
};
#endif // GCONFITEM_H