diff --git a/README.md b/README.md index ffc25ae9..fab00ddc 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,6 @@ This repository contains shell components for Plasma Mobile. ### Locations * [components/mobileshell](components/mobileshell) - private shell component library (API not guaranteed to be stable!) * [containments](containments) - shell panels (homescreen, status bar, task panel) -* [homescreens](homescreens) - homescreen packages * [kcms](kcms) - settings modules * [look-and-feel](look-and-feel/contents) - Plasma look-and-feel packages (ex. lockscreen, logout, etc.) * [quicksettings](quicksettings) - quick settings packages for the action drawer diff --git a/components/mobileshell/mobileshellsettings.cpp b/components/mobileshell/mobileshellsettings.cpp index a13f0a7f..abd5a07b 100644 --- a/components/mobileshell/mobileshellsettings.cpp +++ b/components/mobileshell/mobileshellsettings.cpp @@ -25,7 +25,6 @@ MobileShellSettings::MobileShellSettings(QObject *parent) m_configWatcher = KConfigWatcher::create(m_config); connect(m_configWatcher.data(), &KConfigWatcher::configChanged, this, [this](const KConfigGroup &group, const QByteArrayList &names) -> void { - qDebug() << "config changed"; // TODO if (group.name() == GENERAL_CONFIG_GROUP) { Q_EMIT navigationPanelEnabledChanged(); } else if (group.name() == QUICKSETTINGS_CONFIG_GROUP) { diff --git a/kcms/mobileshell/kcm.cpp b/kcms/mobileshell/kcm.cpp index 6e169deb..9441da03 100644 --- a/kcms/mobileshell/kcm.cpp +++ b/kcms/mobileshell/kcm.cpp @@ -9,27 +9,10 @@ K_PLUGIN_CLASS_WITH_JSON(KCMMobileShell, "metadata.json") -const QString CONFIG_FILE = QStringLiteral("plasmamobilerc"); -const QString GENERAL_CONFIG_GROUP = QStringLiteral("General"); - KCMMobileShell::KCMMobileShell(QObject *parent, const KPluginMetaData &data, const QVariantList &args) : KQuickAddons::ManagedConfigModule(parent, data, args) - , m_config{KSharedConfig::openConfig("plasmamobilerc", KConfig::SimpleConfig)} { setButtons(0); } -bool KCMMobileShell::navigationPanelEnabled() const -{ - auto group = KConfigGroup{m_config, GENERAL_CONFIG_GROUP}; - return group.readEntry("navigationPanelEnabled", true); -} - -void KCMMobileShell::setNavigationPanelEnabled(bool navigationPanelEnabled) -{ - auto group = KConfigGroup{m_config, GENERAL_CONFIG_GROUP}; - group.writeEntry("navigationPanelEnabled", navigationPanelEnabled, KConfigGroup::Notify); - m_config->sync(); -} - #include "kcm.moc" diff --git a/kcms/mobileshell/kcm.h b/kcms/mobileshell/kcm.h index e0d84970..7845a078 100644 --- a/kcms/mobileshell/kcm.h +++ b/kcms/mobileshell/kcm.h @@ -12,15 +12,11 @@ class KCMMobileShell : public KQuickAddons::ManagedConfigModule { Q_OBJECT - Q_PROPERTY(bool navigationPanelEnabled READ navigationPanelEnabled WRITE setNavigationPanelEnabled NOTIFY navigationPanelEnabledChanged) public: KCMMobileShell(QObject *parent, const KPluginMetaData &data, const QVariantList &args); virtual ~KCMMobileShell() override = default; - bool navigationPanelEnabled() const; - void setNavigationPanelEnabled(bool navigationPanelEnabled); - Q_SIGNALS: void navigationPanelEnabledChanged(); diff --git a/kcms/mobileshell/package/contents/ui/main.qml b/kcms/mobileshell/package/contents/ui/main.qml index 3d775208..0ab3b112 100644 --- a/kcms/mobileshell/package/contents/ui/main.qml +++ b/kcms/mobileshell/package/contents/ui/main.qml @@ -40,10 +40,10 @@ KCM.SimpleKCM { MobileForm.FormSwitchDelegate { text: i18n("Gesture-only Mode") description: i18n("Whether to hide the navigation panel.") - checked: !kcm.navigationPanelEnabled + checked: !MobileShell.MobileShellSettings.navigationPanelEnabled onCheckedChanged: { - if (checked != !kcm.navigationPanelEnabled) { - kcm.navigationPanelEnabled = !checked; + if (checked != !MobileShell.MobileShellSettings.navigationPanelEnabled) { + MobileShell.MobileShellSettings.navigationPanelEnabled = !checked; } } }