Commit 8e254b59 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Add missing Q_REQUIRED_RESULT

parent 93c374b5
......@@ -59,7 +59,7 @@ public:
* The candidates are ordered by priority, with the catch-call
* formatter coming last.
*/
QVector<const Interface::BodyPartFormatter *> formattersForType(const QString &mimeType) const;
Q_REQUIRED_RESULT QVector<const Interface::BodyPartFormatter *> formattersForType(const QString &mimeType) const;
protected:
void insert(const QString &mimeType, const Interface::BodyPartFormatter *formatter, int priority);
......
......@@ -41,9 +41,9 @@ public:
Block(const QByteArray &m, PGPBlockType t);
QByteArray text() const;
PGPBlockType type() const;
PGPBlockType determineType() const;
Q_REQUIRED_RESULT QByteArray text() const;
Q_REQUIRED_RESULT PGPBlockType type() const;
Q_REQUIRED_RESULT PGPBlockType determineType() const;
QByteArray msg;
PGPBlockType mType;
......
......@@ -80,11 +80,11 @@ public:
void setParentPart(MessagePart *parentPart);
MessagePart *parentPart() const;
virtual QString text() const;
virtual Q_REQUIRED_RESULT QString text() const;
void setText(const QString &text);
virtual QString plaintextContent() const;
virtual QString htmlContent() const;
virtual Q_REQUIRED_RESULT QString plaintextContent() const;
virtual Q_REQUIRED_RESULT QString htmlContent() const;
/** The KMime::Content* node that's represented by this part.
* Can be @c nullptr, e.g. for sub-parts of an inline signed body part.
......@@ -98,25 +98,25 @@ public:
*/
KMime::Content *attachmentContent() const;
void setAttachmentContent(KMime::Content *node);
bool isAttachment() const;
Q_REQUIRED_RESULT bool isAttachment() const;
/** @see KMime::Content::index() */
QString attachmentIndex() const;
Q_REQUIRED_RESULT QString attachmentIndex() const;
/** @see NodeHelper::asHREF */
QString attachmentLink() const;
Q_REQUIRED_RESULT QString attachmentLink() const;
/** Returns a string representation of an URL that can be used
* to invoke a BodyPartURLHandler for this body part.
*/
QString makeLink(const QString &path) const;
Q_REQUIRED_RESULT QString makeLink(const QString &path) const;
void setIsRoot(bool root);
bool isRoot() const;
Q_REQUIRED_RESULT bool isRoot() const;
virtual bool isHtml() const;
bool neverDisplayInline() const;
Q_REQUIRED_RESULT bool neverDisplayInline() const;
void setNeverDisplayInline(bool displayInline);
bool isImage() const;
Q_REQUIRED_RESULT bool isImage() const;
void setIsImage(bool image);
PartMetaData *partMetaData() const;
......@@ -129,13 +129,13 @@ public:
void appendSubPart(const MessagePart::Ptr &messagePart);
const QVector<MessagePart::Ptr> &subParts() const;
bool hasSubParts() const;
Q_REQUIRED_RESULT bool hasSubParts() const;
void clearSubParts();
Interface::ObjectTreeSource *source() const;
NodeHelper *nodeHelper() const;
virtual bool hasHeader(const char *header) const;
virtual Q_REQUIRED_RESULT bool hasHeader(const char *header) const;
virtual KMime::Headers::Base *header(const char *header) const;
protected:
......@@ -158,10 +158,10 @@ public:
MimeMessagePart(MimeTreeParser::ObjectTreeParser *otp, KMime::Content *node, bool onlyOneMimePart);
~MimeMessagePart() override;
QString text() const override;
Q_REQUIRED_RESULT QString text() const override;
QString plaintextContent() const override;
QString htmlContent() const override;
Q_REQUIRED_RESULT QString plaintextContent() const override;
Q_REQUIRED_RESULT QString htmlContent() const override;
private:
bool mOnlyOneMimePart;
};
......@@ -176,10 +176,10 @@ public:
explicit MessagePartList(MimeTreeParser::ObjectTreeParser *otp);
~MessagePartList() override;
QString text() const override;
Q_REQUIRED_RESULT QString text() const override;
QString plaintextContent() const override;
QString htmlContent() const override;
Q_REQUIRED_RESULT QString plaintextContent() const override;
Q_REQUIRED_RESULT QString htmlContent() const override;
};
enum IconType {
......@@ -206,18 +206,18 @@ public:
KMMsgSignatureState signatureState() const;
KMMsgEncryptionState encryptionState() const;
bool decryptMessage() const;
Q_REQUIRED_RESULT bool decryptMessage() const;
bool showLink() const;
bool isFirstTextPart() const;
bool hasLabel() const;
Q_REQUIRED_RESULT bool showLink() const;
Q_REQUIRED_RESULT bool isFirstTextPart() const;
Q_REQUIRED_RESULT bool hasLabel() const;
/** The attachment filename, or the closest approximation thereof we have. */
QString label() const;
Q_REQUIRED_RESULT QString label() const;
/** A description of this attachment, if provided. */
QString comment() const;
Q_REQUIRED_RESULT QString comment() const;
/** Temporary file containing the part content. */
QString temporaryFilePath() const;
Q_REQUIRED_RESULT QString temporaryFilePath() const;
private:
void parseContent();
......@@ -248,13 +248,13 @@ public:
HtmlMessagePart(MimeTreeParser::ObjectTreeParser *otp, KMime::Content *node, MimeTreeParser::Interface::ObjectTreeSource *source);
~HtmlMessagePart() override;
QString text() const override;
QString plaintextContent() const override;
Q_REQUIRED_RESULT QString text() const override;
Q_REQUIRED_RESULT QString plaintextContent() const override;
void fix() const override;
bool isHtml() const override;
Q_REQUIRED_RESULT bool isHtml() const override;
QString bodyHtml() const;
Q_REQUIRED_RESULT QString bodyHtml() const;
private:
Interface::ObjectTreeSource *mSource;
......@@ -272,17 +272,17 @@ public:
AlternativeMessagePart(MimeTreeParser::ObjectTreeParser *otp, KMime::Content *node, Util::HtmlMode preferredMode);
~AlternativeMessagePart() override;
QString text() const override;
Q_REQUIRED_RESULT QString text() const override;
Util::HtmlMode preferredMode() const;
Q_REQUIRED_RESULT Util::HtmlMode preferredMode() const;
void setPreferredMode(Util::HtmlMode preferredMode);
bool isHtml() const override;
Q_REQUIRED_RESULT bool isHtml() const override;
QString plaintextContent() const override;
QString htmlContent() const override;
Q_REQUIRED_RESULT QString plaintextContent() const override;
Q_REQUIRED_RESULT QString htmlContent() const override;
QList<Util::HtmlMode> availableModes();
Q_REQUIRED_RESULT QList<Util::HtmlMode> availableModes();
void fix() const override;
......@@ -305,7 +305,7 @@ public:
CertMessagePart(MimeTreeParser::ObjectTreeParser *otp, KMime::Content *node, const QGpgME::Protocol *cryptoProto, bool autoImport);
~CertMessagePart() override;
QString text() const override;
Q_REQUIRED_RESULT QString text() const override;
const GpgME::ImportResult &importResult() const;
......@@ -325,7 +325,7 @@ public:
EncapsulatedRfc822MessagePart(MimeTreeParser::ObjectTreeParser *otp, KMime::Content *node, const KMime::Message::Ptr &message);
~EncapsulatedRfc822MessagePart() override;
QString text() const override;
Q_REQUIRED_RESULT QString text() const override;
void fix() const override;
......@@ -350,43 +350,44 @@ public:
~EncryptedMessagePart() override;
QString text() const override;
Q_REQUIRED_RESULT QString text() const override;
void setDecryptMessage(bool decrypt);
bool decryptMessage() const;
Q_REQUIRED_RESULT bool decryptMessage() const;
void setIsEncrypted(bool encrypted);
bool isEncrypted() const;
Q_REQUIRED_RESULT bool isEncrypted() const;
bool isDecryptable() const;
Q_REQUIRED_RESULT bool isDecryptable() const;
bool isNoSecKey() const;
bool passphraseError() const;
Q_REQUIRED_RESULT bool isNoSecKey() const;
Q_REQUIRED_RESULT bool passphraseError() const;
void startDecryption(const QByteArray &text, const QTextCodec *aCodec);
void startDecryption(KMime::Content *data = nullptr);
void setMementoName(const QByteArray &name);
QByteArray mementoName() const;
Q_REQUIRED_RESULT QByteArray mementoName() const;
QByteArray mDecryptedData;
QString plaintextContent() const override;
QString htmlContent() const override;
Q_REQUIRED_RESULT QString plaintextContent() const override;
Q_REQUIRED_RESULT QString htmlContent() const override;
const QGpgME::Protocol *cryptoProto() const;
QString fromAddress() const;
Q_REQUIRED_RESULT QString fromAddress() const;
const std::vector<std::pair<GpgME::DecryptionResult::Recipient, GpgME::Key> > &decryptRecipients() const;
bool hasHeader(const char *header) const override;
Q_REQUIRED_RESULT bool hasHeader(const char *header) const override;
KMime::Headers::Base *header(const char *header) const override;
QByteArray mDecryptedData;
private:
/** Handles the decryption of a given content
* returns true if the decryption was successful
* if used in async mode, check if mMetaData.inPogress is true, it initiates a running decryption process.
*/
bool okDecryptMIME(KMime::Content &data);
Q_REQUIRED_RESULT bool okDecryptMIME(KMime::Content &data);
protected:
bool mPassphraseError;
......@@ -414,24 +415,24 @@ public:
~SignedMessagePart() override;
void setIsSigned(bool isSigned);
bool isSigned() const;
Q_REQUIRED_RESULT bool isSigned() const;
void startVerification(const QByteArray &text, const QTextCodec *aCodec);
void startVerificationDetached(const QByteArray &text, KMime::Content *textNode, const QByteArray &signature);
void setMementoName(const QByteArray &name);
QByteArray mementoName() const;
Q_REQUIRED_RESULT QByteArray mementoName() const;
QByteArray mDecryptedData;
std::vector<GpgME::Signature> mSignatures;
QString plaintextContent() const override;
QString htmlContent() const override;
Q_REQUIRED_RESULT QString plaintextContent() const override;
Q_REQUIRED_RESULT QString htmlContent() const override;
const QGpgME::Protocol *cryptoProto() const;
QString fromAddress() const;
Q_REQUIRED_RESULT QString fromAddress() const;
bool hasHeader(const char *header) const override;
Q_REQUIRED_RESULT bool hasHeader(const char *header) const override;
KMime::Headers::Base *header(const char *header) const override;
private:
/** Handles the verification of data
......@@ -439,7 +440,7 @@ private:
* Returns true if the verification was successful and the block is signed.
* If used in async mode, check if mMetaData.inProgress is true, it initiates a running verification process.
*/
bool okVerify(const QByteArray &data, const QByteArray &signature, KMime::Content *textNode);
Q_REQUIRED_RESULT bool okVerify(const QByteArray &data, const QByteArray &signature, KMime::Content *textNode);
void sigStatusToMetaData();
......
......@@ -59,21 +59,21 @@ public:
void setNodeProcessed(KMime::Content *node, bool recurse);
void setNodeUnprocessed(KMime::Content *node, bool recurse);
bool nodeProcessed(KMime::Content *node) const;
Q_REQUIRED_RESULT bool nodeProcessed(KMime::Content *node) const;
void clear();
void forceCleanTempFiles();
void setEncryptionState(const KMime::Content *node, const KMMsgEncryptionState state);
KMMsgEncryptionState encryptionState(const KMime::Content *node) const;
Q_REQUIRED_RESULT KMMsgEncryptionState encryptionState(const KMime::Content *node) const;
void setSignatureState(const KMime::Content *node, const KMMsgSignatureState state);
KMMsgSignatureState signatureState(const KMime::Content *node) const;
Q_REQUIRED_RESULT KMMsgSignatureState signatureState(const KMime::Content *node) const;
KMMsgSignatureState overallSignatureState(KMime::Content *node) const;
KMMsgEncryptionState overallEncryptionState(KMime::Content *node) const;
Q_REQUIRED_RESULT KMMsgSignatureState overallSignatureState(KMime::Content *node) const;
Q_REQUIRED_RESULT KMMsgEncryptionState overallEncryptionState(KMime::Content *node) const;
void setPartMetaData(KMime::Content *node, const PartMetaData &metaData);
PartMetaData partMetaData(KMime::Content *node);
Q_REQUIRED_RESULT PartMetaData partMetaData(KMime::Content *node);
/**
* Set the 'Content-Type' by mime-magic from the contents of the body.
......@@ -84,10 +84,10 @@ public:
void clearOverrideHeaders();
void registerOverrideHeader(KMime::Content *message, MessagePartPtr);
bool hasMailHeader(const char *header, const KMime::Content *message) const;
Q_REQUIRED_RESULT bool hasMailHeader(const char *header, const KMime::Content *message) const;
KMime::Headers::Base const *mailHeaderAsBase(const char *header, const KMime::Content *message) const;
KMime::Headers::Generics::AddressList const *mailHeaderAsAddressList(const char *header, const KMime::Content *message) const;
QDateTime dateHeader(KMime::Content *message) const;
Q_REQUIRED_RESULT QDateTime dateHeader(KMime::Content *message) const;
/** Attach an extra node to an existing node */
void attachExtraContent(KMime::Content *topLevelNode, KMime::Content *content);
......@@ -95,7 +95,7 @@ public:
void cleanExtraContent(KMime::Content *topLevelNode);
/** Get the extra nodes attached to the @param topLevelNode and all sub-nodes of @param topLevelNode */
QVector<KMime::Content *> extraContents(KMime::Content *topLevelNode) const;
Q_REQUIRED_RESULT QVector<KMime::Content *> extraContents(KMime::Content *topLevelNode) const;
/** Return a modified message (node tree) starting from @param topLevelNode that has the original nodes and the extra nodes.
The caller has the responsibility to delete the new message.
......@@ -114,33 +114,33 @@ public:
// A flag to remember if the node was embedded. This is useful for attachment nodes, the reader
// needs to know if they were displayed inline or not.
bool isNodeDisplayedEmbedded(KMime::Content *node) const;
Q_REQUIRED_RESULT bool isNodeDisplayedEmbedded(KMime::Content *node) const;
void setNodeDisplayedEmbedded(KMime::Content *node, bool displayedEmbedded);
// Same as above, but this time determines if the node was hidden or not
bool isNodeDisplayedHidden(KMime::Content *node) const;
Q_REQUIRED_RESULT bool isNodeDisplayedHidden(KMime::Content *node) const;
void setNodeDisplayedHidden(KMime::Content *node, bool displayedHidden);
/**
* Writes the given message part to a temporary file and returns the
* name of this file or QString() if writing failed.
*/
QString writeNodeToTempFile(KMime::Content *node);
Q_REQUIRED_RESULT QString writeNodeToTempFile(KMime::Content *node);
QString writeFileToTempFile(KMime::Content *node, const QString &filename);
Q_REQUIRED_RESULT QString writeFileToTempFile(KMime::Content *node, const QString &filename);
/**
* Returns the temporary file path and name where this node was saved, or an empty url
* if it wasn't saved yet with writeNodeToTempFile()
*/
QUrl tempFileUrlFromNode(const KMime::Content *node);
Q_REQUIRED_RESULT QUrl tempFileUrlFromNode(const KMime::Content *node);
/**
* Creates a temporary dir for saving attachments, etc.
* Will be automatically deleted when another message is viewed.
* @param param Optional part of the directory name.
*/
QString createTempDir(const QString &param = QString());
Q_REQUIRED_RESULT QString createTempDir(const QString &param = QString());
/**
* Cleanup the attachment temp files
......@@ -154,19 +154,19 @@ public:
// Get a href in the form attachment:<nodeId>?place=<place>, used by ObjectTreeParser and
// UrlHandlerManager.
QString asHREF(const KMime::Content *node, const QString &place) const;
Q_REQUIRED_RESULT QString asHREF(const KMime::Content *node, const QString &place) const;
KMime::Content *fromHREF(const KMime::Message::Ptr &mMessage, const QUrl &href) const;
/**
* @return true if this node is a child or an encapsulated message
*/
static bool isInEncapsulatedMessage(KMime::Content *node);
Q_REQUIRED_RESULT static bool isInEncapsulatedMessage(KMime::Content *node);
/**
* Returns the charset for the given node. If no charset is specified
* for the node, the defaultCharset() is returned.
*/
static QByteArray charset(KMime::Content *node);
Q_REQUIRED_RESULT static QByteArray charset(KMime::Content *node);
/**
* Return a QTextCodec for the specified charset.
......@@ -179,14 +179,14 @@ public:
* content disposition header, or if that one is empty, the name from the
* content type header.
*/
static QString fileName(const KMime::Content *node);
Q_REQUIRED_RESULT static QString fileName(const KMime::Content *node);
/**
* Fixes an encoding received by a KDE function and returns the proper,
* MIME-compliant encoding name instead.
* @see encodingForName
*/
static QString fixEncoding(const QString &encoding); //TODO(Andras) move to a utility class?
Q_REQUIRED_RESULT static QString fixEncoding(const QString &encoding); //TODO(Andras) move to a utility class?
/**
* Drop-in replacement for KCharsets::encodingForName(). The problem with
......@@ -194,15 +194,15 @@ public:
* like "ISO 8859-15" instead of valid encoding names like "ISO-8859-15".
* This function fixes this by replacing whitespace with a hyphen.
*/
static QString encodingForName(const QString &descriptiveName); //TODO(Andras) move to a utility class?
Q_REQUIRED_RESULT static QString encodingForName(const QString &descriptiveName); //TODO(Andras) move to a utility class?
/**
* Return a list of the supported encodings
* @param usAscii if true, US-Ascii encoding will be prepended to the list.
*/
static QStringList supportedEncodings(bool usAscii); //TODO(Andras) move to a utility class?
static Q_REQUIRED_RESULT QStringList supportedEncodings(bool usAscii); //TODO(Andras) move to a utility class?
QString fromAsString(KMime::Content *node) const;
Q_REQUIRED_RESULT QString fromAsString(KMime::Content *node) const;
KMime::Content *decryptedNodeForContent(KMime::Content *content) const;
......@@ -245,7 +245,7 @@ private:
Used internally for robust indexing.
**/
QString persistentIndex(const KMime::Content *node) const;
Q_REQUIRED_RESULT QString persistentIndex(const KMime::Content *node) const;
/** Translates the persistentIndex into a node back
......
......@@ -71,13 +71,13 @@ public:
{
}
KMMsgSignatureState inlineSignatureState() const;
Q_REQUIRED_RESULT KMMsgSignatureState inlineSignatureState() const;
void setInlineSignatureState(KMMsgSignatureState state);
KMMsgEncryptionState inlineEncryptionState() const;
Q_REQUIRED_RESULT KMMsgEncryptionState inlineEncryptionState() const;
void setInlineEncryptionState(KMMsgEncryptionState state);
bool neverDisplayInline() const;
Q_REQUIRED_RESULT bool neverDisplayInline() const;
void setNeverDisplayInline(bool display);
void adjustCryptoStatesOfNode(const KMime::Content *node) const;
......
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