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

Use Q_REQUIRED_RESULT

parent 7243f4ba
......@@ -30,12 +30,12 @@ class MAILIMPORTER_EXPORT FilterImporterBase
public:
explicit FilterImporterBase(MailImporter::FilterInfo *info);
virtual ~FilterImporterBase();
virtual bool importMessage(const QString &folderName, const QString &msgPath, bool duplicateCheck, const MailImporter::MessageStatus &status);
virtual bool importMessage(const KArchiveFile *file, const QString &folderPath, int &nbTotal, int &fileDone);
Q_REQUIRED_RESULT virtual bool importMessage(const QString &folderName, const QString &msgPath, bool duplicateCheck, const MailImporter::MessageStatus &status);
Q_REQUIRED_RESULT virtual bool importMessage(const KArchiveFile *file, const QString &folderPath, int &nbTotal, int &fileDone);
virtual void clear();
virtual void clearCountDuplicate();
virtual int countDuplicates() const;
virtual QString topLevelFolder() const;
Q_REQUIRED_RESULT virtual int countDuplicates() const;
Q_REQUIRED_RESULT virtual QString topLevelFolder() const;
protected:
MailImporter::FilterInfo *mInfo = nullptr;
};
......
......@@ -45,12 +45,12 @@ public:
void alert(const QString &message);
static void terminateASAP();
bool shouldTerminate() const;
QString rootCollectionName() const;
Q_REQUIRED_RESULT bool shouldTerminate() const;
Q_REQUIRED_RESULT QString rootCollectionName() const;
QWidget *parentWidget() const;
void setRemoveDupMessage(bool removeDupMessage);
bool removeDupMessage() const;
Q_REQUIRED_RESULT bool removeDupMessage() const;
private:
class Private;
......
......@@ -39,9 +39,9 @@ public:
virtual ~Filter();
virtual void import() = 0;
QString author() const;
QString name() const;
QString info() const;
Q_REQUIRED_RESULT QString author() const;
Q_REQUIRED_RESULT QString name() const;
Q_REQUIRED_RESULT QString info() const;
void setAuthor(const QString &);
void setName(const QString &);
......@@ -56,10 +56,10 @@ public:
MailImporter::FilterImporterBase *filterImporter() const;
void clearCountDuplicate();
int countDuplicates() const;
Q_REQUIRED_RESULT int countDuplicates() const;
void setMailDir(const QString &mailDir);
QString mailDir() const;
Q_REQUIRED_RESULT QString mailDir() const;
protected:
static int countDirectory(const QDir &dir, bool searchHiddenDirectory);
......
......@@ -29,8 +29,8 @@ public:
void import() override;
void importMails(const QString &maildir);
static QString defaultSettingsPath();
static QString isMailerFound();
Q_REQUIRED_RESULT static QString defaultSettingsPath();
Q_REQUIRED_RESULT static QString isMailerFound();
QString localMailDirPath();
private:
void importDirContents(const QString &);
......
......@@ -32,14 +32,14 @@ public:
FilterClawsMail();
~FilterClawsMail() override;
static QString defaultSettingsPath();
static QString isMailerFound();
Q_REQUIRED_RESULT static QString defaultSettingsPath();
Q_REQUIRED_RESULT static QString isMailerFound();
/* return local mail dir from folderlist.xml*/
QString localMailDirPath() override;
bool excludeFile(const QString &file) override;
QString defaultInstallFolder() const override;
QString markFile() const override;
Q_REQUIRED_RESULT QString localMailDirPath() override;
Q_REQUIRED_RESULT bool excludeFile(const QString &file) override;
Q_REQUIRED_RESULT QString defaultInstallFolder() const override;
Q_REQUIRED_RESULT QString markFile() const override;
};
}
......
......@@ -35,8 +35,8 @@ public:
void import() override;
void importMails(const QString &maildir);
static QString defaultSettingsPath();
static QString isMailerFound();
Q_REQUIRED_RESULT static QString defaultSettingsPath();
Q_REQUIRED_RESULT static QString isMailerFound();
private:
void importDirContents(const QString &, const QString &, const QString &);
void importMBox(const QString &, const QString &, const QString &);
......
......@@ -33,13 +33,13 @@ public:
void import() override;
void importMails(const QString &maildir);
static QString defaultSettingsPath();
static QString isMailerFound();
Q_REQUIRED_RESULT static QString defaultSettingsPath();
Q_REQUIRED_RESULT static QString isMailerFound();
private:
void importDirContents(const QString &, const QString &, const QString &);
void importMBox(const QString &, const QString &, const QString &);
bool excludeFiles(const QString &file);
Q_REQUIRED_RESULT bool excludeFiles(const QString &file);
};
}
......
......@@ -29,8 +29,8 @@ public:
void import() override;
void importMails(const QString &maildir);
static QString defaultSettingsPath();
static QString isMailerFound();
Q_REQUIRED_RESULT static QString defaultSettingsPath();
Q_REQUIRED_RESULT static QString isMailerFound();
private:
void importDirContents(const QString &);
......
......@@ -26,11 +26,11 @@ public:
FilterIcedove();
~FilterIcedove() override;
static QString defaultSettingsPath();
static QString isMailerFound();
Q_REQUIRED_RESULT static QString defaultSettingsPath();
Q_REQUIRED_RESULT static QString isMailerFound();
protected:
QString defaultInstallFolder() const override;
QString settingsPath() override;
Q_REQUIRED_RESULT QString defaultInstallFolder() const override;
Q_REQUIRED_RESULT QString settingsPath() override;
};
}
......
......@@ -36,9 +36,9 @@ public:
void importMails(const QString &archiveFile);
private:
bool importDirectory(const KArchiveDirectory *directory, const QString &folderPath);
bool importFolder(const KArchiveDirectory *folder, const QString &folderPath);
bool importMessage(const KArchiveFile *file, const QString &folderPath);
Q_REQUIRED_RESULT bool importDirectory(const KArchiveDirectory *directory, const QString &folderPath);
Q_REQUIRED_RESULT bool importFolder(const KArchiveDirectory *folder, const QString &folderPath);
Q_REQUIRED_RESULT bool importMessage(const KArchiveFile *file, const QString &folderPath);
int countFiles(const KArchiveDirectory *directory) const;
FilterKMailArchivePrivate *const d;
......
......@@ -46,8 +46,8 @@ private:
void dbxReadEmail(QDataStream &ds, int filePos);
/** helperfunctions for folder structure support */
QString parseFolderOEString(QDataStream &ds, int filePos);
QString getFolderName(const QString &filename);
Q_REQUIRED_RESULT QString parseFolderOEString(QDataStream &ds, int filePos);
Q_REQUIRED_RESULT QString getFolderName(const QString &filename);
/** which file (of totalFiles) is now in the work? */
int currentFile;
......
......@@ -33,8 +33,8 @@ public:
void import() override;
void importMails(const QString &maildir);
static QString defaultSettingsPath();
static QString isMailerFound();
Q_REQUIRED_RESULT static QString defaultSettingsPath();
Q_REQUIRED_RESULT static QString isMailerFound();
private:
void importBox(const QDir &importDir, const QStringList &, const QString &accountName = QString());
......
......@@ -26,10 +26,10 @@ public:
FilterSeaMonkey();
~FilterSeaMonkey() override;
static QString defaultSettingsPath();
Q_REQUIRED_RESULT static QString defaultSettingsPath();
protected:
QString defaultInstallFolder() const override;
QString settingsPath() override;
Q_REQUIRED_RESULT QString defaultInstallFolder() const override;
Q_REQUIRED_RESULT QString settingsPath() override;
};
}
......
......@@ -34,15 +34,15 @@ public:
FilterSylpheed();
~FilterSylpheed() override;
static QString defaultSettingsPath();
static QString isMailerFound();
Q_REQUIRED_RESULT static QString defaultSettingsPath();
Q_REQUIRED_RESULT static QString isMailerFound();
void import() override;
virtual void importMails(const QString &maildir);
/* return local mail dir from folderlist.xml*/
virtual QString localMailDirPath();
virtual bool excludeFile(const QString &file);
Q_REQUIRED_RESULT virtual bool excludeFile(const QString &file);
virtual QString defaultInstallFolder() const;
virtual QString markFile() const;
private:
......
......@@ -35,19 +35,19 @@ public:
void import() override;
void importMails(const QString &maildir);
static QString defaultSettingsPath();
static QString defaultProfile(const QString &defaultSettingPath, QWidget *parent = nullptr);
static QMap<QString, QString> listProfile(QString &currentProfile, const QString &defaultSettingPath);
Q_REQUIRED_RESULT static QString defaultSettingsPath();
Q_REQUIRED_RESULT static QString defaultProfile(const QString &defaultSettingPath, QWidget *parent = nullptr);
Q_REQUIRED_RESULT static QMap<QString, QString> listProfile(QString &currentProfile, const QString &defaultSettingPath);
static QString isMailerFound();
Q_REQUIRED_RESULT static QString isMailerFound();
protected:
virtual QString defaultInstallFolder() const;
virtual QString settingsPath();
Q_REQUIRED_RESULT virtual QString defaultInstallFolder() const;
Q_REQUIRED_RESULT virtual QString settingsPath();
private:
void importDirContents(const QString &, const QString &, const QString &);
void importMBox(const QString &, const QString &, const QString &);
bool excludeFiles(const QString &file);
Q_REQUIRED_RESULT bool excludeFiles(const QString &file);
};
}
......
......@@ -19,6 +19,7 @@
#define MESSAGESTATUS_H
#include "mailimporter_export.h"
#include <QtGlobal>
namespace MailImporter {
class MAILIMPORTER_EXPORT MessageStatus
......@@ -28,16 +29,16 @@ public:
~MessageStatus();
void setRead(bool state);
bool isRead() const;
Q_REQUIRED_RESULT bool isRead() const;
void setDeleted(bool state);
bool isDeleted() const;
Q_REQUIRED_RESULT bool isDeleted() const;
void setReplied(bool state);
bool isReplied() const;
Q_REQUIRED_RESULT bool isReplied() const;
void setForwarded(bool state);
bool isForwarded() const;
Q_REQUIRED_RESULT bool isForwarded() const;
private:
bool mRead = false;
bool mDeleted = false;
......
......@@ -23,10 +23,10 @@
namespace MailImporter {
namespace OtherMailerUtil {
MAILIMPORTER_EXPORT QString trojitaDefaultPath();
MAILIMPORTER_EXPORT QString gearyDefaultPath();
MAILIMPORTER_EXPORT QStringList isMailerFound();
MAILIMPORTER_EXPORT QString nylasMailDefaultPath();
Q_REQUIRED_RESULT MAILIMPORTER_EXPORT QString trojitaDefaultPath();
Q_REQUIRED_RESULT MAILIMPORTER_EXPORT QString gearyDefaultPath();
Q_REQUIRED_RESULT MAILIMPORTER_EXPORT QStringList isMailerFound();
Q_REQUIRED_RESULT MAILIMPORTER_EXPORT QString nylasMailDefaultPath();
}
}
......
......@@ -37,7 +37,7 @@ public:
~SelectThunderbirdProfileWidget();
void fillProfile(const QMap<QString, QString> &map, const QString &defaultProfile);
QString selectedProfile() const;
Q_REQUIRED_RESULT QString selectedProfile() const;
private:
Ui::SelectThunderbirdProfileWidget *ui = nullptr;
......@@ -49,7 +49,7 @@ class MAILIMPORTER_TESTS_EXPORT SelectThunderbirdProfileDialog : public QDialog
public:
explicit SelectThunderbirdProfileDialog(QWidget *parent = nullptr);
~SelectThunderbirdProfileDialog();
QString selectedProfile() const;
Q_REQUIRED_RESULT QString selectedProfile() const;
void fillProfile(const QMap<QString, QString> &map, const QString &defaultProfile);
private:
......
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