[plasma/plasma-workspace] shell/scripting: scripting: Drop globalConfig

Nicolas Fella <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit dec032e45ff3a166210a1bcf07dcf21341ce0877 by Nicolas Fella.
Committed on 20/07/2026 at 21:43.
Pushed by nicolasfella into branch 'master'.

scripting: Drop globalConfig

The underlying code in libplasma doesn't do anything

M  +0    -59   shell/scripting/applet.cpp
M  +0    -8    shell/scripting/applet.h
M  +0    -1    shell/scripting/containment.cpp
M  +0    -2    shell/scripting/containment.h
M  +0    -2    shell/scripting/panel.h
M  +0    -1    shell/scripting/widget.cpp
M  +0    -2    shell/scripting/widget.h

https://invent.kde.org/plasma/plasma-workspace/-/commit/dec032e45ff3a166210a1bcf07dcf21341ce0877

diff --git a/shell/scripting/applet.cpp b/shell/scripting/applet.cpp
index e42b118871..9b69e32f93 100644
--- a/shell/scripting/applet.cpp
+++ b/shell/scripting/applet.cpp
@@ -31,8 +31,6 @@ public:
     QPointer<ScriptEngine> engine = nullptr;
     KConfigGroup configGroup;
     QStringList configGroupPath;
-    KConfigGroup globalConfigGroup;
-    QStringList globalConfigGroupPath;
     bool configDirty : 1;
     bool inWallpaperConfig : 1;
 };
@@ -129,63 +127,6 @@ void Applet::writeConfig(const QString &key, const QJSValue &value)
     }
 }
 
-void Applet::setCurrentGlobalConfigGroup(const QStringList &groupNames)
-{
-    Plasma::Applet *app = applet();
-    if (!app) {
-        d->globalConfigGroup = KConfigGroup();
-        d->globalConfigGroupPath.clear();
-        return;
-    }
-
-    d->globalConfigGroup = app->globalConfig();
-    d->globalConfigGroupPath = groupNames;
-
-    for (const QString &groupName : groupNames) {
-        d->globalConfigGroup = KConfigGroup(&d->globalConfigGroup, groupName);
-    }
-}
-
-QStringList Applet::currentGlobalConfigGroup() const
-{
-    return d->globalConfigGroupPath;
-}
-
-QStringList Applet::globalConfigKeys() const
-{
-    if (d->globalConfigGroup.isValid()) {
-        return d->globalConfigGroup.keyList();
-    }
-
-    return {};
-}
-
-QStringList Applet::globalConfigGroups() const
-{
-    if (d->globalConfigGroup.isValid()) {
-        return d->globalConfigGroup.groupList();
-    }
-
-    return {};
-}
-
-QVariant Applet::readGlobalConfig(const QString &key, const QJSValue &def) const
-{
-    if (d->globalConfigGroup.isValid()) {
-        return d->globalConfigGroup.readEntry(key, def.toVariant());
-    } else {
-        return {};
-    }
-}
-
-void Applet::writeGlobalConfig(const QString &key, const QJSValue &value)
-{
-    if (d->globalConfigGroup.isValid()) {
-        d->globalConfigGroup.writeEntry(key, value.toVariant());
-        d->configDirty = true;
-    }
-}
-
 void Applet::reloadConfigIfNeeded()
 {
     if (d->configDirty) {
diff --git a/shell/scripting/applet.h b/shell/scripting/applet.h
index 282c4b8cda..fa3030fb79 100644
--- a/shell/scripting/applet.h
+++ b/shell/scripting/applet.h
@@ -36,12 +36,6 @@ public:
     void setCurrentConfigGroup(const QStringList &groupNames);
     QStringList currentConfigGroup() const;
 
-    QStringList globalConfigKeys() const;
-    QStringList globalConfigGroups() const;
-
-    void setCurrentGlobalConfigGroup(const QStringList &groupNames);
-    QStringList currentGlobalConfigGroup() const;
-
     QString version() const;
 
     void setLocked(bool locked);
@@ -57,8 +51,6 @@ protected:
 public Q_SLOTS:
     virtual QVariant readConfig(const QString &key, const QJSValue &def = QString()) const;
     virtual void writeConfig(const QString &key, const QJSValue &value);
-    virtual QVariant readGlobalConfig(const QString &key, const QJSValue &def = QString()) const;
-    virtual void writeGlobalConfig(const QString &key, const QJSValue &value);
     virtual void reloadConfig();
 
 private:
diff --git a/shell/scripting/containment.cpp b/shell/scripting/containment.cpp
index 05ca095149..a434fa259a 100644
--- a/shell/scripting/containment.cpp
+++ b/shell/scripting/containment.cpp
@@ -44,7 +44,6 @@ Containment::Containment(Plasma::Containment *containment, ScriptEngine *engine)
     d->corona = qobject_cast<ShellCorona *>(containment->corona());
 
     setCurrentConfigGroup(QStringList());
-    setCurrentGlobalConfigGroup(QStringList());
     if (containment) {
         d->oldWallpaperPlugin = d->wallpaperPlugin = containment->wallpaperPlugin();
     }
diff --git a/shell/scripting/containment.h b/shell/scripting/containment.h
index 92465ac3c9..63b3331ca3 100644
--- a/shell/scripting/containment.h
+++ b/shell/scripting/containment.h
@@ -29,8 +29,6 @@ class Containment : public Applet
     Q_PROPERTY(QString version READ version)
     Q_PROPERTY(QStringList configKeys READ configKeys)
     Q_PROPERTY(QStringList configGroups READ configGroups)
-    Q_PROPERTY(QStringList globalConfigKeys READ globalConfigKeys)
-    Q_PROPERTY(QStringList globalConfigGroups READ globalConfigGroups)
     Q_PROPERTY(QStringList currentConfigGroup WRITE setCurrentConfigGroup READ currentConfigGroup)
     Q_PROPERTY(QString wallpaperPlugin READ wallpaperPlugin WRITE setWallpaperPlugin)
     Q_PROPERTY(QString wallpaperMode READ wallpaperMode WRITE setWallpaperMode)
diff --git a/shell/scripting/panel.h b/shell/scripting/panel.h
index 651fa73b8a..b621051a3e 100644
--- a/shell/scripting/panel.h
+++ b/shell/scripting/panel.h
@@ -22,8 +22,6 @@ class Panel : public Containment
     Q_PROPERTY(QStringList configKeys READ configKeys)
     Q_PROPERTY(QStringList configGroups READ configGroups)
     Q_PROPERTY(QStringList currentConfigGroup WRITE setCurrentConfigGroup READ currentConfigGroup)
-    Q_PROPERTY(QStringList globalConfigKeys READ globalConfigKeys)
-    Q_PROPERTY(QStringList globalConfigGroups READ globalConfigGroups)
 
     Q_PROPERTY(QString version READ version)
     Q_PROPERTY(QString type READ type)
diff --git a/shell/scripting/widget.cpp b/shell/scripting/widget.cpp
index c7bc7c6285..3db5fcddcd 100644
--- a/shell/scripting/widget.cpp
+++ b/shell/scripting/widget.cpp
@@ -32,7 +32,6 @@ Widget::Widget(Plasma::Applet *applet, ScriptEngine *parent)
 {
     d->applet = applet;
     setCurrentConfigGroup(QStringList());
-    setCurrentGlobalConfigGroup(QStringList());
 }
 
 Widget::~Widget()
diff --git a/shell/scripting/widget.h b/shell/scripting/widget.h
index f6f5b7f8e2..7eecc51a92 100644
--- a/shell/scripting/widget.h
+++ b/shell/scripting/widget.h
@@ -26,8 +26,6 @@ class Widget : public Applet
     Q_PROPERTY(int id READ id)
     Q_PROPERTY(QStringList configKeys READ configKeys)
     Q_PROPERTY(QStringList configGroups READ configGroups)
-    Q_PROPERTY(QStringList globalConfigKeys READ globalConfigKeys)
-    Q_PROPERTY(QStringList globalConfigGroups READ globalConfigGroups)
     Q_PROPERTY(int index WRITE setIndex READ index)
     // We pass our js based QRect wrapper instead of a simple QRectF
     Q_PROPERTY(QJSValue geometry WRITE setGeometry READ geometry)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.