Commit 75226860 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 18b9da9c
Pipeline #190486 passed with stage
in 2 minutes and 32 seconds
......@@ -175,7 +175,7 @@ QString Part::currentWorkingDirectory() const
return activeSession()->currentWorkingDirectory();
}
#ifdef USE_TERMINALINTERFACEV2
#if USE_TERMINALINTERFACEV2
QVariant Part::profileProperty(const QString &profileProperty) const
{
const auto metaEnum = QMetaEnum::fromType<Profile::Property>();
......
......@@ -32,7 +32,7 @@ class ViewProperties;
* A re-usable terminal emulator component using the KParts framework which can
* be used to embed terminal emulators into other applications.
*/
#ifdef USE_TERMINALINTERFACEV2
#if USE_TERMINALINTERFACEV2
class Part : public KParts::ReadOnlyPart, public TerminalInterfaceV2
{
Q_OBJECT
......@@ -68,7 +68,7 @@ public:
/** Reimplemented from TerminalInterface. */
QString currentWorkingDirectory() const override;
#ifdef USE_TERMINALINTERFACEV2
#if USE_TERMINALINTERFACEV2
/** Reimplemented from TerminalInterfaceV2 */
QStringList availableProfiles() const override;
......
......@@ -506,7 +506,7 @@ public:
protected:
bool readCurrentDir(int pid) override
{
#if defined(HAVE_OS_DRAGONFLYBSD)
#if HAVE_OS_DRAGONFLYBSD
char buf[PATH_MAX];
int managementInfoBase[4];
size_t len;
......@@ -571,7 +571,7 @@ private:
return false;
}
#if defined(HAVE_OS_DRAGONFLYBSD)
#if HAVE_OS_DRAGONFLYBSD
setName(QString::fromUtf8(kInfoProc->kp_comm));
setPid(kInfoProc->kp_pid);
setParentPid(kInfoProc->kp_ppid);
......
......@@ -27,7 +27,7 @@
#include "history/HistoryScrollNone.h"
#include "history/HistoryType.h"
#ifdef HAVE_MALLOC_TRIM
#if HAVE_MALLOC_TRIM
// For malloc_trim, which is a GNU extension
extern "C" {
#include <malloc.h>
......@@ -1881,7 +1881,7 @@ void Screen::setScroll(const HistoryType &t, bool copyPreviousScroll)
t.scroll(_history);
}
_graphicsPlacements.clear();
#ifdef HAVE_MALLOC_TRIM
#if HAVE_MALLOC_TRIM
#ifdef Q_OS_LINUX
// We might have been using gigabytes of memory, so make sure it is actually released
......
......@@ -641,7 +641,7 @@ void Vt102Emulation::processChecksumRequest([[maybe_unused]] int crargc, int cra
{
int checksum = 0;
#if defined(ENABLE_DECRQCRA)
#if ENABLE_DECRQCRA
int top, left, bottom, right;
/* DEC STD-070 5-179 "If Pp is 0 or omitted, subsequent parameters are ignored
......
......@@ -195,7 +195,7 @@ void TerminalInterfaceTest::testTerminalInterface()
void TerminalInterfaceTest::testTerminalInterfaceV2()
{
#ifdef USE_TERMINALINTERFACEV2
#if USE_TERMINALINTERFACEV2
Profile::Ptr testProfile(new Profile);
testProfile->useBuiltin();
ProfileManager::instance()->addProfile(testProfile);
......
#define KONSOLE_VERSION "${RELEASE_SERVICE_VERSION}"
/* Defined if on DragonFly BSD */
#cmakedefine HAVE_OS_DRAGONFLYBSD 1
#cmakedefine01 HAVE_OS_DRAGONFLYBSD
#cmakedefine01 HAVE_X11
/* If defined, remove public access to dbus sendInput/runCommand */
#cmakedefine REMOVE_SENDTEXT_RUNCOMMAND_DBUS_METHODS
#cmakedefine01 REMOVE_SENDTEXT_RUNCOMMAND_DBUS_METHODS
/* If defined, can checksum rectangular areas of the screen */
#cmakedefine ENABLE_DECRQCRA
#cmakedefine01 ENABLE_DECRQCRA
#cmakedefine USE_TERMINALINTERFACEV2
#cmakedefine01 USE_TERMINALINTERFACEV2
#cmakedefine HAVE_GETPWUID ${HAVE_GETPWUID}
#cmakedefine01 HAVE_GETPWUID
/* Defined if system has the malloc_trim function, which is a GNU extension */
#cmakedefine HAVE_MALLOC_TRIM
#cmakedefine01 HAVE_MALLOC_TRIM
......@@ -51,7 +51,7 @@
#include "terminalDisplay/TerminalScrollBar.h"
// Linux
#ifdef HAVE_GETPWUID
#if HAVE_GETPWUID
#include <pwd.h>
#include <sys/types.h>
#endif
......@@ -456,7 +456,7 @@ void Session::run()
QStringList programs = {_program, QString::fromUtf8(qgetenv("SHELL")), QStringLiteral("/bin/sh")};
#ifdef HAVE_GETPWUID
#if HAVE_GETPWUID
auto pw = getpwuid(getuid());
// pw may be NULL
if (pw != nullptr) {
......@@ -925,7 +925,7 @@ void Session::sendText(const QString &text) const
return;
}
#if !defined(REMOVE_SENDTEXT_RUNCOMMAND_DBUS_METHODS)
#if !REMOVE_SENDTEXT_RUNCOMMAND_DBUS_METHODS
if (show_disallow_certain_dbus_methods_message) {
KNotification::event(KNotification::Warning,
QStringLiteral("Konsole D-Bus Warning"),
......
......@@ -534,7 +534,7 @@ public Q_SLOTS:
*/
void sendTextToTerminal(const QString &text, const QChar &eol = QChar()) const;
#if defined(REMOVE_SENDTEXT_RUNCOMMAND_DBUS_METHODS)
#if REMOVE_SENDTEXT_RUNCOMMAND_DBUS_METHODS
void sendText(const QString &text) const;
#else
Q_SCRIPTABLE void sendText(const QString &text) const;
......@@ -543,7 +543,7 @@ public Q_SLOTS:
/**
* Sends @p command to the current foreground terminal program.
*/
#if defined(REMOVE_SENDTEXT_RUNCOMMAND_DBUS_METHODS)
#if REMOVE_SENDTEXT_RUNCOMMAND_DBUS_METHODS
void runCommand(const QString &command) const;
#else
Q_SCRIPTABLE void runCommand(const QString &command) const;
......
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