Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 17ed21d0 authored by Laurent Montel's avatar Laurent Montel 😁

Add some QStringLiteral

parent daeca1ab
......@@ -90,7 +90,7 @@ Core* Action::core()
void Action::trigger(const QVariantMap& args)
{
if (args.contains("Explicit") && args["Explicit"].toBool()) {
if (args.contains(QLatin1String("Explicit")) && args[QLatin1String("Explicit")].toBool()) {
// The action was explicitly triggered by the user, hence any policy check is bypassed.
triggerImpl(args);
} else {
......
......@@ -92,10 +92,10 @@ void ActionPool::clearCache()
void ActionPool::init(PowerDevil::Core *parent)
{
// Load all the actions
KService::List offers = KServiceTypeTrader::self()->query("PowerDevil/Action",
"[X-KDE-PowerDevil-Action-IsBundled] == FALSE");
KService::List offers = KServiceTypeTrader::self()->query(QStringLiteral("PowerDevil/Action"),
QStringLiteral("[X-KDE-PowerDevil-Action-IsBundled] == FALSE"));
Q_FOREACH (KService::Ptr offer, offers) {
QString actionId = offer->property("X-KDE-PowerDevil-Action-ID", QVariant::String).toString();
QString actionId = offer->property(QStringLiteral("X-KDE-PowerDevil-Action-ID"), QVariant::String).toString();
qCDebug(POWERDEVIL) << "Got a valid offer for " << actionId;
......@@ -125,14 +125,14 @@ void ActionPool::init(PowerDevil::Core *parent)
}
// Load bundled actions now
m_actionPool.insert("SuspendSession", new BundledActions::SuspendSession(parent));
m_actionPool.insert("BrightnessControl", new BundledActions::BrightnessControl(parent));
m_actionPool.insert("KeyboardBrightnessControl", new BundledActions::KeyboardBrightnessControl(parent));
m_actionPool.insert("DimDisplay", new BundledActions::DimDisplay(parent));
m_actionPool.insert("RunScript", new BundledActions::RunScript(parent));
m_actionPool.insert("HandleButtonEvents", new BundledActions::HandleButtonEvents(parent));
m_actionPool.insert(QStringLiteral("SuspendSession"), new BundledActions::SuspendSession(parent));
m_actionPool.insert(QStringLiteral("BrightnessControl"), new BundledActions::BrightnessControl(parent));
m_actionPool.insert(QStringLiteral("KeyboardBrightnessControl"), new BundledActions::KeyboardBrightnessControl(parent));
m_actionPool.insert(QStringLiteral("DimDisplay"), new BundledActions::DimDisplay(parent));
m_actionPool.insert(QStringLiteral("RunScript"), new BundledActions::RunScript(parent));
m_actionPool.insert(QStringLiteral("HandleButtonEvents"), new BundledActions::HandleButtonEvents(parent));
#ifdef HAVE_WIRELESS_SUPPORT
m_actionPool.insert("WirelessPowerSaving", new BundledActions::WirelessPowerSaving(parent));
m_actionPool.insert(QStringLiteral("WirelessPowerSaving"), new BundledActions::WirelessPowerSaving(parent));
#endif
// Verify support
......@@ -149,13 +149,13 @@ void ActionPool::init(PowerDevil::Core *parent)
// Register DBus objects
{
KService::List offers = KServiceTypeTrader::self()->query("PowerDevil/Action",
"[X-KDE-PowerDevil-Action-RegistersDBusInterface] == TRUE");
KService::List offers = KServiceTypeTrader::self()->query(QStringLiteral("PowerDevil/Action"),
QStringLiteral("[X-KDE-PowerDevil-Action-RegistersDBusInterface] == TRUE"));
Q_FOREACH (KService::Ptr offer, offers) {
QString actionId = offer->property("X-KDE-PowerDevil-Action-ID", QVariant::String).toString();
QString actionId = offer->property(QStringLiteral("X-KDE-PowerDevil-Action-ID"), QVariant::String).toString();
if (m_actionPool.contains(actionId)) {
QDBusConnection::sessionBus().registerObject("/org/kde/Solid/PowerManagement/Actions/" + actionId, m_actionPool[actionId]);
QDBusConnection::sessionBus().registerObject(QStringLiteral("/org/kde/Solid/PowerManagement/Actions/") + actionId, m_actionPool[actionId]);
}
}
}
......
This diff is collapsed.
......@@ -301,7 +301,7 @@ void PolicyAgent::onSessionHandlerRegistered(const QString & serviceName)
}
// Now let's obtain the seat
QDBusPendingReply< QDBusObjectPath > seatPath = m_ckSessionInterface.data()->asyncCall("GetSeatId");
QDBusPendingReply< QDBusObjectPath > seatPath = m_ckSessionInterface.data()->asyncCall(QStringLiteral("GetSeatId"));
seatPath.waitForFinished();
if (!seatPath.isValid() || seatPath.value().path().isEmpty()) {
......@@ -336,11 +336,11 @@ void PolicyAgent::onSessionHandlerRegistered(const QString & serviceName)
void PolicyAgent::onSessionHandlerUnregistered(const QString & serviceName)
{
if (serviceName == SYSTEMD_LOGIN1_SERVICE) {
if (serviceName == QLatin1String(SYSTEMD_LOGIN1_SERVICE)) {
m_sdAvailable = false;
delete m_sdSessionInterface.data();
}
else if (serviceName == CONSOLEKIT_SERVICE) {
else if (serviceName == QLatin1String(CONSOLEKIT_SERVICE)) {
m_ckAvailable = false;
delete m_ckSessionInterface.data();
}
......@@ -423,7 +423,7 @@ PolicyAgent::RequiredPolicies PolicyAgent::requirePolicyCheck(PolicyAgent::Requi
// No way to determine if we are on the current session, simply suppose we are
qCDebug(POWERDEVIL) << "Can't contact ck";
} else if (!m_ckSessionInterface.isNull()) {
QDBusPendingReply< bool > rp = m_ckSessionInterface.data()->asyncCall("IsActive");
QDBusPendingReply< bool > rp = m_ckSessionInterface.data()->asyncCall(QStringLiteral("IsActive"));
rp.waitForFinished();
if (!(rp.isValid() && rp.value()) && !m_wasLastActiveSession) {
......@@ -671,11 +671,11 @@ void PolicyAgent::setupSystemdInhibition()
qCDebug(POWERDEVIL) << "fd passing available:" << bool(m_managerIface.data()->connection().connectionCapabilities() & QDBusConnection::UnixFileDescriptorPassing);
QVariantList args;
args << "handle-power-key:handle-suspend-key:handle-hibernate-key:handle-lid-switch"; // what
args << "PowerDevil"; // who
args << "KDE handles power events"; // why
args << "block"; // mode
QDBusPendingReply<QDBusUnixFileDescriptor> desc = m_managerIface.data()->asyncCallWithArgumentList("Inhibit", args);
args << QStringLiteral("handle-power-key:handle-suspend-key:handle-hibernate-key:handle-lid-switch"); // what
args << QStringLiteral("PowerDevil"); // who
args << QStringLiteral("KDE handles power events"); // why
args << QStringLiteral("block"); // mode
QDBusPendingReply<QDBusUnixFileDescriptor> desc = m_managerIface.data()->asyncCallWithArgumentList(QStringLiteral("Inhibit"), args);
desc.waitForFinished();
if (desc.isValid()) {
m_systemdInhibitFd = desc.value();
......
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