Commit 7a92e830 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 8c3c9c17
Pipeline #190279 passed with stage
in 3 minutes and 11 seconds
/* Define to 1 if you have the X11 xres file */
#cmakedefine HAVE_XRES 1
#cmakedefine01 HAVE_XRES
/* Define if you have QtWebEngineWidgets and QtWebChannel */
#cmakedefine01 WEBENGINE_SCRIPTING_ENABLED
......
......@@ -46,7 +46,7 @@
#include <unistd.h>
#endif
#ifdef HAVE_XRES
#if HAVE_XRES
#include <X11/extensions/XRes.h>
#endif
......@@ -115,7 +115,7 @@ ProcessModelPrivate::ProcessModelPrivate()
mShowingTooltips = true;
mNormalizeCPUUsage = true;
mIoInformation = ProcessModel::ActualBytes;
#ifdef HAVE_XRES
#if HAVE_XRES
mHaveXRes = false;
#endif
mHaveTimer = false, mTimerId = -1, mMovingRow = false;
......@@ -141,7 +141,7 @@ ProcessModel::ProcessModel(QObject *parent, const QString &host)
, d(new ProcessModelPrivate)
{
d->q = this;
#ifdef HAVE_XRES
#if HAVE_XRES
if (d->mIsX11) {
int event, error, major, minor;
d->mHaveXRes = XResQueryExtension(QX11Info::display(), &event, &error) && XResQueryVersion(QX11Info::display(), &major, &minor);
......@@ -418,7 +418,7 @@ void ProcessModelPrivate::setupWindows()
}
#endif
#ifdef HAVE_XRES
#if HAVE_XRES
bool ProcessModelPrivate::updateXResClientData()
{
if (!mIsX11) {
......@@ -621,7 +621,7 @@ void ProcessModel::update(long updateDurationMSecs, KSysGuard::Processes::Update
d->mMemTotal = d->mProcesses->totalPhysicalMemory();
}
#ifdef HAVE_XRES
#if HAVE_XRES
// Add all the rest of the windows
if (d->mHaveXRes && updateFlags.testFlag(KSysGuard::Processes::XMemory))
d->queryForAndUpdateAllXWindows();
......
......@@ -135,7 +135,7 @@ public:
void updateWindowInfo(WId wid, NET::Properties properties, NET::Properties2 properties2, bool newWindow);
QMultiHash<long long, WindowInfo *> mPidToWindowInfo; ///< Map a process pid to X window info if available
QHash<WId, WindowInfo *> mWIdToWindowInfo; ///< Map an X window id to window info
#ifdef HAVE_XRES
#if HAVE_XRES
bool updateXResClientData();
void queryForAndUpdateAllXWindows();
#endif
......@@ -203,7 +203,7 @@ public:
QVector<KSysGuard::ProcessAttribute *> mExtraAttributes;
#ifdef HAVE_XRES
#if HAVE_XRES
bool mHaveXRes; ///< True if the XRes extension is available at run time
QMap<qlonglong, XID> mXResClientResources;
#endif
......
......@@ -772,7 +772,7 @@ void KSysGuardProcessList::showColumnContextMenu(const QPoint &point)
if (d->mUi->treeView->header()->sectionsHidden()) {
for (int i = 0; i < num_headings; ++i) {
if (d->mUi->treeView->header()->isSectionHidden(i)) {
#ifndef HAVE_XRES
#if !HAVE_XRES
if (i == ProcessModel::HeadingXMemory)
continue;
#endif
......
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