[SailfishDevel] req_display_blanking_pause seems not to work.

Andrew Penkrat penkrat8 at gmail.com
Thu Sep 24 17:44:48 UTC 2015


Hello,

I experience an issue with req_display_blanking_pause dbus call.

I have `QT += dbus` line in the .pro file and my code is the following:

In tools.h:

Q_INVOKABLE void setBlankingMode(bool state);

tools.cpp:

#include "tools.h"
#include <QDebug>
#include <QDBusConnection>
#include <QDBusInterface>

// true - screen blanks (default)
// false - no blanking
void Tools::setBlankingMode(bool state)
{
    QDBusConnection system =
QDBusConnection::connectToBus(QDBusConnection::SystemBus, "system");
    QDBusInterface interface("com.nokia.mce", "/com/nokia/mce/request",
"com.nokia.mce.request", system);

    if (state) {
        qDebug() << "Screen blanking turned on";
        interface.call(QLatin1String("req_display_cancel_blanking_pause"));
    } else {
        qDebug() << "Screen blanking turned off";
        interface.call(QLatin1String("req_display_blanking_pause"));
    }
}

In main function:

Tools* tools = new Tools();
view->rootContext()->setContextProperty("cpptools", tools);

But screen keeps going blank after I call cpptools.setBlankingMode(false)
from QML (tested on Sailfish OS 1.1.9.28). What can be the problem?

Thanks in advance,
Andrew Penkrat
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.sailfishos.org/pipermail/devel/attachments/20150924/61d58522/attachment.html>


More information about the Devel mailing list