diff --git a/kcms/feedback/feedback.h b/kcms/feedback/feedback.h --- a/kcms/feedback/feedback.h +++ b/kcms/feedback/feedback.h @@ -28,23 +28,14 @@ { Q_OBJECT - Q_PROPERTY(bool feedbackEnabled READ feedbackEnabled WRITE setFeedbackEnabled NOTIFY feedbackEnabledChanged) Q_PROPERTY(int plasmaFeedbackLevel READ plasmaFeedbackLevel WRITE setPlasmaFeedbackLevel NOTIFY plasmaFeedbackLevelChanged) public: explicit Feedback(QObject* parent = nullptr, const QVariantList &list = QVariantList()); ~Feedback() override; - bool feedbackEnabled() const { return m_feedbackEnabled; } int plasmaFeedbackLevel() const { return m_plasmaFeedbackLevel; } - void setFeedbackEnabled(bool feedbackEnabled) { - if (feedbackEnabled != m_feedbackEnabled) { - m_feedbackEnabled = feedbackEnabled; - Q_EMIT feedbackEnabledChanged(feedbackEnabled); - } - } - void setPlasmaFeedbackLevel(int plasmaFeedbackLevel) { if (plasmaFeedbackLevel != m_plasmaFeedbackLevel) { m_plasmaFeedbackLevel = plasmaFeedbackLevel; @@ -58,12 +49,9 @@ void defaults() override; Q_SIGNALS: - void feedbackEnabledChanged(bool feedbackEnabled) const; void plasmaFeedbackLevelChanged(bool plasmaFeedbackLevel); private: - KSharedConfig::Ptr m_globalConfig; KSharedConfig::Ptr m_plasmaConfig; - bool m_feedbackEnabled = false; int m_plasmaFeedbackLevel = 0; }; diff --git a/kcms/feedback/feedback.cpp b/kcms/feedback/feedback.cpp --- a/kcms/feedback/feedback.cpp +++ b/kcms/feedback/feedback.cpp @@ -32,18 +32,13 @@ Feedback::Feedback(QObject *parent, const QVariantList &args) : KQuickAddons::ConfigModule(parent) - //UserFeedback.conf is used by KUserFeedback which uses QSettings and won't go through globals - , m_globalConfig(KSharedConfig::openConfig(QStringLiteral("KDE/UserFeedback.conf"), KConfig::NoGlobals)) , m_plasmaConfig(KSharedConfig::openConfig(QStringLiteral("PlasmaUserFeedback"))) { Q_UNUSED(args) setAboutData(new KAboutData(QStringLiteral("kcm_feedback"), i18n("User Feedback"), QStringLiteral("1.0"), i18n("Configure user feedback settings"), KAboutLicense::LGPL)); - connect(this, &Feedback::feedbackEnabledChanged, this, [this](){ - setNeedsSave(true); - }); connect(this, &Feedback::plasmaFeedbackLevelChanged, this, [this](){ setNeedsSave(true); }); @@ -55,24 +50,19 @@ { //The global kill switch is off by default, all KDE components should default to KUserFeedback::Provider::NoTelemetry KUserFeedback::Provider p; - setFeedbackEnabled(p.isEnabled()); setPlasmaFeedbackLevel(m_plasmaConfig->group("Global").readEntry("FeedbackLevel", int(KUserFeedback::Provider::NoTelemetry))); setNeedsSave(false); } void Feedback::save() { - m_globalConfig->group("UserFeedback").writeEntry("Enabled", m_feedbackEnabled); - m_globalConfig->sync(); - m_plasmaConfig->group("Global").writeEntry("FeedbackLevel", m_plasmaFeedbackLevel); m_plasmaConfig->sync(); } void Feedback::defaults() { - setFeedbackEnabled(true); setPlasmaFeedbackLevel(KUserFeedback::Provider::NoTelemetry); } diff --git a/kcms/feedback/package/contents/ui/main.qml b/kcms/feedback/package/contents/ui/main.qml --- a/kcms/feedback/package/contents/ui/main.qml +++ b/kcms/feedback/package/contents/ui/main.qml @@ -34,21 +34,12 @@ ColumnLayout { - QQC2.CheckBox { - Layout.topMargin: Kirigami.Units.gridUnit - Layout.bottomMargin: Kirigami.Units.gridUnit - Layout.alignment: Qt.AlignHCenter - checked: kcm.feedbackEnabled - onToggled: kcm.feedbackEnabled = checked - text: i18n("Allow KDE software to collect anonymous usage information") - } - QQC2.Label { Kirigami.FormData.label: i18n("Plasma:") Layout.alignment: Qt.AlignHCenter Layout.fillWidth: true wrapMode: Text.WordWrap - text: xi18nc("@info", "You can help us improve this software by sharing information about how you use it. This allows us to focus on things that matter to you.Contributing usage information is optional and entirely anonymous. It will not associate the data with any kind of unique identifier, and will never track the documents you open, the websites you visit, or any other kind of personal information.You can read more about our policy in the following link:") + text: xi18nc("@info", "You can help us improve this software by sharing information about how you use Plasma. This allows us to focus on things that matter to you.Contributing usage information is optional and entirely anonymous. Data is not associated with any unique identifier, and will never track the documents you open, the websites you visit, or any other kind of personal information.You can read more about our policy in the following link:") } Kirigami.UrlButton {