Commit 24561b1b authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Add more Q_REQUIRED_RESULT

parent 4e7ba7af
Pipeline #174224 passed with stage
in 8 minutes and 17 seconds
......@@ -22,22 +22,22 @@ public:
FolderByYears,
};
bool isValid() const;
Q_REQUIRED_RESULT bool isValid() const;
QString instanceName() const;
Q_REQUIRED_RESULT QString instanceName() const;
void setInstanceName(const QString &instance);
void setArchiveTopLevel(Akonadi::Collection::Id id);
Akonadi::Collection::Id archiveTopLevel() const;
Q_REQUIRED_RESULT Akonadi::Collection::Id archiveTopLevel() const;
void setFolderArchiveType(FolderArchiveType type);
FolderArchiveType folderArchiveType() const;
Q_REQUIRED_RESULT FolderArchiveType folderArchiveType() const;
void setEnabled(bool enabled);
bool enabled() const;
Q_REQUIRED_RESULT bool enabled() const;
void setKeepExistingStructure(bool b);
bool keepExistingStructure() const;
Q_REQUIRED_RESULT bool keepExistingStructure() const;
void writeConfig(KConfigGroup &config);
void readConfig(const KConfigGroup &config);
......
......@@ -47,7 +47,6 @@ bool ICalResource::doRetrieveItems(const Akonadi::Item::List &items, const QSet<
qCritical() << "akonadi_ical_resource: Can't find incidence with uid " << rid << "; item.id() = " << item.id();
Q_EMIT error(i18n("Incidence with uid '%1' not found.", rid));
return false;
;
}
Incidence::Ptr incidencePtr(incidence->clone());
......
......@@ -248,8 +248,7 @@ void ICalDirResource::retrieveCollections()
attr->setDisplayName(name() == identifier() ? i18n("Calendar Folder") : name());
attr->setIconName(QStringLiteral("office-calendar"));
Collection::List list;
list << c;
const Collection::List list{c};
collectionsRetrieved(list);
}
......
......@@ -40,8 +40,8 @@ protected:
void collectionChanged(const Akonadi::Collection &collection) override;
private:
bool loadIncidences();
QString iCalDirectoryName() const;
Q_REQUIRED_RESULT bool loadIncidences();
Q_REQUIRED_RESULT QString iCalDirectoryName() const;
QString iCalDirectoryFileName(const QString &file) const;
void initializeICalDirectory() const;
void slotReloadConfig();
......
......@@ -20,25 +20,25 @@ public:
~ImapAccount();
void setServer(const QString &server);
QString server() const;
Q_REQUIRED_RESULT QString server() const;
void setPort(quint16 port);
quint16 port() const;
Q_REQUIRED_RESULT quint16 port() const;
void setUserName(const QString &userName);
QString userName() const;
Q_REQUIRED_RESULT QString userName() const;
void setEncryptionMode(KIMAP::LoginJob::EncryptionMode mode);
KIMAP::LoginJob::EncryptionMode encryptionMode() const;
Q_REQUIRED_RESULT KIMAP::LoginJob::EncryptionMode encryptionMode() const;
void setAuthenticationMode(KIMAP::LoginJob::AuthenticationMode mode);
KIMAP::LoginJob::AuthenticationMode authenticationMode() const;
Q_REQUIRED_RESULT KIMAP::LoginJob::AuthenticationMode authenticationMode() const;
void setSubscriptionEnabled(bool enabled);
bool isSubscriptionEnabled() const;
Q_REQUIRED_RESULT bool isSubscriptionEnabled() const;
void setTimeout(int timeout);
int timeout() const;
Q_REQUIRED_RESULT int timeout() const;
void setUseNetworkProxy(bool useProxy);
bool useNetworkProxy() const;
......
......@@ -92,7 +92,7 @@ protected:
void doSetOnline(bool online) override;
QChar separatorCharacter() const;
Q_REQUIRED_RESULT QChar separatorCharacter() const;
void setSeparatorCharacter(QChar separator);
void aboutToQuit() override;
......
......@@ -13,10 +13,10 @@ class NoInferiorsAttribute : public Akonadi::Attribute
public:
explicit NoInferiorsAttribute(bool noInferiors = false);
void setNoInferiors(bool noInferiors);
bool noInferiors() const;
Q_REQUIRED_RESULT bool noInferiors() const;
QByteArray type() const override;
Attribute *clone() const override;
QByteArray serialized() const override;
Q_REQUIRED_RESULT QByteArray serialized() const override;
void deserialize(const QByteArray &data) override;
private:
......
......@@ -13,10 +13,10 @@ class NoSelectAttribute : public Akonadi::Attribute
public:
explicit NoSelectAttribute(bool noSelect = false);
void setNoSelect(bool noSelect);
bool noSelect() const;
QByteArray type() const override;
Q_REQUIRED_RESULT bool noSelect() const;
Q_REQUIRED_RESULT QByteArray type() const override;
Attribute *clone() const override;
QByteArray serialized() const override;
Q_REQUIRED_RESULT QByteArray serialized() const override;
void deserialize(const QByteArray &data) override;
private:
......
......@@ -67,7 +67,7 @@ public:
void releaseSession(KIMAP::Session *session);
ImapAccount *account() const;
QStringList serverCapabilities() const;
Q_REQUIRED_RESULT QStringList serverCapabilities() const;
QList<KIMAP::MailBoxDescriptor> serverNamespaces() const;
enum Namespace {
Personal,
......
......@@ -30,7 +30,7 @@ public:
virtual void loadAccount(ImapAccount *account) const;
QString rootRemoteId() const;
Q_REQUIRED_RESULT QString rootRemoteId() const;
virtual void renameRootCollection(const QString &newName);
virtual void clearCachedPassword();
......
......@@ -28,19 +28,19 @@ public:
DeletedItemsAttribute *clone() const override;
QSet<quint64> deletedItemOffsets() const;
KMBox::MBoxEntry::List deletedItemEntries() const;
Q_REQUIRED_RESULT QSet<quint64> deletedItemOffsets() const;
Q_REQUIRED_RESULT KMBox::MBoxEntry::List deletedItemEntries() const;
void deserialize(const QByteArray &data) override;
/**
* Returns the number of offsets stored in this attribute.
*/
int offsetCount() const;
Q_REQUIRED_RESULT int offsetCount() const;
QByteArray serialized() const override;
Q_REQUIRED_RESULT QByteArray serialized() const override;
QByteArray type() const override;
Q_REQUIRED_RESULT QByteArray type() const override;
bool operator==(const DeletedItemsAttribute &other) const;
......
......@@ -68,9 +68,6 @@ class MBoxContext
{
public:
MBoxContext()
: mRevision(0)
, mIndexDataLoaded(false)
, mHasIndexData(false)
{
}
......@@ -251,7 +248,7 @@ public:
public:
Collection mCollection;
qint64 mRevision;
qint64 mRevision = 0;
private:
QSet<quint64> mDeletedOffsets;
......@@ -260,8 +257,8 @@ private:
using IndexDataHash = QHash<quint64, KMIndexDataPtr>;
IndexDataHash mIndexData;
bool mIndexDataLoaded;
bool mHasIndexData;
bool mIndexDataLoaded = false;
bool mHasIndexData = false;
};
using MBoxPtr = QSharedPointer<MBoxContext>;
......
......@@ -46,10 +46,6 @@ public:
: q(parent)
, mCollection(collection)
, mStore(store)
, mTransaction(nullptr)
, mHighestModTime(-1)
, mNumItemCreateJobs(0)
, mNumItemModifyJobs(0)
{
}
......@@ -76,9 +72,9 @@ public:
QQueue<Item> mChangedItems;
Item::List mAvailableItems;
Item::List mItemsMarkedAsDeleted;
qint64 mHighestModTime;
int mNumItemCreateJobs;
int mNumItemModifyJobs;
qint64 mHighestModTime = -1;
int mNumItemCreateJobs = 0;
int mNumItemModifyJobs = 0;
public: // slots
void akonadiFetchResult(KJob *job);
......
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