Commit 278f9d25 authored by Ahmad Samir's avatar Ahmad Samir
Browse files

Use cmakedefine01

This way we get a build time warning if the var isn't defined at all, e.g.
a missing check_include_files() CMake call.
parent 15945eca
Pipeline #188762 passed with stage
in 1 minute and 34 seconds
/* Defines if you have XCB */
#cmakedefine HAVE_XCB 1
#cmakedefine01 HAVE_XCB
/* Define to 1 if you have NetworkManagerQt and BluezQt libs. */
#cmakedefine HAVE_WIRELESS_SUPPORT 1
#cmakedefine01 HAVE_WIRELESS_SUPPORT
......@@ -75,7 +75,7 @@ void KWinKScreenHelperEffect::stop()
bool KWinKScreenHelperEffect::checkValid()
{
#ifdef HAVE_XCB
#if HAVE_XCB
if (QX11Info::isPlatformX11()) {
QScopedPointer<xcb_list_properties_reply_t, QScopedPointerPodDeleter> propsReply(xcb_list_properties_reply(QX11Info::connection(),
xcb_list_properties_unchecked(QX11Info::connection(), QX11Info::appRootWindow()),
......@@ -105,7 +105,7 @@ bool KWinKScreenHelperEffect::checkValid()
void KWinKScreenHelperEffect::setEffectProperty(long value)
{
#ifdef HAVE_XCB
#if HAVE_XCB
if (m_isValid && QX11Info::isPlatformX11()) {
xcb_change_property(QX11Info::connection(), XCB_PROP_MODE_REPLACE, QX11Info::appRootWindow(), m_atom, XCB_ATOM_CARDINAL, 32, 1, &value);
}
......@@ -126,7 +126,7 @@ bool KWinKScreenHelperEffect::nativeEventFilter(const QByteArray &eventType, voi
return false;
}
#ifdef HAVE_XCB
#if HAVE_XCB
if (m_isValid && QX11Info::isPlatformX11()) {
auto e = static_cast<xcb_generic_event_t *>(message);
const uint8_t type = e->response_type & ~0x80;
......
......@@ -27,7 +27,7 @@
#include <QScopedPointer>
#include <QTimer>
#ifdef HAVE_XCB
#if HAVE_XCB
#include <xcb/xcb.h>
#endif
......@@ -74,7 +74,7 @@ private:
QTimer m_abortTimer;
#ifdef HAVE_XCB
#if HAVE_XCB
xcb_atom_t m_atom = 0;
#endif
......
......@@ -40,7 +40,7 @@
#include "actions/bundled/runscript.h"
#include "actions/bundled/handlebuttonevents.h"
#include "actions/bundled/dpms.h"
#ifdef HAVE_WIRELESS_SUPPORT
#if HAVE_WIRELESS_SUPPORT
#include "actions/bundled/wirelesspowersaving.h"
#endif
#include "actions/bundled/powerprofile.h"
......@@ -133,7 +133,7 @@ void ActionPool::init(PowerDevil::Core *parent)
m_actionPool.insert(QStringLiteral("RunScript"), new BundledActions::RunScript(parent));
m_actionPool.insert(QStringLiteral("HandleButtonEvents"), new BundledActions::HandleButtonEvents(parent));
m_actionPool.insert(QStringLiteral("DPMSControl"), new BundledActions::DPMS(parent));
#ifdef HAVE_WIRELESS_SUPPORT
#if HAVE_WIRELESS_SUPPORT
m_actionPool.insert(QStringLiteral("WirelessPowerSaving"), new BundledActions::WirelessPowerSaving(parent));
#endif
m_actionPool.insert(QStringLiteral("PowerProfile"), new BundledActions::PowerProfile(parent));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment