Commit ca2765cc authored by Benjamin Port's avatar Benjamin Port Committed by Benjamin Port

KCM User feedback: Setup module data

parent dec9a10e
......@@ -2,6 +2,14 @@ add_definitions(-DTRANSLATION_DOMAIN=\"kcm_feedback\")
set(kcm_feedback_PART_SRCS feedback.cpp)
kcmutils_generate_module_data(
kcm_feedback_PART_SRCS
MODULE_DATA_HEADER feedbackdata.h
MODULE_DATA_CLASS_NAME FeedbackData
SETTINGS_HEADERS feedbacksettings.h
SETTINGS_CLASSES FeedbackSettings
)
kconfig_add_kcfg_files(kcm_feedback_PART_SRCS feedbacksettings.kcfgc GENERATE_MOC)
add_library(kcm_feedback MODULE ${kcm_feedback_PART_SRCS})
......
......@@ -30,9 +30,10 @@
#include <KUserFeedback/Provider>
#include <KUserFeedback/FeedbackConfigUiController>
#include "feedbackdata.h"
#include "feedbacksettings.h"
K_PLUGIN_CLASS_WITH_JSON(Feedback, "kcm_feedback.json");
K_PLUGIN_FACTORY_WITH_JSON(FeedbackFactory, "kcm_feedback.json", registerPlugin<Feedback>();registerPlugin<FeedbackData>();)
//Program to icon hash
static QHash<QString, QString> s_programs = {
......@@ -50,7 +51,7 @@ inline void swap(QJsonValueRef v1, QJsonValueRef v2)
Feedback::Feedback(QObject *parent, const QVariantList &args)
: KQuickAddons::ManagedConfigModule(parent)
//UserFeedback.conf is used by KUserFeedback which uses QSettings and won't go through globals
, m_feedbackSettings(new FeedbackSettings(this))
, m_data(new FeedbackData(this))
{
Q_UNUSED(args)
......@@ -134,7 +135,7 @@ bool Feedback::feedbackEnabled() const
FeedbackSettings *Feedback::feedbackSettings() const
{
return m_feedbackSettings;
return m_data->settings();
}
#include "feedback.moc"
......@@ -25,6 +25,7 @@
#include <KSharedConfig>
class FeedbackSettings;
class FeedbackData;
class Feedback : public KQuickAddons::ManagedConfigModule
{
......@@ -49,5 +50,5 @@ class Feedback : public KQuickAddons::ManagedConfigModule
private:
QHash<int, QHash<QString, QJsonArray>> m_uses;
QJsonArray m_feedbackSources;
FeedbackSettings *m_feedbackSettings;
FeedbackData *m_data;
};
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment