Commit 2b5f99fc authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Add missing Q_REQUIRED_RESULT

parent b3e73177
......@@ -30,7 +30,7 @@ public:
explicit LogInFile(QObject *parent = nullptr);
~LogInFile();
QString fileName() const;
Q_REQUIRED_RESULT QString fileName() const;
void setFileName(const QString &fileName);
public Q_SLOTS:
......
......@@ -36,7 +36,7 @@ public:
explicit PimDataExporterConsole(QObject *parent = nullptr);
~PimDataExporterConsole();
Mode mode() const;
Q_REQUIRED_RESULT Mode mode() const;
void setMode(Mode mode);
void setLogFileName(const QString &logFileName);
......@@ -45,7 +45,7 @@ public:
void start();
QString importExportFileName() const;
Q_REQUIRED_RESULT QString importExportFileName() const;
void setImportExportFileName(const QString &importFileName);
Q_SIGNALS:
......
......@@ -640,7 +640,7 @@ void AbstractImportExportJob::convertCollectionStrToAkonadiId(const KSharedConfi
{
if (config->hasGroup(groupName)) {
KConfigGroup eventGroup = config->group(groupName);
convertRealPathToCollection(eventGroup, key, false);
(void)convertRealPathToCollection(eventGroup, key, false);
}
}
......
......@@ -51,7 +51,7 @@ public:
virtual void start() = 0;
bool wasCanceled() const;
Q_REQUIRED_RESULT bool wasCanceled() const;
static int archiveVersion();
static void setArchiveVersion(int version);
......@@ -72,14 +72,14 @@ protected:
virtual void slotNextStep();
protected:
bool copyArchiveFileTo(const KArchiveFile *file, const QString &destination);
Q_REQUIRED_RESULT bool copyArchiveFileTo(const KArchiveFile *file, const QString &destination);
void initializeListStep();
void startSynchronizeResources(const QStringList &listResourceToSync);
void infoAboutNewResource(const QString &resourceName);
void copyToDirectory(const KArchiveEntry *entry, const QString &dest);
void extractZipFile(const KArchiveFile *file, const QString &source, const QString &destination, bool isStoredAsZippedArchive = true);
qint64 convertRealPathToCollection(KConfigGroup &group, const QString &currentKey, bool addCollectionPrefix = false);
Q_REQUIRED_RESULT qint64 convertRealPathToCollection(KConfigGroup &group, const QString &currentKey, bool addCollectionPrefix = false);
void convertRealPathToCollectionList(KConfigGroup &group, const QString &currentKey, bool addCollectionPrefix = true);
void copyToFile(const KArchiveFile *archivefile, const QString &dest, const QString &filename, const QString &prefix);
void initializeImportJob();
......@@ -88,11 +88,11 @@ protected:
void backupUiRcFile(const QString &configFileName, const QString &applicationName);
void restoreUiRcFile(const QString &configNameStr, const QString &applicationName);
int mergeConfigMessageBox(const QString &configName) const;
bool overwriteConfigMessageBox(const QString &configName) const;
Akonadi::Collection::Id convertPathToId(const QString &path);
Q_REQUIRED_RESULT int mergeConfigMessageBox(const QString &configName) const;
Q_REQUIRED_RESULT bool overwriteConfigMessageBox(const QString &configName) const;
Q_REQUIRED_RESULT Akonadi::Collection::Id convertPathToId(const QString &path);
void backupResourceFile(const Akonadi::AgentInstance &agent, const QString &defaultPath);
QStringList restoreResourceFile(const QString &resourceName, const QString &defaultPath, const QString &storePath, bool overwriteResources = false);
Q_REQUIRED_RESULT QStringList restoreResourceFile(const QString &resourceName, const QString &defaultPath, const QString &storePath, bool overwriteResources = false);
virtual void addSpecificResourceSettings(const KSharedConfig::Ptr &resourceConfig, const QString &resourceName, QMap<QString, QVariant> &settings);
void restoreConfigFile(const QString &configNameStr);
bool overwriteDirectoryMessageBox(const QString &directory) const;
......
......@@ -38,7 +38,7 @@ protected:
void slotNextStep() override;
private:
bool isAConfigFile(const QString &name) const override;
Q_REQUIRED_RESULT bool isAConfigFile(const QString &name) const override;
void importkaddressBookConfig(const KArchiveFile *file, const QString &config, const QString &filename, const QString &prefix);
void restoreResources();
void restoreConfig();
......
......@@ -37,7 +37,7 @@ protected:
void slotNextStep() override;
private:
bool isAConfigFile(const QString &name) const override;
Q_REQUIRED_RESULT bool isAConfigFile(const QString &name) const override;
void importkalarmConfig(const KArchiveFile *kalarmFile, const QString &kalarmrc, const QString &filename, const QString &prefix);
void restoreResources();
void restoreConfig();
......
......@@ -30,10 +30,10 @@ public:
~ArchiveStorage();
void closeArchive();
bool openArchive(bool write);
Q_REQUIRED_RESULT bool openArchive(bool write);
KZip *archive() const;
QString filename() const;
Q_REQUIRED_RESULT QString filename() const;
Q_SIGNALS:
void error(const QString &);
......
......@@ -38,7 +38,7 @@ protected:
void slotNextStep() override;
private:
bool isAConfigFile(const QString &name) const override;
Q_REQUIRED_RESULT bool isAConfigFile(const QString &name) const override;
void importkorganizerConfig(const KArchiveFile *file, const QString &config, const QString &filename, const QString &prefix);
void importeventViewConfig(const KArchiveFile *file, const QString &config, const QString &filename, const QString &prefix);
void restoreResources();
......
......@@ -48,7 +48,7 @@ private:
void slotMailsJobTerminated();
void slotWriteNextArchiveResource();
bool checkBackupType(Utils::StoredType type) const;
Q_REQUIRED_RESULT bool checkBackupType(Utils::StoredType type) const;
void backupTransports();
void backupResources();
void backupConfig();
......
......@@ -1178,7 +1178,7 @@ void ImportMailJob::importKmailConfig(const KArchiveFile *kmailsnippet, const QS
if (kmailConfig->hasGroup(composerStr)) {
KConfigGroup composerGroup = kmailConfig->group(composerStr);
const QString previousStr(QStringLiteral("previous-fcc"));
convertRealPathToCollection(composerGroup, previousStr);
(void)convertRealPathToCollection(composerGroup, previousStr);
const QString previousIdentityStr(QStringLiteral("previous-identity"));
if (composerGroup.hasKey(previousIdentityStr)) {
......@@ -1197,10 +1197,10 @@ void ImportMailJob::importKmailConfig(const KArchiveFile *kmailsnippet, const QS
if (kmailConfig->hasGroup(collectionFolderViewStr)) {
KConfigGroup favoriteGroup = kmailConfig->group(collectionFolderViewStr);
const QString currentKey(QStringLiteral("Current"));
convertRealPathToCollection(favoriteGroup, currentKey, true);
(void)convertRealPathToCollection(favoriteGroup, currentKey, true);
const QString expensionKey(QStringLiteral("Expansion"));
convertRealPathToCollectionList(favoriteGroup, expensionKey);
(void)convertRealPathToCollectionList(favoriteGroup, expensionKey);
}
convertCollectionListStrToAkonadiId(kmailConfig, QStringLiteral("FavoriteCollections"), QStringLiteral("FavoriteCollectionIds"), false);
......
......@@ -69,7 +69,7 @@ private:
void mergeSieveTemplate(const KArchiveFile *archivefile, const QString &filename, const QString &prefix);
void importSimpleFilesInDirectory(const QString &relativePath);
void addMailTransport(MailTransport::Transport *mt, int defaultTransport, int transportId);
QString uniqueIdentityName(const QString &name);
Q_REQUIRED_RESULT QString uniqueIdentityName(const QString &name);
QHash<int, uint> mHashIdentity;
QHash<int, int> mHashTransport;
......
......@@ -202,7 +202,7 @@ void ImportNotesJob::importKNoteGlobalSettings(const KArchiveFile *archive, cons
if (globalSettingsConfig->hasGroup(composerStr)) {
KConfigGroup composerGroup = globalSettingsConfig->group(composerStr);
const QString previousStr(QStringLiteral("DefaultFolder"));
convertRealPathToCollection(composerGroup, previousStr);
(void)convertRealPathToCollection(composerGroup, previousStr);
}
globalSettingsConfig->sync();
}
......@@ -33,8 +33,8 @@ public:
explicit PimDataBackupRestore(QObject *parent = nullptr);
~PimDataBackupRestore();
bool backupStart(const QString &filename);
bool restoreStart(const QString &filename);
Q_REQUIRED_RESULT bool backupStart(const QString &filename);
Q_REQUIRED_RESULT bool restoreStart(const QString &filename);
void setStoredParameters(const QHash<Utils::AppsType, Utils::importExportParameters> &stored);
......@@ -65,7 +65,7 @@ private:
Backup,
Restore
};
bool openArchive(const QString &filename, bool readWrite);
Q_REQUIRED_RESULT bool openArchive(const QString &filename, bool readWrite);
void backupNextStep();
void restoreNextStep();
void backupFinished();
......
......@@ -33,7 +33,7 @@ public:
void setCurrentFileName(const QString &filename);
QString importDataInfoPath();
Q_REQUIRED_RESULT QString importDataInfoPath();
private:
QTemporaryDir *mTempDir = nullptr;
QString mFilename;
......
......@@ -77,40 +77,40 @@ struct importExportParameters {
Utils::StoredTypes types;
};
QString resourcePath(const KSharedConfigPtr &resourceConfig, const QString &defaultPath = QString());
PIMDATAEXPORTER_EXPORT QString transportsPath();
PIMDATAEXPORTER_EXPORT QString resourcesPath();
PIMDATAEXPORTER_EXPORT QString identitiesPath();
PIMDATAEXPORTER_EXPORT QString mailsPath();
PIMDATAEXPORTER_EXPORT QString configsPath();
PIMDATAEXPORTER_EXPORT QString akonadiPath();
PIMDATAEXPORTER_EXPORT QString dataPath();
PIMDATAEXPORTER_EXPORT QString calendarPath();
PIMDATAEXPORTER_EXPORT QString addressbookPath();
PIMDATAEXPORTER_EXPORT QString alarmPath();
PIMDATAEXPORTER_EXPORT QString infoPath();
PIMDATAEXPORTER_EXPORT QString notePath();
PIMDATAEXPORTER_EXPORT QString prefixAkonadiConfigFile();
PIMDATAEXPORTER_EXPORT QString exportDataTypeFileName();
QString akonadiAgentName(const QString &configPath);
PIMDATAEXPORTER_EXPORT QString agentFileName(const QString &filename);
Q_REQUIRED_RESULT QString resourcePath(const KSharedConfigPtr &resourceConfig, const QString &defaultPath = QString());
PIMDATAEXPORTER_EXPORT Q_REQUIRED_RESULT QString transportsPath();
PIMDATAEXPORTER_EXPORT Q_REQUIRED_RESULT QString resourcesPath();
PIMDATAEXPORTER_EXPORT Q_REQUIRED_RESULT QString identitiesPath();
PIMDATAEXPORTER_EXPORT Q_REQUIRED_RESULT QString mailsPath();
PIMDATAEXPORTER_EXPORT Q_REQUIRED_RESULT QString configsPath();
PIMDATAEXPORTER_EXPORT Q_REQUIRED_RESULT QString akonadiPath();
PIMDATAEXPORTER_EXPORT Q_REQUIRED_RESULT QString dataPath();
PIMDATAEXPORTER_EXPORT Q_REQUIRED_RESULT QString calendarPath();
PIMDATAEXPORTER_EXPORT Q_REQUIRED_RESULT QString addressbookPath();
PIMDATAEXPORTER_EXPORT Q_REQUIRED_RESULT QString alarmPath();
PIMDATAEXPORTER_EXPORT Q_REQUIRED_RESULT QString infoPath();
PIMDATAEXPORTER_EXPORT Q_REQUIRED_RESULT QString notePath();
PIMDATAEXPORTER_EXPORT Q_REQUIRED_RESULT QString prefixAkonadiConfigFile();
PIMDATAEXPORTER_EXPORT Q_REQUIRED_RESULT QString exportDataTypeFileName();
Q_REQUIRED_RESULT QString akonadiAgentName(const QString &configPath);
PIMDATAEXPORTER_EXPORT Q_REQUIRED_RESULT QString agentFileName(const QString &filename);
void convertCollectionListToRealPath(KConfigGroup &group, const QString &currentKey);
void convertCollectionToRealPath(KConfigGroup &group, const QString &currentKey);
void convertCollectionIdsToRealPath(KConfigGroup &group, const QString &currentKey, const QString &prefixCollection = QString());
QString resourcePath(const Akonadi::AgentInstance &agent, const QString &defaultPath = QString());
QString adaptResourcePath(const KSharedConfigPtr &resourceConfig, const QString &storedData);
QString storeResources(KZip *archive, const QString &identifier, const QString &path);
Q_REQUIRED_RESULT QString resourcePath(const Akonadi::AgentInstance &agent, const QString &defaultPath = QString());
Q_REQUIRED_RESULT QString adaptResourcePath(const KSharedConfigPtr &resourceConfig, const QString &storedData);
Q_REQUIRED_RESULT QString storeResources(KZip *archive, const QString &identifier, const QString &path);
KZip *openZip(const QString &filename, QString &errorMsg);
void storeDataExportInfo(const QString &filename, KZip *archive);
void addVersion(KZip *archive);
int archiveVersion(KZip *archive);
Q_REQUIRED_RESULT int archiveVersion(KZip *archive);
int currentArchiveVersion();
PIMDATAEXPORTER_EXPORT QString appTypeToI18n(AppsType type);
PIMDATAEXPORTER_EXPORT QString storedTypeToI18n(StoredType type);
Q_REQUIRED_RESULT int currentArchiveVersion();
PIMDATAEXPORTER_EXPORT Q_REQUIRED_RESULT QString appTypeToI18n(AppsType type);
PIMDATAEXPORTER_EXPORT Q_REQUIRED_RESULT QString storedTypeToI18n(StoredType type);
}
#endif // UTILS_H
......@@ -33,12 +33,12 @@ public:
void createTemplate(const QHash<Utils::AppsType, Utils::importExportParameters> &stored);
QHash<Utils::AppsType, Utils::importExportParameters> loadTemplate(const QString &path);
Q_REQUIRED_RESULT QHash<Utils::AppsType, Utils::importExportParameters> loadTemplate(const QString &path);
QString saveTemplate() const;
Q_REQUIRED_RESULT QString saveTemplate() const;
private:
Utils::StoredTypes loadStoredTypes(int &numberOfStep);
Q_REQUIRED_RESULT Utils::StoredTypes loadStoredTypes(int &numberOfStep);
void saveParameters(Utils::StoredTypes type);
QXmlStreamWriter *mStreamWriter = nullptr;
QXmlStreamReader *mStreamReader = nullptr;
......
......@@ -31,11 +31,11 @@ public:
explicit SelectionTypeDialog(bool backupData, QWidget *parent = nullptr);
~SelectionTypeDialog();
QHash<Utils::AppsType, Utils::importExportParameters> storedType() const;
Q_REQUIRED_RESULT QHash<Utils::AppsType, Utils::importExportParameters> storedType() const;
void loadTemplate(const QString &fileName);
QString exportedFileInfo() const;
Q_REQUIRED_RESULT QString exportedFileInfo() const;
void removeNotSelectedItems();
private:
void slotSelectAll();
......
......@@ -190,15 +190,15 @@ bool ShowArchiveStructureDialog::fillTree()
KMessageBox::error(this, i18n("This is not pim archive."), i18n("Show information"));
result = false;
} else {
searchArchiveElement(Utils::mailsPath(), topDirectory, Utils::appTypeToI18n(Utils::KMail));
searchArchiveElement(Utils::alarmPath(), topDirectory, Utils::appTypeToI18n(Utils::KAlarm));
searchArchiveElement(Utils::calendarPath(), topDirectory, Utils::appTypeToI18n(Utils::KOrganizer));
searchArchiveElement(Utils::addressbookPath(), topDirectory, Utils::appTypeToI18n(Utils::KAddressBook));
searchArchiveElement(Utils::identitiesPath(), topDirectory, Utils::storedTypeToI18n(Utils::Identity));
searchArchiveElement(Utils::resourcesPath(), topDirectory, Utils::storedTypeToI18n(Utils::Resources));
searchArchiveElement(Utils::configsPath(), topDirectory, Utils::storedTypeToI18n(Utils::Config));
searchArchiveElement(Utils::transportsPath(), topDirectory, Utils::storedTypeToI18n(Utils::MailTransport));
searchArchiveElement(Utils::dataPath(), topDirectory, Utils::storedTypeToI18n(Utils::Data));
(void)searchArchiveElement(Utils::mailsPath(), topDirectory, Utils::appTypeToI18n(Utils::KMail));
(void)searchArchiveElement(Utils::alarmPath(), topDirectory, Utils::appTypeToI18n(Utils::KAlarm));
(void)searchArchiveElement(Utils::calendarPath(), topDirectory, Utils::appTypeToI18n(Utils::KOrganizer));
(void)searchArchiveElement(Utils::addressbookPath(), topDirectory, Utils::appTypeToI18n(Utils::KAddressBook));
(void)searchArchiveElement(Utils::identitiesPath(), topDirectory, Utils::storedTypeToI18n(Utils::Identity));
(void)searchArchiveElement(Utils::resourcesPath(), topDirectory, Utils::storedTypeToI18n(Utils::Resources));
(void)searchArchiveElement(Utils::configsPath(), topDirectory, Utils::storedTypeToI18n(Utils::Config));
(void)searchArchiveElement(Utils::transportsPath(), topDirectory, Utils::storedTypeToI18n(Utils::MailTransport));
(void)searchArchiveElement(Utils::dataPath(), topDirectory, Utils::storedTypeToI18n(Utils::Data));
}
return result;
}
......
......@@ -42,7 +42,7 @@ public:
private:
void slotExportAsLogFile();
void exportAsLogFile();
bool fillTree();
Q_REQUIRED_RESULT bool fillTree();
void readConfig();
void writeConfig();
void slotItemClicked(QTreeWidgetItem *item, int column);
......@@ -50,7 +50,7 @@ private:
void slotExtractFile();
void slotOpenFile();
bool searchArchiveElement(const QString &path, const KArchiveDirectory *topDirectory, const QString &name);
Q_REQUIRED_RESULT bool searchArchiveElement(const QString &path, const KArchiveDirectory *topDirectory, const QString &name);
QTreeWidgetItem *addTopItem(const QString &name);
QTreeWidgetItem *addItem(QTreeWidgetItem *parent, const QString &name, const QString &fillFullPath);
QString mFileName;
......
......@@ -30,7 +30,7 @@ public:
~SynchronizeResourceDialog();
void setResources(const QHash<QString, QString> &resources);
QStringList resources() const;
Q_REQUIRED_RESULT QStringList resources() const;
private:
void slotAccepted();
......
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