Changeset View
Changeset View
Standalone View
Standalone View
Modules/energy/kcm.cpp
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | |||||
43 | 43 | | |||
44 | 44 | | |||
45 | K_PLUGIN_FACTORY_WITH_JSON(KCMLookandFeelFactory, "kcm_energyinfo.json", registerPlugin<KCMEnergyInfo>();) | 45 | K_PLUGIN_FACTORY_WITH_JSON(KCMLookandFeelFactory, "kcm_energyinfo.json", registerPlugin<KCMEnergyInfo>();) | ||
46 | 46 | | |||
47 | using namespace KQuickAddons; | 47 | using namespace KQuickAddons; | ||
48 | 48 | | |||
49 | KCMEnergyInfo::KCMEnergyInfo(QObject *parent, const QVariantList &args) : ConfigModule(parent, args) | 49 | KCMEnergyInfo::KCMEnergyInfo(QObject *parent, const QVariantList &args) : ConfigModule(parent, args) | ||
50 | { | 50 | { | ||
51 | //This flag seems to be needed in order for QQuickWidget to work | | |||
52 | //see https://bugreports.qt-project.org/browse/QTBUG-40765 | | |||
53 | //also, it seems to work only if set in the kcm, not in the systemsettings' main | | |||
54 | qApp->setAttribute(Qt::AA_DontCreateNativeWidgetSiblings); | | |||
55 | | ||||
56 | qmlRegisterType<BatteryModel>(); | 51 | qmlRegisterType<BatteryModel>(); | ||
57 | qmlRegisterType<WakeUpModel>(); | 52 | qmlRegisterType<WakeUpModel>(); | ||
58 | qmlRegisterType<StatisticsProvider>("org.kde.kinfocenter.energy.private", 1, 0, "HistoryModel"); | 53 | qmlRegisterType<StatisticsProvider>("org.kde.kinfocenter.energy.private", 1, 0, "HistoryModel"); | ||
59 | 54 | | |||
60 | KAboutData *about = new KAboutData(QStringLiteral("kcm_energyinfo"), i18n("Energy Consumption Statistics"), | 55 | KAboutData *about = new KAboutData(QStringLiteral("kcm_energyinfo"), i18n("Energy Consumption Statistics"), | ||
61 | QStringLiteral("0.1"), QString(), KAboutLicense::GPL); | 56 | QStringLiteral("0.2"), QString(), KAboutLicense::GPL); | ||
62 | about->addAuthor(i18n("Kai Uwe Broulik"), QString(), QStringLiteral("kde@privat.broulik.de")); | 57 | about->addAuthor(i18n("Kai Uwe Broulik"), QString(), QStringLiteral("kde@privat.broulik.de")); | ||
63 | setAboutData(about); | 58 | setAboutData(about); | ||
64 | 59 | | |||
65 | m_batteries = new BatteryModel(this); | 60 | m_batteries = new BatteryModel(this); | ||
66 | 61 | | |||
67 | m_wakeUps = new WakeUpModel(this); | 62 | m_wakeUps = new WakeUpModel(this); | ||
68 | } | 63 | } | ||
69 | 64 | | |||
70 | 65 | | |||
71 | #include "kcm.moc" | 66 | #include "kcm.moc" |