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

Use Q_REQUIRED_RESULT

parent b592a659
......@@ -42,7 +42,7 @@ public:
explicit CollectionExpiryPage(QWidget *parent = nullptr);
~CollectionExpiryPage() override;
bool canHandle(const Akonadi::Collection &col) const override;
Q_REQUIRED_RESULT bool canHandle(const Akonadi::Collection &col) const override;
void load(const Akonadi::Collection &collection) override;
void save(Akonadi::Collection &collection) override;
......
......@@ -29,7 +29,7 @@ class FilterActionMissingAccountDialog : public QDialog
public:
explicit FilterActionMissingAccountDialog(const QStringList &lstAccount, const QString &filtername, QWidget *parent = nullptr);
~FilterActionMissingAccountDialog();
QStringList selectedAccount() const;
Q_REQUIRED_RESULT QStringList selectedAccount() const;
static bool allAccountExist(const QStringList &lst);
private:
......
......@@ -41,7 +41,7 @@ public:
explicit FilterActionMissingFolderDialog(const Akonadi::Collection::List &list, const QString &filtername = QString(), const QString &argStr = QString(), QWidget *parent = nullptr);
~FilterActionMissingFolderDialog();
Akonadi::Collection selectedCollection() const;
Q_REQUIRED_RESULT Akonadi::Collection selectedCollection() const;
static Akonadi::Collection::List potentialCorrectFolders(const QString &path, bool &exactPath);
private:
......
......@@ -32,7 +32,7 @@ class FilterActionMissingIdentityDialog : public QDialog
public:
explicit FilterActionMissingIdentityDialog(const QString &filtername, QWidget *parent = nullptr);
~FilterActionMissingIdentityDialog();
int selectedIdentity() const;
Q_REQUIRED_RESULT int selectedIdentity() const;
private:
void writeConfig();
......
......@@ -29,7 +29,7 @@ class FilterActionMissingSoundUrlDialog : public QDialog
public:
explicit FilterActionMissingSoundUrlDialog(const QString &filtername, const QString &argStr, QWidget *parent = nullptr);
~FilterActionMissingSoundUrlDialog();
QString soundUrl() const;
Q_REQUIRED_RESULT QString soundUrl() const;
private:
void readConfig();
......
......@@ -29,7 +29,7 @@ class FilterActionMissingTagDialog : public QDialog
public:
explicit FilterActionMissingTagDialog(const QMap<QUrl, QString> &templateList, const QString &filtername, const QString &argsStr, QWidget *parent = nullptr);
~FilterActionMissingTagDialog();
QString selectedTag() const;
Q_REQUIRED_RESULT QString selectedTag() const;
private:
void slotAddTag();
......
......@@ -30,7 +30,7 @@ class FilterActionMissingTemplateDialog : public QDialog
public:
explicit FilterActionMissingTemplateDialog(const QStringList &templateList, const QString &filtername, QWidget *parent = nullptr);
~FilterActionMissingTemplateDialog();
QString selectedTemplate() const;
Q_REQUIRED_RESULT QString selectedTemplate() const;
private:
void readConfig();
......
......@@ -32,7 +32,7 @@ class FilterActionMissingTransportDialog : public QDialog
public:
explicit FilterActionMissingTransportDialog(const QString &filtername, QWidget *parent = nullptr);
~FilterActionMissingTransportDialog();
int selectedTransport() const;
Q_REQUIRED_RESULT int selectedTransport() const;
private:
void writeConfig();
......
......@@ -30,7 +30,7 @@ public:
explicit SelectThunderbirdFilterFilesDialog(const QString &defaultSettingPath, QWidget *parent);
~SelectThunderbirdFilterFilesDialog();
QStringList selectedFiles() const;
Q_REQUIRED_RESULT QStringList selectedFiles() const;
void setStartDir(const QUrl &);
......
......@@ -33,7 +33,7 @@ class SelectThunderbirdFilterFilesWidget : public QWidget
public:
explicit SelectThunderbirdFilterFilesWidget(const QString &defaultSettingPath, QWidget *parent = nullptr);
~SelectThunderbirdFilterFilesWidget();
QStringList selectedFiles() const;
Q_REQUIRED_RESULT QStringList selectedFiles() const;
void setStartDir(const QUrl &);
......
......@@ -82,17 +82,17 @@ public:
* Returns i18n'd label, ie. the one which is presented in
* the filter dialog.
*/
QString label() const;
Q_REQUIRED_RESULT QString label() const;
/**
* Returns identifier name, ie. the one under which it is
* known in the config.
*/
QString name() const;
Q_REQUIRED_RESULT QString name() const;
virtual QStringList sieveRequires() const;
Q_REQUIRED_RESULT virtual QStringList sieveRequires() const;
virtual QString sieveCode() const;
Q_REQUIRED_RESULT virtual QString sieveCode() const;
/**
* Execute action on given message (inside the item context).
......@@ -103,27 +103,27 @@ public:
* is required, @p GoOn if the message shall be processed by
* further filters and @p Ok otherwise.
*/
virtual ReturnCode process(ItemContext &context, bool applyOnOutbound) const = 0;
Q_REQUIRED_RESULT virtual ReturnCode process(ItemContext &context, bool applyOnOutbound) const = 0;
/**
* Returns the required part from the item that is needed for the action to
* operate. See @ref SearchRule::RequiredPart */
virtual SearchRule::RequiredPart requiredPart() const = 0;
Q_REQUIRED_RESULT virtual SearchRule::RequiredPart requiredPart() const = 0;
/**
* Determines whether this action is valid. But this is just a
* quick test. Eg., actions that have a mail address as parameter
* shouldn't try real address validation, but only check if the
* string representation is empty.
*/
virtual bool isEmpty() const;
Q_REQUIRED_RESULT virtual bool isEmpty() const;
virtual QString informationAboutNotValidAction() const;
Q_REQUIRED_RESULT virtual QString informationAboutNotValidAction() const;
/**
* Creates a widget for setting the filter action parameter. Also
* sets the value of the widget.
*/
virtual QWidget *createParamWidget(QWidget *parent) const;
Q_REQUIRED_RESULT virtual QWidget *createParamWidget(QWidget *parent) const;
/**
* The filter action shall set it's parameter from the widget's
......@@ -153,27 +153,27 @@ public:
* Read extra arguments from given string.
* Return true if we need to update config file
*/
virtual bool argsFromStringInteractive(const QString &argsStr, const QString &filterName);
Q_REQUIRED_RESULT virtual bool argsFromStringInteractive(const QString &argsStr, const QString &filterName);
virtual QString argsAsStringReal() const;
Q_REQUIRED_RESULT virtual QString argsAsStringReal() const;
/**
* Return extra arguments as string. Must not contain newlines.
*/
virtual QString argsAsString() const = 0;
Q_REQUIRED_RESULT virtual QString argsAsString() const = 0;
/**
* Returns a translated string describing this filter for visualization
* purposes, e.g. in the filter log.
*/
virtual QString displayString() const = 0;
Q_REQUIRED_RESULT virtual QString displayString() const = 0;
/**
* Called from the filter when a folder is removed. Tests if the
* folder @p aFolder is used and changes to @p aNewFolder in this
* case. Returns true if a change was made.
*/
virtual bool folderRemoved(const Akonadi::Collection &aFolder, const Akonadi::Collection &aNewFolder);
Q_REQUIRED_RESULT virtual bool folderRemoved(const Akonadi::Collection &aFolder, const Akonadi::Collection &aNewFolder);
/**
* Static function that creates a filter action of this type.
......
......@@ -40,18 +40,18 @@ public:
SearchRule::RequiredPart requiredPart() const override;
QString argsAsString() const override;
Q_REQUIRED_RESULT QString argsAsString() const override;
void argsFromString(const QString &argsStr) override;
QString displayString() const override;
Q_REQUIRED_RESULT QString displayString() const override;
static FilterAction *newAction();
QStringList sieveRequires() const override;
QString sieveCode() const override;
Q_REQUIRED_RESULT QStringList sieveRequires() const override;
Q_REQUIRED_RESULT QString sieveCode() const override;
bool isEmpty() const override;
QString informationAboutNotValidAction() const override;
Q_REQUIRED_RESULT QString informationAboutNotValidAction() const override;
private:
QString mValue;
};
......
......@@ -41,19 +41,19 @@ public:
static FilterAction *newAction();
bool isEmpty() const override;
Q_REQUIRED_RESULT bool isEmpty() const override;
void argsFromString(const QString &argsStr) override;
QString argsAsString() const override;
QString displayString() const override;
bool argsFromStringInteractive(const QString &argsStr, const QString &filterName) override;
Q_REQUIRED_RESULT QString argsAsString() const override;
Q_REQUIRED_RESULT QString displayString() const override;
Q_REQUIRED_RESULT bool argsFromStringInteractive(const QString &argsStr, const QString &filterName) override;
QWidget *createParamWidget(QWidget *parent) const override;
Q_REQUIRED_RESULT QWidget *createParamWidget(QWidget *parent) const override;
void applyParamWidgetValue(QWidget *paramWidget) override;
void setParamWidgetValue(QWidget *paramWidget) const override;
void clearParamWidget(QWidget *paramWidget) const override;
QString informationAboutNotValidAction() const override;
Q_REQUIRED_RESULT QString informationAboutNotValidAction() const override;
private Q_SLOTS:
void slotTagListingFinished();
......
......@@ -32,22 +32,22 @@ class FilterActionAddToAddressBook : public FilterActionWithStringList
Q_OBJECT
public:
explicit FilterActionAddToAddressBook(QObject *parent = nullptr);
ReturnCode process(ItemContext &context, bool applyOnOutbound) const override;
Q_REQUIRED_RESULT ReturnCode process(ItemContext &context, bool applyOnOutbound) const override;
static FilterAction *newAction();
SearchRule::RequiredPart requiredPart() const override;
bool isEmpty() const override;
Q_REQUIRED_RESULT bool isEmpty() const override;
QWidget *createParamWidget(QWidget *parent) const override;
Q_REQUIRED_RESULT QWidget *createParamWidget(QWidget *parent) const override;
void setParamWidgetValue(QWidget *paramWidget) const override;
void applyParamWidgetValue(QWidget *paramWidget) override;
void clearParamWidget(QWidget *paramWidget) const override;
QString argsAsString() const override;
Q_REQUIRED_RESULT QString argsAsString() const override;
void argsFromString(const QString &argsStr) override;
QString informationAboutNotValidAction() const override;
Q_REQUIRED_RESULT QString informationAboutNotValidAction() const override;
private:
enum HeaderType {
FromHeader,
......
......@@ -34,12 +34,12 @@ class FilterActionCopy : public FilterActionWithFolder
Q_OBJECT
public:
explicit FilterActionCopy(QObject *parent = nullptr);
ReturnCode process(ItemContext &context, bool applyOnOutbound) const override;
SearchRule::RequiredPart requiredPart() const override;
Q_REQUIRED_RESULT ReturnCode process(ItemContext &context, bool applyOnOutbound) const override;
Q_REQUIRED_RESULT SearchRule::RequiredPart requiredPart() const override;
static FilterAction *newAction();
QString sieveCode() const override;
QStringList sieveRequires() const override;
QString informationAboutNotValidAction() const override;
Q_REQUIRED_RESULT QString sieveCode() const override;
Q_REQUIRED_RESULT QStringList sieveRequires() const override;
Q_REQUIRED_RESULT QString informationAboutNotValidAction() const override;
protected Q_SLOTS:
void jobFinished(KJob *job);
......
......@@ -32,15 +32,15 @@ public:
static FilterAction *newAction();
QString displayString() const override;
Q_REQUIRED_RESULT QString displayString() const override;
QString argsAsString() const override;
Q_REQUIRED_RESULT QString argsAsString() const override;
void argsFromString(const QString &argsStr) override;
SearchRule::RequiredPart requiredPart() const override;
FilterAction::ReturnCode process(ItemContext &context, bool applyOnOutbound) const override;
Q_REQUIRED_RESULT SearchRule::RequiredPart requiredPart() const override;
Q_REQUIRED_RESULT FilterAction::ReturnCode process(ItemContext &context, bool applyOnOutbound) const override;
QWidget *createParamWidget(QWidget *parent) const override;
Q_REQUIRED_RESULT QWidget *createParamWidget(QWidget *parent) const override;
};
} // namespace MailCommon
......
......@@ -31,11 +31,11 @@ class FilterActionDelete : public FilterActionWithNone
Q_OBJECT
public:
explicit FilterActionDelete(QObject *parent = nullptr);
ReturnCode process(ItemContext &context, bool applyOnOutbound) const override;
SearchRule::RequiredPart requiredPart() const override;
Q_REQUIRED_RESULT ReturnCode process(ItemContext &context, bool applyOnOutbound) const override;
Q_REQUIRED_RESULT SearchRule::RequiredPart requiredPart() const override;
static FilterAction *newAction();
QWidget *createParamWidget(QWidget *parent) const override;
QString sieveCode() const override;
Q_REQUIRED_RESULT QWidget *createParamWidget(QWidget *parent) const override;
Q_REQUIRED_RESULT QString sieveCode() const override;
};
}
......
......@@ -36,25 +36,25 @@ public:
static FilterAction *newAction();
QString displayString() const override;
Q_REQUIRED_RESULT QString displayString() const override;
QString argsAsString() const override;
Q_REQUIRED_RESULT QString argsAsString() const override;
void argsFromString(const QString &argsStr) override;
SearchRule::RequiredPart requiredPart() const override;
FilterAction::ReturnCode process(ItemContext &context, bool applyOnOutbound) const override;
Q_REQUIRED_RESULT SearchRule::RequiredPart requiredPart() const override;
Q_REQUIRED_RESULT FilterAction::ReturnCode process(ItemContext &context, bool applyOnOutbound) const override;
bool isEmpty() const override;
Q_REQUIRED_RESULT bool isEmpty() const override;
QString informationAboutNotValidAction() const override;
Q_REQUIRED_RESULT QString informationAboutNotValidAction() const override;
QWidget *createParamWidget(QWidget *parent) const override;
Q_REQUIRED_RESULT QWidget *createParamWidget(QWidget *parent) const override;
void setParamWidgetValue(QWidget *paramWidget) const override;
void applyParamWidgetValue(QWidget *paramWidget) override;
GpgME::Key key() const;
Q_REQUIRED_RESULT GpgME::Key key() const;
bool reencrypt() const;
Q_REQUIRED_RESULT bool reencrypt() const;
private:
std::shared_ptr<const Kleo::KeyCache> mKeyCache;
......
......@@ -32,10 +32,10 @@ class FilterActionExec : public FilterActionWithCommand
Q_OBJECT
public:
explicit FilterActionExec(QObject *parent = nullptr);
ReturnCode process(ItemContext &context, bool applyOnOutbound) const override;
SearchRule::RequiredPart requiredPart() const override;
Q_REQUIRED_RESULT ReturnCode process(ItemContext &context, bool applyOnOutbound) const override;
Q_REQUIRED_RESULT SearchRule::RequiredPart requiredPart() const override;
static FilterAction *newAction();
QString informationAboutNotValidAction() const override;
Q_REQUIRED_RESULT QString informationAboutNotValidAction() const override;
};
}
......
......@@ -33,18 +33,18 @@ class FilterActionForward : public FilterActionWithAddress
public:
explicit FilterActionForward(QObject *parent = nullptr);
static FilterAction *newAction();
ReturnCode process(ItemContext &context, bool applyOnOutbound) const override;
SearchRule::RequiredPart requiredPart() const override;
QWidget *createParamWidget(QWidget *parent) const override;
Q_REQUIRED_RESULT ReturnCode process(ItemContext &context, bool applyOnOutbound) const override;
Q_REQUIRED_RESULT SearchRule::RequiredPart requiredPart() const override;
Q_REQUIRED_RESULT QWidget *createParamWidget(QWidget *parent) const override;
void applyParamWidgetValue(QWidget *paramWidget) override;
void setParamWidgetValue(QWidget *paramWidget) const override;
void clearParamWidget(QWidget *paramWidget) const override;
void argsFromString(const QString &argsStr) override;
QString argsAsString() const override;
QString displayString() const override;
bool argsFromStringInteractive(const QString &argsStr, const QString &filterName) override;
Q_REQUIRED_RESULT QString argsAsString() const override;
Q_REQUIRED_RESULT QString displayString() const override;
Q_REQUIRED_RESULT bool argsFromStringInteractive(const QString &argsStr, const QString &filterName) override;
QString informationAboutNotValidAction() const override;
Q_REQUIRED_RESULT QString informationAboutNotValidAction() const override;
private:
mutable QString mTemplate;
};
......
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