Last active
August 29, 2015 14:13
-
-
Save kimmoli/305179a5604fbcd696da to your computer and use it in GitHub Desktop.
Cover animation disable
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <QDBusConnection> | |
... | |
QDBusConnection::sessionBus().connect("", "/com/jolla/lipstick", "com.jolla.lipstick", "coverstatus", | |
this, SLOT(handleCoverstatus(const QDBusMessage&))); | |
... | |
void myclass::handleCoverstatus(const QDBusMessage& msg) | |
{ | |
QList<QVariant> args = msg.arguments(); | |
m_coverStatus = args.at(0).toInt(); | |
emit coverStatusChanged(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <QDBusMessage> | |
... | |
Q_PROPERTY(int coverStatus READ readCoverStatus NOTIFY coverStatusChanged()) | |
... | |
public: | |
int readCoverStatus() { return m_coverStatus; } | |
public slots: | |
void handleCoverstatus(const QDBusMessage& msg); | |
signals: | |
void coverStatusChanged(); | |
private: | |
int m_coverStatus; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
QT += dbus |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BuildRequires: pkgconfig(Qt5DBus) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Timer | |
{ | |
id: coverRefreshTimer | |
interval: 500 | |
running: myclass.coverStatus === 2 | |
repeat: true | |
onTriggered: updateCover() | |
} |
Forked it, also disables timer when display is blanked ๐
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
what other values can coverStatus have? ๐