Consti'fy

This commit is contained in:
Laurent Montel 2019-01-11 07:03:26 +01:00
parent d099123841
commit e5ebb31e54
5 changed files with 8 additions and 8 deletions

View file

@ -1717,8 +1717,8 @@ bool KFileItemModel::lessThan(const ItemData* a, const ItemData* b, const QColla
return (sortOrder() == Qt::AscendingOrder) ? result < 0 : result > 0;
}
void KFileItemModel::sort(QList<KFileItemModel::ItemData*>::iterator begin,
QList<KFileItemModel::ItemData*>::iterator end) const
void KFileItemModel::sort(const QList<KFileItemModel::ItemData*>::iterator &begin,
const QList<KFileItemModel::ItemData*>::iterator &end) const
{
auto lambdaLessThan = [&] (const KFileItemModel::ItemData* a, const KFileItemModel::ItemData* b)
{
@ -1982,7 +1982,7 @@ QList<QPair<int, QVariant> > KFileItemModel::sizeRoleGroups() const
return groups;
}
QList<QPair<int, QVariant> > KFileItemModel::timeRoleGroups(std::function<QDateTime(const ItemData *)> fileTimeCb) const
QList<QPair<int, QVariant> > KFileItemModel::timeRoleGroups(const std::function<QDateTime(const ItemData *)> &fileTimeCb) const
{
Q_ASSERT(!m_itemData.isEmpty());

View file

@ -371,7 +371,7 @@ private:
* Sorts the items between \a begin and \a end using the comparison
* function lessThan().
*/
void sort(QList<ItemData*>::iterator begin, QList<ItemData*>::iterator end) const;
void sort(const QList<ItemData*>::iterator &begin, const QList<ItemData*>::iterator &end) const;
/**
* Helper method for lessThan() and expandedParentsCountCompare(): Compares
@ -386,7 +386,7 @@ private:
QList<QPair<int, QVariant> > nameRoleGroups() const;
QList<QPair<int, QVariant> > sizeRoleGroups() const;
QList<QPair<int, QVariant> > timeRoleGroups(std::function<QDateTime(const ItemData *)> fileTimeCb) const;
QList<QPair<int, QVariant> > timeRoleGroups(const std::function<QDateTime(const ItemData *)> &fileTimeCb) const;
QList<QPair<int, QVariant> > permissionRoleGroups() const;
QList<QPair<int, QVariant> > ratingRoleGroups() const;
QList<QPair<int, QVariant> > genericStringRoleGroups(const QByteArray& typeForRole) const;

View file

@ -405,7 +405,7 @@ void KFileItemModelRolesUpdater::slotItemsRemoved(const KItemRangeList& itemRang
}
}
void KFileItemModelRolesUpdater::slotItemsMoved(const KItemRange& itemRange, QList<int> movedToIndexes)
void KFileItemModelRolesUpdater::slotItemsMoved(const KItemRange& itemRange, const QList<int> &movedToIndexes)
{
Q_UNUSED(itemRange);
Q_UNUSED(movedToIndexes);

View file

@ -157,7 +157,7 @@ public:
private slots:
void slotItemsInserted(const KItemRangeList& itemRanges);
void slotItemsRemoved(const KItemRangeList& itemRanges);
void slotItemsMoved(const KItemRange& itemRange, QList<int> movedToIndexes);
void slotItemsMoved(const KItemRange& itemRange, const QList<int> &movedToIndexes);
void slotItemsChanged(const KItemRangeList& itemRanges,
const QSet<QByteArray>& roles);
void slotSortRoleChanged(const QByteArray& current,

View file

@ -197,7 +197,7 @@ struct KeyPress {
*/
struct ViewState {
ViewState(int current, const KItemSet selection, bool activated = false) :
ViewState(int current, const KItemSet &selection, bool activated = false) :
m_current(current),
m_selection(selection),
m_activated(activated)