Changeset View
Changeset View
Standalone View
Standalone View
kcms/style/kcmstyle.cpp
Show All 31 Lines | |||||
32 | #include "styleconfdialog.h" | 32 | #include "styleconfdialog.h" | ||
33 | 33 | | |||
34 | #include <KAboutData> | 34 | #include <KAboutData> | ||
35 | #include <KConfigGroup> | 35 | #include <KConfigGroup> | ||
36 | #include <KLocalizedString> | 36 | #include <KLocalizedString> | ||
37 | #include <KPluginFactory> | 37 | #include <KPluginFactory> | ||
38 | #include <KPluginLoader> | 38 | #include <KPluginLoader> | ||
39 | 39 | | |||
40 | #include <QDBusReply> | | |||
41 | #include <QLibrary> | 40 | #include <QLibrary> | ||
42 | #include <QMetaEnum> | 41 | #include <QMetaEnum> | ||
43 | #include <QQuickItem> | 42 | #include <QQuickItem> | ||
44 | #include <QQuickRenderControl> | 43 | #include <QQuickRenderControl> | ||
45 | #include <QQuickWindow> | 44 | #include <QQuickWindow> | ||
46 | #include <QScopedPointer> | 45 | #include <QScopedPointer> | ||
47 | #include <QStyleFactory> | 46 | #include <QStyleFactory> | ||
48 | #include <QWidget> | 47 | #include <QWidget> | ||
49 | #include <QWindow> | 48 | #include <QWindow> | ||
50 | 49 | | |||
51 | #include <KGlobal> | 50 | #include <KGlobal> | ||
52 | #include <KGlobalSettings> | 51 | #include <KGlobalSettings> | ||
53 | 52 | | |||
54 | #include "../krdb/krdb.h" | 53 | #include "../krdb/krdb.h" | ||
55 | 54 | | |||
56 | #include "stylesmodel.h" | 55 | #include "stylesmodel.h" | ||
57 | #include "previewitem.h" | 56 | #include "previewitem.h" | ||
58 | #include "stylesettings.h" | 57 | #include "stylesettings.h" | ||
59 | #include "gtkpage.h" | 58 | #include "gtkpage.h" | ||
59 | #include "kdeddbusinterface.h" | ||||
60 | 60 | | |||
61 | K_PLUGIN_FACTORY_WITH_JSON(KCMStyleFactory, "kcm_style.json", registerPlugin<KCMStyle>();) | 61 | K_PLUGIN_FACTORY_WITH_JSON(KCMStyleFactory, "kcm_style.json", registerPlugin<KCMStyle>();) | ||
62 | 62 | | |||
63 | extern "C" | 63 | extern "C" | ||
64 | { | 64 | { | ||
65 | Q_DECL_EXPORT void kcminit_style() | 65 | Q_DECL_EXPORT void kcminit_style() | ||
66 | { | 66 | { | ||
67 | uint flags = KRdbExportQtSettings | KRdbExportGtkColors | KRdbExportQtColors | KRdbExportXftSettings | KRdbExportGtkTheme; | 67 | uint flags = KRdbExportQtSettings | KRdbExportGtkColors | KRdbExportQtColors | KRdbExportXftSettings | KRdbExportGtkTheme; | ||
▲ Show 20 Lines • Show All 167 Lines • ▼ Show 20 Line(s) | 220 | connect(m_styleConfigDialog.data(), &QDialog::accepted, this, [this, styleName] { | |||
235 | setNeedsSave(true); | 235 | setNeedsSave(true); | ||
236 | }); | 236 | }); | ||
237 | 237 | | |||
238 | m_styleConfigDialog->show(); | 238 | m_styleConfigDialog->show(); | ||
239 | } | 239 | } | ||
240 | 240 | | |||
241 | bool KCMStyle::gtkConfigKdedModuleLoaded() | 241 | bool KCMStyle::gtkConfigKdedModuleLoaded() | ||
242 | { | 242 | { | ||
243 | QDBusInterface kdedInterface( | 243 | KdedDBusInterface kdedInterface(this); | ||
244 | QStringLiteral("org.kde.kded5"), | 244 | QStringList loadedKdedModules = kdedInterface.loadedModules(); | ||
245 | QStringLiteral("/kded"), | 245 | return loadedKdedModules.contains(QStringLiteral("gtkconfig")); | ||
246 | QStringLiteral("org.kde.kded5") | | |||
247 | ); | | |||
248 | QDBusReply<QStringList> loadedKdedModules = kdedInterface.call(QStringLiteral("loadedModules")); | | |||
249 | return loadedKdedModules.value().contains(QStringLiteral("gtkconfig")); | | |||
250 | } | 246 | } | ||
251 | 247 | | |||
252 | void KCMStyle::load() | 248 | void KCMStyle::load() | ||
253 | { | 249 | { | ||
254 | if (m_gtkPage) { | 250 | if (m_gtkPage) { | ||
255 | m_gtkPage->load(); | 251 | m_gtkPage->load(); | ||
256 | } | 252 | } | ||
257 | 253 | | |||
▲ Show 20 Lines • Show All 85 Lines • Show Last 20 Lines |