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

Const'ify pointer

parent 72bd55f8
Pipeline #33849 passed with stage
in 43 minutes and 31 seconds
......@@ -51,7 +51,7 @@ private Q_SLOTS:
private:
bool scanSubTree(const QModelIndex &index, bool searchForItem);
QAbstractItemModel *mModel = nullptr;
QAbstractItemModel *const mModel;
Collection mCollection;
Item mItem;
};
......
......@@ -20,11 +20,6 @@ using namespace Akonadi;
ChangeRecorderPrivate::ChangeRecorderPrivate(ChangeNotificationDependenciesFactory *dependenciesFactory_,
ChangeRecorder *parent)
: MonitorPrivate(dependenciesFactory_, parent)
, settings(nullptr)
, enableChangeRecording(true)
, m_lastKnownNotificationsCount(0)
, m_startOffset(0)
, m_needFullSave(true)
{
}
......
......@@ -25,8 +25,8 @@ public:
ChangeRecorderPrivate(ChangeNotificationDependenciesFactory *dependenciesFactory_, ChangeRecorder *parent);
Q_DECLARE_PUBLIC(ChangeRecorder)
QSettings *settings;
bool enableChangeRecording;
QSettings *settings = nullptr;
bool enableChangeRecording = true;
int pipelineSize() const override;
void notificationsEnqueued(int count) override;
......@@ -46,9 +46,9 @@ private:
void notificationsLoaded();
void writeStartOffset() const;
int m_lastKnownNotificationsCount; // just for invariant checking
int m_startOffset; // number of saved notifications to skip
bool m_needFullSave;
int m_lastKnownNotificationsCount = 0; // just for invariant checking
int m_startOffset = 0; // number of saved notifications to skip
bool m_needFullSave = true;
};
} // namespace Akonadi
......
......@@ -20,9 +20,6 @@ public:
CollectionFetchScopePrivate()
: ancestorDepth(CollectionFetchScope::None)
, listFilter(CollectionFetchScope::Enabled)
, statistics(false)
, fetchIdOnly(true)
, mIgnoreRetrievalErrors(false)
{
}
......@@ -52,9 +49,9 @@ public:
CollectionFetchScope::ListFilter listFilter;
QSet<QByteArray> attributes;
QScopedPointer<CollectionFetchScope> ancestorFetchScope;
bool statistics;
bool fetchIdOnly;
bool mIgnoreRetrievalErrors;
bool statistics = false;
bool fetchIdOnly = true;
bool mIgnoreRetrievalErrors = false;
};
CollectionFetchScope::CollectionFetchScope()
......
......@@ -25,7 +25,6 @@ public:
explicit CollectionPathResolverPrivate(CollectionPathResolver *parent)
: JobPrivate(parent)
, mColId(-1)
, mPathToId(false)
{
}
......
......@@ -97,7 +97,7 @@ private:
void useOtherItem();
void useBothItems();
ConflictType mConflictType;
const ConflictType mConflictType;
Akonadi::Item mChangedItem;
Akonadi::Item mConflictingItem;
......
......@@ -36,7 +36,6 @@ class Q_DECL_HIDDEN Control::Private
public:
explicit Private(Control *parent)
: mParent(parent)
, mEventLoop(nullptr)
{
}
......
......@@ -34,7 +34,6 @@ using namespace Akonadi;
Firstrun::Firstrun(QObject *parent)
: QObject(parent)
, mConfig(new KConfig(ServerManager::addNamespace(QStringLiteral("akonadi-firstrunrc"))))
, mCurrentDefault(nullptr)
{
//The code in firstrun is not safe in multi-instance mode
Q_ASSERT(!ServerManager::hasInstanceIdentifier());
......
......@@ -68,7 +68,7 @@ private Q_SLOTS:
private:
QStringList mPendingDefaults;
KConfig *mConfig = nullptr;
KConfig *const mConfig;
KConfig *mCurrentDefault = nullptr;
};
......
......@@ -77,7 +77,7 @@ public:
QSet<QString> mListedItems;
ItemSync::TransactionMode mTransactionMode;
TransactionSequence *mCurrentTransaction;
TransactionSequence *mCurrentTransaction = nullptr;
int mTransactionJobs;
// fetch scope for initial item listing
......
......@@ -38,10 +38,7 @@ class AgentInstanceCreateJobPrivate : public KJobPrivateBase
public:
explicit AgentInstanceCreateJobPrivate(AgentInstanceCreateJob *parent)
: q(parent)
, parentWidget(nullptr)
, safetyTimer(new QTimer(parent))
, doConfig(false)
, tooLate(false)
{
connect(AgentManager::self(), &AgentManager::instanceAdded, this, &AgentInstanceCreateJobPrivate::agentInstanceAdded);
connect(safetyTimer, &QTimer::timeout, this, &AgentInstanceCreateJobPrivate::timeout);
......@@ -104,9 +101,9 @@ public:
QString agentTypeId;
AgentInstance agentInstance;
QWidget *parentWidget = nullptr;
QTimer *safetyTimer = nullptr;
bool doConfig;
bool tooLate;
QTimer *const safetyTimer;
bool doConfig = false;
bool tooLate = false;
};
} // namespace Akonadi
......
......@@ -26,10 +26,6 @@ using namespace Akonadi;
ItemModifyJobPrivate::ItemModifyJobPrivate(ItemModifyJob *parent)
: JobPrivate(parent)
, mRevCheck(true)
, mIgnorePayload(false)
, mAutomaticConflictHandlingEnabled(true)
, mSilent(false)
{
}
......
......@@ -54,13 +54,13 @@ public:
QSet<int> mOperations;
QByteArray mTag;
Item::List mItems;
bool mRevCheck;
bool mRevCheck = true;
QSet<QByteArray> mParts;
QSet<QByteArray> mForeignParts;
QByteArray mPendingData;
bool mIgnorePayload;
bool mAutomaticConflictHandlingEnabled;
bool mSilent;
bool mIgnorePayload = false;
bool mAutomaticConflictHandlingEnabled = true;
bool mSilent = false;
};
}
......
......@@ -22,7 +22,6 @@ public:
: mParent(parent)
, mCollection(collection)
, mMimeTypes(mimeTypes)
, mFetchCount(0)
{
}
......@@ -71,13 +70,13 @@ public:
}
}
RecursiveItemFetchJob *mParent = nullptr;
Collection mCollection;
RecursiveItemFetchJob *const mParent;
const Collection mCollection;
Item::List mItems;
ItemFetchScope mFetchScope;
QStringList mMimeTypes;
const QStringList mMimeTypes;
int mFetchCount;
int mFetchCount = 0;
};
RecursiveItemFetchJob::RecursiveItemFetchJob(const Collection &collection, const QStringList &mimeTypes, QObject *parent)
......
......@@ -18,7 +18,6 @@ class Akonadi::RelationFetchJobPrivate : public JobPrivate
public:
explicit RelationFetchJobPrivate(RelationFetchJob *parent)
: JobPrivate(parent)
, mEmitTimer(nullptr)
{
mEmitTimer.setSingleShot(true);
mEmitTimer.setInterval(std::chrono::milliseconds{100});
......
......@@ -27,8 +27,8 @@ public:
{
}
QString mName;
SearchQuery mQuery;
const QString mName;
const SearchQuery mQuery;
QStringList mMimeTypes;
QVector<Collection> mCollections;
bool mRecursive = false;
......
......@@ -26,8 +26,8 @@ public:
{
}
SpecialCollections *mSpecialCollections = nullptr;
QStringList mMimeTypes;
SpecialCollections *const mSpecialCollections;
const QStringList mMimeTypes;
};
Akonadi::SpecialCollectionsDiscoveryJob::SpecialCollectionsDiscoveryJob(SpecialCollections *collections, const QStringList &mimeTypes, QObject *parent)
......
......@@ -36,9 +36,6 @@ class TrashJob::TrashJobPrivate : public JobPrivate
public:
explicit TrashJobPrivate(TrashJob *parent)
: JobPrivate(parent)
, mKeepTrashInCollection(false)
, mSetRestoreCollection(false)
, mDeleteIfInTrash(false)
{
}
//4.
......@@ -66,9 +63,9 @@ public:
Collection mCollection;
Collection mRestoreCollection;
Collection mTrashCollection;
bool mKeepTrashInCollection;
bool mSetRestoreCollection; //only set restore collection when moved to trash collection (not in place)
bool mDeleteIfInTrash;
bool mKeepTrashInCollection = false;
bool mSetRestoreCollection = false; //only set restore collection when moved to trash collection (not in place)
bool mDeleteIfInTrash = false;
QHash<Collection, Item::List> mCollectionItems; //list of trashed items sorted according to parent collection
QHash<Item::Id, Collection> mParentCollections; //fetched parent collection of items (containing the resource name)
......
......@@ -26,7 +26,7 @@ public:
{
}
AgentInstanceModel *mParent = nullptr;
AgentInstanceModel *const mParent;
AgentInstance::List mInstances;
void instanceAdded(const AgentInstance & /*instance*/);
......
......@@ -24,7 +24,7 @@ public:
mTypes = AgentManager::self()->types();
}
AgentTypeModel *mParent = nullptr;
AgentTypeModel *const mParent;
AgentType::List mTypes;
void typeAdded(const AgentType &agentType);
......
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