Commit 9b2b5115 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.

Also remove WITH_3RDPARTY_OPTIONAL, unused.
parent 65a1541e
Pipeline #188810 passed with stage
in 11 minutes and 45 seconds
#cmakedefine HAVE_UNISTD_H 1
#cmakedefine HAVE_MALLOC_TRIM 1
#cmakedefine01 HAVE_UNISTD_H
#cmakedefine01 HAVE_MALLOC_TRIM
#cmakedefine01 WITH_ACCOUNTS
#define AKONADI_DATABASE_BACKEND "@AKONADI_DATABASE_BACKEND@"
#cmakedefine WITH_3RDPARTY_OPTIONAL 1
#cmakedefine WITH_ACCOUNTS 1
......@@ -13,7 +13,7 @@
#include <QDBusConnection>
#include <QTimer>
#ifdef WITH_ACCOUNTS
#if WITH_ACCOUNTS
#include <Accounts/Account>
#include <Accounts/Manager>
#include <KAccounts/Core>
......@@ -25,7 +25,7 @@ using namespace std::chrono_literals;
AccountsIntegration::AccountsIntegration()
{
#ifdef WITH_ACCOUNTS
#if WITH_ACCOUNTS
QDBusConnection::sessionBus().registerObject(QStringLiteral("/Accounts"), this);
new Akonadi__AccountsAdaptor(this);
#endif
......@@ -33,7 +33,7 @@ AccountsIntegration::AccountsIntegration()
bool AccountsIntegration::isEnabled() const
{
#ifdef WITH_ACCOUNTS
#if WITH_ACCOUNTS
return true;
#else
return false;
......@@ -62,7 +62,7 @@ void AccountsIntegration::setAccountId(quint32 accountId)
std::optional<QString> AccountsIntegration::accountName() const
{
#ifdef WITH_ACCOUNTS
#if WITH_ACCOUNTS
if (!mAccountId.has_value()) {
return std::nullopt;
}
......@@ -80,7 +80,7 @@ std::optional<QString> AccountsIntegration::accountName() const
void AccountsIntegration::requestAuthData(const QString &serviceType, AuthDataCallback &&callback, ErrorCallback &&errCallback)
{
#ifdef WITH_ACCOUNTS
#if WITH_ACCOUNTS
if (!mAccountId.has_value()) {
QTimer::singleShot(0s, this, [error = std::move(errCallback)]() {
error(i18n("There is currently no account configured."));
......
......@@ -11,7 +11,7 @@
#include "controlmanager.h"
#include "processcontrol.h"
#ifdef WITH_ACCOUNTS
#if WITH_ACCOUNTS
#include "accountsintegration.h"
#endif
......@@ -27,7 +27,7 @@
#include <KCrash>
#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
......@@ -66,7 +66,7 @@ int main(int argc, char **argv)
ControlManager controlManager;
AgentManager agentManager(app.commandLineArguments().isSet(QStringLiteral("verbose")));
#ifdef WITH_ACCOUNTS
#if WITH_ACCOUNTS
AccountsIntegration accountsIntegration(agentManager);
#endif
KCrash::setEmergencySaveFunction(crashHandler);
......
......@@ -6,7 +6,7 @@
#include <config-akonadi.h>
#ifdef HAVE_MALLOC_TRIM
#if HAVE_MALLOC_TRIM
#include <QCoreApplication>
#include <QThread>
......
......@@ -21,7 +21,7 @@
#include <QStandardPaths>
#include <config-akonadi.h>
#ifdef HAVE_UNISTD_H
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <chrono>
......
......@@ -19,7 +19,7 @@
#include <private/standarddirs_p.h>
#include <config-akonadi.h>
#ifdef HAVE_UNISTD_H
#if HAVE_UNISTD_H
#include <unistd.h>
#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