Commit e8a8ff65 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Add missing some Q_REQUIRED_RESULT + const'ify pointer

parent e10fc279
Pipeline #49857 canceled with stage
......@@ -20,10 +20,6 @@
using namespace MessageCore;
AutocryptRecipientPrivate::AutocryptRecipientPrivate()
: count_have_ach(0)
, count_no_ach(0)
, prefer_encrypt(false)
, changed(false)
{
}
......
/*
SPDX-FileCopyrightText: 2020 Sandro Knauß <knauss@kde.org>
SPDX-FileCopyrightText: 2020 Sandro Knauß <knauss@kde.org>
SPDX-License-Identifier: LGPL-2.0-or-later
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#ifndef AUTOCRYPTRECIPIENT_H
......@@ -29,30 +29,30 @@ public:
void updateFromMessage(const HeaderMixupNodeHelper &mixup, const KMime::Headers::Base *header);
void updateFromGossip(const HeaderMixupNodeHelper &mixup, const KMime::Headers::Base *header);
QByteArray toJson(QJsonDocument::JsonFormat format) const;
Q_REQUIRED_RESULT QByteArray toJson(QJsonDocument::JsonFormat format) const;
void fromJson(const QByteArray &json);
bool hasChanged() const;
Q_REQUIRED_RESULT bool hasChanged() const;
void setChangedFlag(bool changed);
QByteArray addr() const;
QByteArray bad_user_agent() const;
Q_REQUIRED_RESULT QByteArray addr() const;
Q_REQUIRED_RESULT QByteArray bad_user_agent() const;
QDateTime last_seen() const;
QDateTime autocrypt_timestamp() const;
QDateTime counting_since() const;
QDateTime gossip_timestamp() const;
Q_REQUIRED_RESULT QDateTime last_seen() const;
Q_REQUIRED_RESULT QDateTime autocrypt_timestamp() const;
Q_REQUIRED_RESULT QDateTime counting_since() const;
Q_REQUIRED_RESULT QDateTime gossip_timestamp() const;
int count_have_ach() const;
int count_no_ach() const;
Q_REQUIRED_RESULT int count_have_ach() const;
Q_REQUIRED_RESULT int count_no_ach() const;
bool prefer_encrypt() const;
Q_REQUIRED_RESULT bool prefer_encrypt() const;
GpgME::Key gpgKey() const;
QByteArray gpgKeydata() const;
Q_REQUIRED_RESULT GpgME::Key gpgKey() const;
Q_REQUIRED_RESULT QByteArray gpgKeydata() const;
GpgME::Key gossipKey() const;
QByteArray gossipKeydata() const;
Q_REQUIRED_RESULT GpgME::Key gossipKey() const;
Q_REQUIRED_RESULT QByteArray gossipKeydata() const;
private:
std::unique_ptr<AutocryptRecipientPrivate> d_ptr;
......
......@@ -15,7 +15,7 @@ class AutocryptRecipientPrivate
{
public:
AutocryptRecipientPrivate();
QByteArray toJson(QJsonDocument::JsonFormat format) const;
Q_REQUIRED_RESULT QByteArray toJson(QJsonDocument::JsonFormat format) const;
void fromJson(const QByteArray &json);
public:
......@@ -27,10 +27,10 @@ public:
QDateTime autocrypt_timestamp;
QDateTime counting_since;
QDateTime gossip_timestamp;
int count_have_ach;
int count_no_ach;
bool prefer_encrypt;
bool changed;
int count_have_ach = 0;
int count_no_ach = 0;
bool prefer_encrypt = false;
bool changed = false;
};
}
......
......@@ -20,38 +20,38 @@ using namespace MessageCore;
HeaderMixupNodeHelper::HeaderMixupNodeHelper(MimeTreeParser::NodeHelper *n, KMime::Content *m)
: message(m)
, nodeHelper(n)
, mNodeHelper(n)
{
}
QDateTime HeaderMixupNodeHelper::dateHeader() const
{
return nodeHelper->dateHeader(message);
return mNodeHelper->dateHeader(message);
}
bool HeaderMixupNodeHelper::hasMailHeader(const char *header) const
{
return nodeHelper->hasMailHeader(header, message);
return mNodeHelper->hasMailHeader(header, message);
}
QSharedPointer<KMime::Headers::Generics::AddressList> HeaderMixupNodeHelper::mailHeaderAsAddressList(const char *header) const
{
return nodeHelper->mailHeaderAsAddressList(header, message);
return mNodeHelper->mailHeaderAsAddressList(header, message);
}
const KMime::Headers::Base *HeaderMixupNodeHelper::mailHeaderAsBase(const char *header) const
{
return nodeHelper->mailHeaderAsBase(header, message);
return mNodeHelper->mailHeaderAsBase(header, message);
}
QVector<MimeTreeParser::MessagePart::Ptr> HeaderMixupNodeHelper::messagePartsOfMailHeader(const char *header) const
{
return nodeHelper->messagePartsOfMailHeader(header, message);
return mNodeHelper->messagePartsOfMailHeader(header, message);
}
QVector<KMime::Headers::Base *> HeaderMixupNodeHelper::headers(const char *header) const
{
return nodeHelper->headers(header, message);
return mNodeHelper->headers(header, message);
}
QHash<QByteArray, QByteArray> MessageCore::paramsFromAutocryptHeader(const KMime::Headers::Base *const header)
......
......@@ -30,13 +30,13 @@ public:
Q_REQUIRED_RESULT QVector<KMime::Headers::Base *> headers(const char *headerType) const;
public:
KMime::Content *message;
KMime::Content *message = nullptr;
private:
MimeTreeParser::NodeHelper *nodeHelper;
MimeTreeParser::NodeHelper *const mNodeHelper;
};
QHash<QByteArray, QByteArray> MESSAGECORE_EXPORT paramsFromAutocryptHeader(const KMime::Headers::Base *const header);
Q_REQUIRED_RESULT QHash<QByteArray, QByteArray> MESSAGECORE_EXPORT paramsFromAutocryptHeader(const KMime::Headers::Base *const header);
void MESSAGECORE_EXPORT processAutocryptfromMail(const HeaderMixupNodeHelper &mixup);
}
......
Markdown is supported
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