Changeset View
Changeset View
Standalone View
Standalone View
kcms/notifications/kcm.cpp
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Line(s) | |||||
42 | #include "sourcesmodel.h" | 42 | #include "sourcesmodel.h" | ||
43 | #include "filterproxymodel.h" | 43 | #include "filterproxymodel.h" | ||
44 | 44 | | |||
45 | #include <notificationmanager/settings.h> | 45 | #include <notificationmanager/settings.h> | ||
46 | 46 | | |||
47 | K_PLUGIN_FACTORY_WITH_JSON(KCMNotificationsFactory, "kcm_notifications.json", registerPlugin<KCMNotifications>();) | 47 | K_PLUGIN_FACTORY_WITH_JSON(KCMNotificationsFactory, "kcm_notifications.json", registerPlugin<KCMNotifications>();) | ||
48 | 48 | | |||
49 | KCMNotifications::KCMNotifications(QObject *parent, const QVariantList &args) | 49 | KCMNotifications::KCMNotifications(QObject *parent, const QVariantList &args) | ||
50 | : KQuickAddons::ConfigModule(parent, args) | 50 | : KQuickAddons::ManagedConfigModule(parent, args) | ||
51 | , m_sourcesModel(new SourcesModel(this)) | 51 | , m_sourcesModel(new SourcesModel(this)) | ||
52 | , m_filteredModel(new FilterProxyModel(this)) | 52 | , m_filteredModel(new FilterProxyModel(this)) | ||
53 | , m_settings(new NotificationManager::Settings(this)) | 53 | , m_settings(new NotificationManager::Settings(this)) | ||
54 | { | 54 | { | ||
55 | 55 | | |||
56 | const char uri[] = "org.kde.private.kcms.notifications"; | 56 | const char uri[] = "org.kde.private.kcms.notifications"; | ||
57 | qmlRegisterUncreatableType<SourcesModel>(uri, 1, 0, "SourcesModel", | 57 | qmlRegisterUncreatableType<SourcesModel>(uri, 1, 0, "SourcesModel", | ||
58 | QStringLiteral("Cannot create instances of SourcesModel")); | 58 | QStringLiteral("Cannot create instances of SourcesModel")); | ||
Show All 24 Lines | |||||
83 | QCommandLineOption eventIdOption(QStringLiteral("event-id"), QString(), QStringLiteral("event-id")); | 83 | QCommandLineOption eventIdOption(QStringLiteral("event-id"), QString(), QStringLiteral("event-id")); | ||
84 | parser.addOption(eventIdOption); | 84 | parser.addOption(eventIdOption); | ||
85 | 85 | | |||
86 | parser.parse(stringArgs); | 86 | parser.parse(stringArgs); | ||
87 | 87 | | |||
88 | setInitialDesktopEntry(parser.value(desktopEntryOption)); | 88 | setInitialDesktopEntry(parser.value(desktopEntryOption)); | ||
89 | setInitialNotifyRcName(parser.value(notifyRcNameOption)); | 89 | setInitialNotifyRcName(parser.value(notifyRcNameOption)); | ||
90 | setInitialEventId(parser.value(eventIdOption)); | 90 | setInitialEventId(parser.value(eventIdOption)); | ||
91 | | ||||
92 | const auto skeletons = m_settings->configSkeletons(); | ||||
ervin: Not necessary anymore | |||||
93 | for (const auto skeleton : skeletons) { | ||||
94 | registerSettings(skeleton); | ||||
95 | } | ||||
91 | } | 96 | } | ||
92 | 97 | | |||
93 | KCMNotifications::~KCMNotifications() | 98 | KCMNotifications::~KCMNotifications() | ||
94 | { | 99 | { | ||
95 | 100 | | |||
96 | } | 101 | } | ||
97 | 102 | | |||
98 | SourcesModel *KCMNotifications::sourcesModel() const | 103 | SourcesModel *KCMNotifications::sourcesModel() const | ||
▲ Show 20 Lines • Show All 89 Lines • ▼ Show 20 Line(s) | 158 | { | |||
188 | w->setApplication(notifyRcName); | 193 | w->setApplication(notifyRcName); | ||
189 | w->selectEvent(eventId); | 194 | w->selectEvent(eventId); | ||
190 | 195 | | |||
191 | dialog->show(); | 196 | dialog->show(); | ||
192 | } | 197 | } | ||
193 | 198 | | |||
194 | void KCMNotifications::load() | 199 | void KCMNotifications::load() | ||
195 | { | 200 | { | ||
201 | ManagedConfigModule::load(); | ||||
196 | m_settings->load(); | 202 | m_settings->load(); | ||
197 | } | 203 | } | ||
198 | 204 | | |||
199 | void KCMNotifications::save() | 205 | void KCMNotifications::save() | ||
200 | { | 206 | { | ||
207 | ManagedConfigModule::save(); | ||||
201 | m_settings->save(); | 208 | m_settings->save(); | ||
202 | } | 209 | } | ||
203 | 210 | | |||
204 | void KCMNotifications::defaults() | 211 | void KCMNotifications::defaults() | ||
205 | { | 212 | { | ||
213 | ManagedConfigModule::defaults(); | ||||
206 | m_settings->defaults(); | 214 | m_settings->defaults(); | ||
207 | } | 215 | } | ||
208 | 216 | | |||
209 | #include "kcm.moc" | 217 | #include "kcm.moc" |
Not necessary anymore