|
|
@ -36,31 +36,30 @@ |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifdef QBT_USES_DBUS |
|
|
|
#ifdef QBT_USES_DBUS |
|
|
|
// Require DBus
|
|
|
|
|
|
|
|
class PowerManagementInhibitor; |
|
|
|
class PowerManagementInhibitor; |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
class PowerManagement final : public QObject |
|
|
|
class PowerManagement final : public QObject |
|
|
|
{ |
|
|
|
{ |
|
|
|
Q_OBJECT |
|
|
|
Q_OBJECT |
|
|
|
Q_DISABLE_COPY_MOVE(PowerManagement) |
|
|
|
Q_DISABLE_COPY_MOVE(PowerManagement) |
|
|
|
|
|
|
|
|
|
|
|
public: |
|
|
|
public: |
|
|
|
PowerManagement(QObject *parent = nullptr); |
|
|
|
PowerManagement(QObject *parent = nullptr); |
|
|
|
~PowerManagement() override; |
|
|
|
~PowerManagement() override; |
|
|
|
|
|
|
|
|
|
|
|
void setActivityState(bool busy); |
|
|
|
void setActivityState(bool busy); |
|
|
|
|
|
|
|
|
|
|
|
private: |
|
|
|
private: |
|
|
|
void setBusy(); |
|
|
|
void setBusy(); |
|
|
|
void setIdle(); |
|
|
|
void setIdle(); |
|
|
|
|
|
|
|
|
|
|
|
bool m_busy = false; |
|
|
|
bool m_busy = false; |
|
|
|
|
|
|
|
|
|
|
|
#ifdef QBT_USES_DBUS |
|
|
|
#ifdef QBT_USES_DBUS |
|
|
|
PowerManagementInhibitor *m_inhibitor = nullptr; |
|
|
|
PowerManagementInhibitor *m_inhibitor = nullptr; |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
#ifdef Q_OS_MACOS |
|
|
|
#ifdef Q_OS_MACOS |
|
|
|
IOPMAssertionID m_assertionID {}; |
|
|
|
IOPMAssertionID m_assertionID {}; |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
}; |
|
|
|
}; |
|
|
|