Changeset View
Changeset View
Standalone View
Standalone View
kcmodule/common/actioneditwidget.cpp
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | 41 | ActionEditWidget::ActionEditWidget(const QString &configName, QWidget *parent) | |||
---|---|---|---|---|---|
43 | , m_configName(configName) | 43 | , m_configName(configName) | ||
44 | { | 44 | { | ||
45 | m_profilesConfig = KSharedConfig::openConfig("powermanagementprofilesrc", KConfig::SimpleConfig | KConfig::CascadeConfig); | 45 | m_profilesConfig = KSharedConfig::openConfig("powermanagementprofilesrc", KConfig::SimpleConfig | KConfig::CascadeConfig); | ||
46 | 46 | | |||
47 | ActionConfigWidget *actionConfigWidget = new ActionConfigWidget(nullptr); | 47 | ActionConfigWidget *actionConfigWidget = new ActionConfigWidget(nullptr); | ||
48 | QMap< int, QList<QPair<QString, QWidget*> > > widgets; | 48 | QMap< int, QList<QPair<QString, QWidget*> > > widgets; | ||
49 | 49 | | |||
50 | // Load all the services | 50 | // Load all the services | ||
51 | KService::List offers = KServiceTypeTrader::self()->query("PowerDevil/Action", "(Type == 'Service')"); | 51 | const KService::List offers = KServiceTypeTrader::self()->query("PowerDevil/Action", "(Type == 'Service')"); | ||
52 | 52 | | |||
53 | Q_FOREACH (const KService::Ptr &offer, offers) { | 53 | for (const KService::Ptr &offer : offers) { | ||
54 | // Does it have a runtime requirement? | 54 | // Does it have a runtime requirement? | ||
55 | if (offer->property("X-KDE-PowerDevil-Action-HasRuntimeRequirement", QVariant::Bool).toBool()) { | 55 | if (offer->property("X-KDE-PowerDevil-Action-HasRuntimeRequirement", QVariant::Bool).toBool()) { | ||
56 | qCDebug(POWERDEVIL) << offer->name() << " has a runtime requirement"; | 56 | qCDebug(POWERDEVIL) << offer->name() << " has a runtime requirement"; | ||
57 | 57 | | |||
58 | QDBusMessage call = QDBusMessage::createMethodCall("org.kde.Solid.PowerManagement", "/org/kde/Solid/PowerManagement", | 58 | QDBusMessage call = QDBusMessage::createMethodCall("org.kde.Solid.PowerManagement", "/org/kde/Solid/PowerManagement", | ||
59 | "org.kde.Solid.PowerManagement", "isActionSupported"); | 59 | "org.kde.Solid.PowerManagement", "isActionSupported"); | ||
60 | call.setArguments(QVariantList() << offer->property("X-KDE-PowerDevil-Action-ID", QVariant::String)); | 60 | call.setArguments(QVariantList() << offer->property("X-KDE-PowerDevil-Action-ID", QVariant::String)); | ||
61 | QDBusPendingReply< bool > reply = QDBusConnection::sessionBus().asyncCall(call); | 61 | QDBusPendingReply< bool > reply = QDBusConnection::sessionBus().asyncCall(call); | ||
▲ Show 20 Lines • Show All 137 Lines • Show Last 20 Lines |