Commit 7089b95f authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use const + add missing Q_REQUIRED_RESULT

parent 5b46bd0d
Pipeline #174901 passed with stage
in 7 minutes and 56 seconds
......@@ -158,7 +158,7 @@ void NewMailNotifierAgent::itemsRemoved(const Item::List &items)
return;
}
QHash<Akonadi::Collection, QList<Akonadi::Item::Id>>::iterator end(mNewMails.end());
const QHash<Akonadi::Collection, QList<Akonadi::Item::Id>>::iterator end(mNewMails.end());
for (QHash<Akonadi::Collection, QList<Akonadi::Item::Id>>::iterator it = mNewMails.begin(); it != end; ++it) {
QList<Akonadi::Item::Id> idList = it.value();
bool itemFound = false;
......@@ -186,7 +186,7 @@ void NewMailNotifierAgent::itemsFlagsChanged(const Akonadi::Item::List &items, c
return;
}
for (const Akonadi::Item &item : items) {
QHash<Akonadi::Collection, QList<Akonadi::Item::Id>>::iterator end(mNewMails.end());
const QHash<Akonadi::Collection, QList<Akonadi::Item::Id>>::iterator end(mNewMails.end());
for (QHash<Akonadi::Collection, QList<Akonadi::Item::Id>>::iterator it = mNewMails.begin(); it != end; ++it) {
QList<Akonadi::Item::Id> idList = it.value();
if (idList.contains(item.id()) && addedFlags.contains("\\SEEN")) {
......@@ -295,7 +295,7 @@ void NewMailNotifierAgent::slotShowNotifications()
hasUniqMessage = false;
}
QHash<Akonadi::Collection, QList<Akonadi::Item::Id>>::const_iterator end(mNewMails.constEnd());
const QHash<Akonadi::Collection, QList<Akonadi::Item::Id>>::const_iterator end(mNewMails.constEnd());
for (QHash<Akonadi::Collection, QList<Akonadi::Item::Id>>::const_iterator it = mNewMails.constBegin(); it != end; ++it) {
const auto attr = it.key().attribute<Akonadi::EntityDisplayAttribute>();
QString displayName;
......
......@@ -3,7 +3,7 @@
macro( folderarchive_kmail _source )
set( _test ${_source} ../folderarchiveaccountinfo.cpp )
get_filename_component( _name ${_source} NAME_WE )
add_executable( ${_name} ${_test} )
add_executable( ${_name} ${_test} ${_name}.h)
add_test(NAME ${_name} COMMAND ${_name} )
ecm_mark_as_test(folderararchive-${_name})
......
......@@ -42,7 +42,7 @@ public:
void writeConfig(KConfigGroup &config);
void readConfig(const KConfigGroup &config);
bool operator==(const FolderArchiveAccountInfo &other) const;
Q_REQUIRED_RESULT bool operator==(const FolderArchiveAccountInfo &other) const;
private:
FolderArchiveAccountInfo::FolderArchiveType mArchiveType = UniqueFolder;
......
......@@ -89,7 +89,8 @@ bool ICalResourceBase::checkItemAddedChanged(const Akonadi::Item &item, CheckTyp
return false;
}
if (!item.hasPayload<PayloadPtr>()) {
QString msg = (type == CheckForAdded) ? i18n("Unable to retrieve added item %1.", item.id()) : i18n("Unable to retrieve modified item %1.", item.id());
const QString msg =
(type == CheckForAdded) ? i18n("Unable to retrieve added item %1.", item.id()) : i18n("Unable to retrieve modified item %1.", item.id());
cancelTask(msg);
return false;
}
......
......@@ -29,6 +29,6 @@ private: // Methods
void checkCollectionId();
private: // Members
QString mCollectionId;
const QString mCollectionId;
Ui::CompactPage ui;
};
......@@ -42,7 +42,7 @@ public:
Q_REQUIRED_RESULT QByteArray type() const override;
bool operator==(const DeletedItemsAttribute &other) const;
Q_REQUIRED_RESULT bool operator==(const DeletedItemsAttribute &other) const;
private:
QSet<quint64> mDeletedItemOffsets;
......
......@@ -38,7 +38,7 @@ protected:
bool readFromFile(const QString &fileName) override;
bool writeToFile(const QString &fileName) override;
Akonadi::Collection rootCollection() const override;
Q_REQUIRED_RESULT Akonadi::Collection rootCollection() const override;
private Q_SLOTS:
void onCollectionFetch(KJob *job);
......
......@@ -26,7 +26,7 @@ private Q_SLOTS:
private:
QString mUrl;
QString mUser;
QString mPassword;
const QString mUser;
const QString mPassword;
};
}
Supports Markdown
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