Changeset View
Changeset View
Standalone View
Standalone View
ui/presentationwidget.cpp
Show First 20 Lines • Show All 1748 Lines • ▼ Show 20 Line(s) | |||||
1749 | } | 1749 | } | ||
1750 | 1750 | | |||
1751 | void PresentationWidget::inhibitPowerManagement() | 1751 | void PresentationWidget::inhibitPowerManagement() | ||
1752 | { | 1752 | { | ||
1753 | #ifdef Q_OS_LINUX | 1753 | #ifdef Q_OS_LINUX | ||
1754 | QString reason = i18nc( "Reason for inhibiting the screensaver activation, when the presentation mode is active", "Giving a presentation" ); | 1754 | QString reason = i18nc( "Reason for inhibiting the screensaver activation, when the presentation mode is active", "Giving a presentation" ); | ||
1755 | 1755 | | |||
1756 | if (!m_screenInhibitCookie) { | 1756 | if (!m_screenInhibitCookie) { | ||
1757 | QDBusMessage message = QDBusMessage::createMethodCall("org.freedesktop.ScreenSaver", "/ScreenSaver", | 1757 | QDBusMessage message = QDBusMessage::createMethodCall(QStringLiteral("org.freedesktop.ScreenSaver"), QStringLiteral("/ScreenSaver"), | ||
1758 | "org.freedesktop.ScreenSaver", "Inhibit"); | 1758 | QStringLiteral("org.freedesktop.ScreenSaver"), QStringLiteral("Inhibit")); | ||
1759 | message << QCoreApplication::applicationName(); | 1759 | message << QCoreApplication::applicationName(); | ||
1760 | message << reason; | 1760 | message << reason; | ||
1761 | 1761 | | |||
1762 | QDBusPendingReply<uint> reply = QDBusConnection::sessionBus().asyncCall(message); | 1762 | QDBusPendingReply<uint> reply = QDBusConnection::sessionBus().asyncCall(message); | ||
1763 | reply.waitForFinished(); | 1763 | reply.waitForFinished(); | ||
1764 | if (reply.isValid()) { | 1764 | if (reply.isValid()) { | ||
1765 | m_screenInhibitCookie = reply.value(); | 1765 | m_screenInhibitCookie = reply.value(); | ||
1766 | qCDebug(OkularUiDebug) << "Screen inhibition cookie" << m_screenInhibitCookie; | 1766 | qCDebug(OkularUiDebug) << "Screen inhibition cookie" << m_screenInhibitCookie; | ||
Show All 28 Lines | |||||
1795 | { | 1795 | { | ||
1796 | #ifdef Q_OS_LINUX | 1796 | #ifdef Q_OS_LINUX | ||
1797 | if (m_sleepInhibitFd != -1) { | 1797 | if (m_sleepInhibitFd != -1) { | ||
1798 | ::close(m_sleepInhibitFd); | 1798 | ::close(m_sleepInhibitFd); | ||
1799 | m_sleepInhibitFd = -1; | 1799 | m_sleepInhibitFd = -1; | ||
1800 | } | 1800 | } | ||
1801 | 1801 | | |||
1802 | if (m_screenInhibitCookie) { | 1802 | if (m_screenInhibitCookie) { | ||
1803 | QDBusMessage message = QDBusMessage::createMethodCall("org.freedesktop.ScreenSaver", "/ScreenSaver", | 1803 | QDBusMessage message = QDBusMessage::createMethodCall(QStringLiteral("org.freedesktop.ScreenSaver"), QStringLiteral("/ScreenSaver"), | ||
1804 | "org.freedesktop.ScreenSaver", "UnInhibit"); | 1804 | QStringLiteral("org.freedesktop.ScreenSaver"), QStringLiteral("UnInhibit")); | ||
1805 | message << m_screenInhibitCookie; | 1805 | message << m_screenInhibitCookie; | ||
1806 | 1806 | | |||
1807 | QDBusPendingReply<uint> reply = QDBusConnection::sessionBus().asyncCall(message); | 1807 | QDBusPendingReply<uint> reply = QDBusConnection::sessionBus().asyncCall(message); | ||
1808 | reply.waitForFinished(); | 1808 | reply.waitForFinished(); | ||
1809 | 1809 | | |||
1810 | m_screenInhibitCookie = 0; | 1810 | m_screenInhibitCookie = 0; | ||
1811 | } | 1811 | } | ||
1812 | #endif | 1812 | #endif | ||
▲ Show 20 Lines • Show All 679 Lines • Show Last 20 Lines |