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);
......
......@@ -29,7 +29,7 @@ public:
bool collectionAccepted(const QModelIndex &index, bool checkResourceVisibility = true);
QVector< QModelIndex > acceptedResources;
CollectionFilterProxyModel *mParent = nullptr;
CollectionFilterProxyModel *const mParent;
MimeTypeChecker mimeChecker;
bool mExcludeVirtualCollections = false;
};
......
......@@ -18,9 +18,7 @@
using namespace Akonadi;
TagModelPrivate::TagModelPrivate(TagModel *parent)
: mMonitor(nullptr)
, mSession(nullptr)
, q_ptr(parent)
: q_ptr(parent)
{
// Root tag
mTags.insert(-1, Tag());
......
......@@ -22,7 +22,6 @@
BridgeConnection::BridgeConnection(QTcpSocket *remoteSocket, QObject *parent)
: QObject(parent)
, m_localSocket(nullptr)
, m_remoteSocket(remoteSocket)
{
// wait for the vtable to be complete
......
......@@ -31,7 +31,7 @@ private Q_SLOTS:
void slotDataAvailable();
private:
QTcpSocket *m_remoteSocket = nullptr;
QTcpSocket *const m_remoteSocket;
};
class AkonadiBridgeConnection : public BridgeConnection
......
......@@ -21,7 +21,7 @@ protected Q_SLOTS:
virtual void slotNewConnection() = 0;
protected:
QTcpServer *m_server = nullptr;
QTcpServer *const m_server;
};
template <typename ConnectionType>
......
......@@ -58,9 +58,6 @@ class Q_DECL_HIDDEN AgentActionManager::Private
public:
explicit Private(AgentActionManager *parent)
: q(parent)
, mActionCollection(nullptr)
, mParentWidget(nullptr)
, mSelectionModel(nullptr)
{
mActions.fill(nullptr, AgentActionManager::LastType);
......
......@@ -74,9 +74,6 @@ class Q_DECL_HIDDEN AgentInstanceWidget::Private
public:
explicit Private(AgentInstanceWidget *parent)
: mParent(parent)
, mView(nullptr)
, mModel(nullptr)
, proxy(nullptr)
{
}
......@@ -84,7 +81,7 @@ public:
void currentAgentInstanceDoubleClicked(const QModelIndex &currentIndex);
void currentAgentInstanceClicked(const QModelIndex &currentIndex);
AgentInstanceWidget *mParent = nullptr;
AgentInstanceWidget *const mParent;
QListView *mView = nullptr;
AgentInstanceModel *mModel = nullptr;
AgentFilterProxyModel *proxy = nullptr;
......
......@@ -77,7 +77,7 @@ public:
void activated(int index);
void activated(const QModelIndex &index);
CollectionComboBox *mParent = nullptr;
CollectionComboBox *const mParent;
Monitor *mMonitor = nullptr;
EntityTreeModel *mModel = nullptr;
......
......@@ -151,7 +151,7 @@ public:
group.sync();
}
CollectionDialog *mParent = nullptr;
CollectionDialog *const mParent;
Monitor *mMonitor = nullptr;
CollectionFilterProxyModel *mMimeTypeFilterModel = nullptr;
......
......@@ -36,7 +36,7 @@ enum CountType {
class CollectionStatisticsDelegatePrivate
{
public:
QAbstractItemView *parent = nullptr;
QAbstractItemView *const parent;
bool drawUnreadAfterFolder = false;
DelegateAnimator *animator = nullptr;
QColor mSelectedUnreadColor;
......
......@@ -44,7 +44,7 @@ public:
void itemCurrentChanged(const QModelIndex &index);
bool hasParent(const QModelIndex &idx, Collection::Id parentId) const;
CollectionView *mParent = nullptr;
CollectionView *const mParent;
QModelIndex dragOverIndex;
QTimer dragExpandTimer;
......
......@@ -24,9 +24,7 @@
using namespace Akonadi;
DragDropManager::DragDropManager(QAbstractItemView *view)
: mShowDropActionMenu(true)
, mIsManualSortingActive(false)
, m_view(view)
: m_view(view)
{
}
......
......@@ -61,9 +61,9 @@ private:
Collection currentDropTarget(QDropEvent *event) const;
bool hasAncestor(const QModelIndex &index, Collection::Id parentId) const;
bool mShowDropActionMenu;
bool mIsManualSortingActive;
QAbstractItemView *m_view = nullptr;
bool mShowDropActionMenu = true;
bool mIsManualSortingActive = false;
QAbstractItemView *const m_view;
};
}
......
......@@ -44,7 +44,7 @@ public:
void itemDoubleClicked(const QModelIndex &index) const;
void itemCurrentChanged(const QModelIndex &index) const;
EntityListView *mParent = nullptr;
EntityListView *const mParent;
DragDropManager *mDragDropManager = nullptr;
KXMLGUIClient *mXmlGuiClient = nullptr;
};
......
......@@ -50,7 +50,7 @@ public:
void slotSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected) const;
EntityTreeView *mParent = nullptr;
EntityTreeView *const mParent;
QBasicTimer mDragExpandTimer;
DragDropManager *mDragDropManager = nullptr;
KXMLGUIClient *mXmlGuiClient = nullptr;
......
......@@ -39,7 +39,7 @@ public:
KXMLGUIClient *xmlGuiClient = nullptr;
private:
ItemView *mParent = nullptr;
ItemView *const mParent;
};
void ItemView::Private::init()
......
......@@ -55,7 +55,7 @@ protected:
private:
QSet<Animation> m_animations;
QAbstractItemView *m_view = nullptr;
QAbstractItemView *const m_view;
KPixmapSequence m_pixmapSequence;
int m_timerId;
};
......
......@@ -52,7 +52,7 @@ private:
private:
QStringList mListRecentCollection;
QMenu *mMenu = nullptr;
QMenu *const mMenu;
const QAbstractItemModel *mModel = nullptr;
QAction *mRecentAction = nullptr;
KSharedConfig::Ptr mAkonadiConfig;
......
......@@ -23,7 +23,7 @@ public:
Q_REQUIRED_RESULT QString newName() const;
private:
QString m_defaultName;
const QString m_defaultName;
Ui::RenameFavoriteDialog ui;
};
......
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