Commit e7bbd6c1 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 3ec49ee8
Pipeline #199625 passed with stage
in 6 minutes and 15 seconds
#cmakedefine HAVE_QCA2 1
#cmakedefine HAVE_STROPTS_H 1
#cmakedefine01 HAVE_QCA2
#cmakedefine01 HAVE_STROPTS_H
#cmakedefine01 HAVE_X11
#cmakedefine01 HAVE_KGLOBALACCEL
......@@ -22,7 +22,7 @@ ConnectionBehavior_Config::ConnectionBehavior_Config(QWidget* parent)
{
setupUi(this);
#ifndef HAVE_QCA2
#if !HAVE_QCA2
kcfg_EncryptionType->setDisabled(true);
#endif
......
......@@ -20,7 +20,7 @@
# include <sys/socket.h>
# include <net/if.h>
# include <sys/ioctl.h>
# ifdef HAVE_STROPTS_H
# if HAVE_STROPTS_H
# include <stropts.h>
# endif
# include <arpa/inet.h>
......
......@@ -306,7 +306,7 @@ Channel::Channel(QWidget* parent, const QString& _name) : ChatWindow(parent)
updateAppearance();
#ifdef HAVE_QCA2
#if HAVE_QCA2
m_cipher = nullptr;
#endif
......@@ -363,7 +363,7 @@ void Channel::connectionStateChanged(Server* server, Konversation::ConnectionSta
void Channel::setEncryptedOutput(bool e)
{
#ifdef HAVE_QCA2
#if HAVE_QCA2
if (e)
{
cipherLabel->show();
......@@ -2740,7 +2740,7 @@ void Channel::nickActive(const QString& nickname) //FIXME reported to crash, can
}
}
#ifdef HAVE_QCA2
#if HAVE_QCA2
Konversation::Cipher* Channel::getCipher() const
{
if(!m_cipher)
......
......@@ -15,7 +15,7 @@
#include "chatwindow.h"
#include "channelnick.h"
#ifdef HAVE_QCA2
#if HAVE_QCA2
#include "cipher.h"
#endif
......@@ -76,7 +76,7 @@ class Channel : public ChatWindow
void append(const QString& nickname, const QString& message, const QHash<QString, QString> &messageTags = QHash<QString, QString>(), const QString& label = QString()) override;
void appendAction(const QString& nickname, const QString& message, const QHash<QString, QString> &messageTags = QHash<QString, QString>()) override;
void nickActive(const QString& nickname);
#ifdef HAVE_QCA2
#if HAVE_QCA2
Konversation::Cipher* getCipher() const;
#endif
......@@ -346,7 +346,7 @@ class Channel : public ChatWindow
int ops; ///< How many ops on the channel
Konversation::ChannelOptionsDialog *m_optionsDialog;
#ifdef HAVE_QCA2
#if HAVE_QCA2
mutable Konversation::Cipher *m_cipher;
#endif
......
......@@ -546,7 +546,7 @@ void InputFilter::parseClientCommand(const QString &prefix, const QString &comma
else
{
#ifdef HAVE_QCA2
#if HAVE_QCA2
//Key exchange
if (trailing.startsWith(QLatin1String("DH1080_INIT ")))
{
......@@ -563,7 +563,7 @@ void InputFilter::parseClientCommand(const QString &prefix, const QString &comma
#endif
m_server->appendMessageToFrontmost(i18n("Notice"), i18n("-%1- %2", sourceNick,
m_server->identifyMsg() ? trailing.mid(1) : trailing), messageTags);
#ifdef HAVE_QCA2
#if HAVE_QCA2
}
#endif
}
......
......@@ -23,7 +23,7 @@
#include "viewcontainer.h"
#include "outputfilterresolvejob.h"
#include "konversation_log.h"
#ifdef HAVE_QCA2
#if HAVE_QCA2
#include "cipher.h"
#endif
......@@ -1671,7 +1671,7 @@ namespace Konversation
OutputFilterResult OutputFilter::command_setkey(const OutputFilterInput& input)
{
#ifdef HAVE_QCA2
#if HAVE_QCA2
QStringList parms = input.parameter.split(QLatin1Char(' '), Qt::SkipEmptyParts);
if (parms.count() == 1 && !input.destination.isEmpty())
......@@ -1710,7 +1710,7 @@ namespace Konversation
OutputFilterResult OutputFilter::command_keyx(const OutputFilterInput& input)
{
#ifdef HAVE_QCA2
#if HAVE_QCA2
QStringList parms = input.parameter.split(QLatin1Char(' '), Qt::SkipEmptyParts);
if (parms.isEmpty() && !input.destination.isEmpty())
......
......@@ -89,7 +89,7 @@ Query::Query(QWidget* parent, const QString& _name) : ChatWindow(parent)
updateAppearance();
#ifdef HAVE_QCA2
#if HAVE_QCA2
m_cipher = nullptr;
#endif
}
......@@ -463,7 +463,7 @@ void Query::quitNick(const QString& reason, const QHash<QString, QString> &messa
}
}
#ifdef HAVE_QCA2
#if HAVE_QCA2
Konversation::Cipher* Query::getCipher() const
{
if(!m_cipher)
......
......@@ -13,7 +13,7 @@
#include <config-konversation.h>
#ifdef HAVE_QCA2
#if HAVE_QCA2
#include "cipher.h"
#endif
......@@ -65,7 +65,7 @@ class Query : public ChatWindow
*/
void quitNick(const QString& reason, const QHash<QString, QString> &messageTags);
#ifdef HAVE_QCA2
#if HAVE_QCA2
Konversation::Cipher* getCipher() const;
#endif
......@@ -110,7 +110,7 @@ class Query : public ChatWindow
bool m_initialShow;
#ifdef HAVE_QCA2
#if HAVE_QCA2
//FIXME: We might want to put this into the attendee object (i.e. NickInfo).
mutable Konversation::Cipher *m_cipher;
#endif
......
......@@ -1449,7 +1449,7 @@ void Server::incoming()
if (m_rawLog)
m_rawLog->appendRaw(RawLog::Inbound, first);
#ifdef HAVE_QCA2
#if HAVE_QCA2
QByteArray cKey = getKeyForRecipient(channelKey);
if(!cKey.isEmpty())
{
......@@ -1609,7 +1609,7 @@ int Server::_send_internal(QString outputLine)
if(codec)
encoded = codec->fromUnicode(outputLine);
#ifdef HAVE_QCA2
#if HAVE_QCA2
QByteArray cipherKey;
if (outputLineSplit.count() > 2 && outboundCommand > 1)
cipherKey = getKeyForRecipient(outputLineSplit.at(1));
......@@ -3552,7 +3552,7 @@ void Server::renameNick(const QString &nickname, const QString &newNick, const Q
}
// We had an encrypt conversation with the user that changed his nick, lets copy the key to the new nick and remove the old nick
#ifdef HAVE_QCA2
#if HAVE_QCA2
QByteArray userKey = getKeyForRecipient(nickname);
if (!userKey.isEmpty())
......@@ -4244,7 +4244,7 @@ void Server::updateEncoding()
getViewContainer()->updateViewEncoding(getViewContainer()->getFrontView());
}
#ifdef HAVE_QCA2
#if HAVE_QCA2
void Server::initKeyExchange(const QString &receiver)
{
Query* query;
......
......@@ -23,7 +23,7 @@
#include "invitedialog.h"
#include <config-konversation.h>
#ifdef HAVE_QCA2
#if HAVE_QCA2
#include "cipher.h"
#endif
......@@ -537,7 +537,7 @@ class Server : public QObject
/// Called when we received a PONG from the server
void pongReceived();
#ifdef HAVE_QCA2
#if HAVE_QCA2
void initKeyExchange(const QString &receiver);
void parseInitKeyX(const QString &sender, const QString &pubKey);
void parseFinishKeyX(const QString &sender, const QString &pubKey);
......
......@@ -5,7 +5,7 @@
*/
#include "topichistorymodel.h"
#ifdef HAVE_QCA2
#if HAVE_QCA2
#include "cipher.h"
#endif
......@@ -14,7 +14,7 @@
TopicHistoryModel::TopicHistoryModel(QObject* parent) : QAbstractListModel(parent)
{
#ifdef HAVE_QCA2
#if HAVE_QCA2
m_cipher = nullptr;
#endif
}
......@@ -90,7 +90,7 @@ void TopicHistoryModel::setCurrentTopicMetadata(const QString& author, const QDa
}
}
#ifdef HAVE_QCA2
#if HAVE_QCA2
void TopicHistoryModel::setCipher(Konversation::Cipher* cipher)
{
Q_EMIT layoutAboutToBeChanged();
......@@ -126,7 +126,7 @@ QVariant TopicHistoryModel::data(const QModelIndex& index, int role) const
switch (index.column())
{
case 0:
#ifdef HAVE_QCA2
#if HAVE_QCA2
if (m_cipher)
{
QByteArray cipherText = m_cipher->decryptTopic(topic.text.toUtf8());
......
......@@ -12,7 +12,7 @@
#include "channel.h"
#ifdef HAVE_QCA2
#if HAVE_QCA2
namespace Konversation
{
class Cipher;
......@@ -47,7 +47,7 @@ class TopicHistoryModel : public QAbstractListModel
void appendTopic(const QString& text, const QString& author = QString(), const QDateTime &timestamp = QDateTime::currentDateTime());
void setCurrentTopicMetadata(const QString& author, const QDateTime &timestamp = QDateTime::currentDateTime());
#ifdef HAVE_QCA2
#if HAVE_QCA2
void setCipher(Konversation::Cipher* cipher);
void clearCipher();
#endif
......@@ -67,7 +67,7 @@ class TopicHistoryModel : public QAbstractListModel
private:
QList<Topic> m_topicList;
#ifdef HAVE_QCA2
#if HAVE_QCA2
Konversation::Cipher* m_cipher;
#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