1
1
#include " systemdinhibit.h"
2
2
3
- #ifdef CHIAKI_HAVE_DBUS
3
+ #if defined( CHIAKI_HAVE_DBUS) && !defined(Q_OS_MACOS)
4
4
#include < fcntl.h>
5
5
#include < unistd.h>
6
6
#include < QDBusMessage>
@@ -17,7 +17,7 @@ SystemdInhibit::SystemdInhibit(const QString &who, const QString &why, const QSt
17
17
, what(what)
18
18
, mode(mode)
19
19
{
20
- #ifdef CHIAKI_HAVE_DBUS
20
+ #if defined( CHIAKI_HAVE_DBUS) && !defined(Q_OS_MACOS)
21
21
QDBusConnection::systemBus ().connect (QStringLiteral (" org.freedesktop.login1" ),
22
22
QStringLiteral (" /org/freedesktop/login1" ),
23
23
QStringLiteral (" org.freedesktop.login1.Manager" ),
@@ -29,7 +29,7 @@ SystemdInhibit::SystemdInhibit(const QString &who, const QString &why, const QSt
29
29
30
30
void SystemdInhibit::inhibit ()
31
31
{
32
- #ifdef CHIAKI_HAVE_DBUS
32
+ #if defined( CHIAKI_HAVE_DBUS) && !defined(Q_OS_MACOS)
33
33
QDBusMessage call = QDBusMessage::createMethodCall (QStringLiteral (" org.freedesktop.login1" ),
34
34
QStringLiteral (" /org/freedesktop/login1" ),
35
35
QStringLiteral (" org.freedesktop.login1.Manager" ),
@@ -55,7 +55,7 @@ void SystemdInhibit::inhibit()
55
55
56
56
void SystemdInhibit::simulateUserActivity ()
57
57
{
58
- #ifdef CHIAKI_HAVE_DBUS
58
+ #if defined( CHIAKI_HAVE_DBUS) && !defined(Q_OS_MACOS)
59
59
QDBusMessage call = QDBusMessage::createMethodCall (QStringLiteral (" org.freedesktop.ScreenSaver" ),
60
60
QStringLiteral (" /ScreenSaver" ),
61
61
QStringLiteral (" org.freedesktop.ScreenSaver" ),
@@ -82,7 +82,7 @@ void SystemdInhibit::login1PrepareForSleep(bool start)
82
82
83
83
void SystemdInhibit::release ()
84
84
{
85
- #ifdef CHIAKI_HAVE_DBUS
85
+ #if defined( CHIAKI_HAVE_DBUS) && !defined(Q_OS_MACOS)
86
86
if (fd >= 0 )
87
87
close (fd);
88
88
fd = -1 ;
0 commit comments