Commit 96009b3d authored by Laurent Montel's avatar Laurent Montel
Browse files

const'ify pointer

parent 371e0c54
Pipeline #231282 failed with stage
in 7 minutes and 6 seconds
......@@ -15,8 +15,8 @@ public:
explicit AkonotesResource(const QString &id);
~AkonotesResource() override;
QString defaultResourceType() override;
Q_REQUIRED_RESULT QString defaultResourceType() override;
protected:
QString itemMimeType() const override;
Q_REQUIRED_RESULT QString itemMimeType() const override;
};
......@@ -54,7 +54,7 @@ bool BirthdaysConfigAgentWidget::save() const
QSize BirthdaysConfigAgentWidget::restoreDialogSize() const
{
auto group = config()->group(myConfigGroupName);
const auto group = config()->group(myConfigGroupName);
const QSize size = group.readEntry("Size", QSize(600, 400));
return size;
}
......
......@@ -87,7 +87,8 @@ bool BirthdaysResource::retrieveItems(const Akonadi::Item::List &items, const QS
// collect contacts, same contact might be used multiple times, for birthday & anniversary
QSet<Akonadi::Item::Id> contactIds;
for (auto &item : items) {
contactIds.reserve(items.count());
for (const auto &item : items) {
const Akonadi::Item::Id contactId = item.remoteId().mid(1).toLongLong();
contactIds << contactId;
}
......
......@@ -83,7 +83,7 @@ Collection::List ContactsResource::createCollectionsForDirectory(const QDir &par
collections.reserve(entries.count() * 2);
for (const QFileInfo &entry : entries) {
QDir subdir(entry.absoluteFilePath());
const QDir subdir(entry.absoluteFilePath());
Collection collection;
collection.setParentCollection(parentCollection);
......
......@@ -54,11 +54,11 @@ protected:
private:
void slotReloadConfig();
Akonadi::Collection::List createCollectionsForDirectory(const QDir &parentDirectory, const Akonadi::Collection &parentCollection) const;
QString baseDirectoryPath() const;
Q_REQUIRED_RESULT Akonadi::Collection::List createCollectionsForDirectory(const QDir &parentDirectory, const Akonadi::Collection &parentCollection) const;
Q_REQUIRED_RESULT QString baseDirectoryPath() const;
void initializeDirectory(const QString &path) const;
Akonadi::Collection::Rights supportedRights(bool isResourceCollection) const;
QString directoryForCollection(const Akonadi::Collection &collection) const;
Q_REQUIRED_RESULT Akonadi::Collection::Rights supportedRights(bool isResourceCollection) const;
Q_REQUIRED_RESULT QString directoryForCollection(const Akonadi::Collection &collection) const;
bool doRetrieveItem(Akonadi::Item &item);
private:
......
......@@ -63,6 +63,7 @@ using IncidencePtr = QSharedPointer<KCalendarCore::Incidence>;
DavGroupwareResource::DavGroupwareResource(const QString &id)
: ResourceBase(id)
, FreeBusyProviderBase()
, mFreeBusyHandler(new DavFreeBusyHandler(this))
{
AttributeFactory::registerAttribute<EntityDisplayAttribute>();
AttributeFactory::registerAttribute<DavProtocolAttribute>();
......@@ -101,7 +102,6 @@ DavGroupwareResource::DavGroupwareResource(const QString &id)
Settings::self()->setWinId(winIdForDialogs());
Settings::self()->setResourceIdentifier(identifier());
mFreeBusyHandler = new DavFreeBusyHandler(this);
connect(mFreeBusyHandler, &DavFreeBusyHandler::handlesFreeBusy, this, &DavGroupwareResource::onHandlesFreeBusy);
connect(mFreeBusyHandler, &DavFreeBusyHandler::freeBusyRetrieved, this, &DavGroupwareResource::onFreeBusyRetrieved);
......
......@@ -119,6 +119,6 @@ private:
Akonadi::Collection mDavCollectionRoot;
QMap<QString, std::shared_ptr<KDAV::EtagCache>> mEtagCaches;
QMap<QString, QString> mCTagCache;
DavFreeBusyHandler *mFreeBusyHandler = nullptr;
DavFreeBusyHandler *const mFreeBusyHandler;
bool mSyncErrorNotified = false;
};
......@@ -98,7 +98,7 @@ static QString settingsToUrl(const QWizard *wizard, const QString &protocol)
url.setScheme(QStringLiteral("http"));
}
QString hostPropertyName(QStringLiteral("X-DavGroupware-") + protocol + QStringLiteral("Host"));
const QString hostPropertyName(QStringLiteral("X-DavGroupware-") + protocol + QStringLiteral("Host"));
if (service->property(hostPropertyName).isNull()) {
return {};
}
......
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