]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Consti'fy
authorLaurent Montel <montel@kde.org>
Fri, 11 Jan 2019 06:03:26 +0000 (07:03 +0100)
committerLaurent Montel <montel@kde.org>
Fri, 11 Jan 2019 06:03:26 +0000 (07:03 +0100)
src/kitemviews/kfileitemmodel.cpp
src/kitemviews/kfileitemmodel.h
src/kitemviews/kfileitemmodelrolesupdater.cpp
src/kitemviews/kfileitemmodelrolesupdater.h
src/tests/kitemlistcontrollertest.cpp

index 7c7abe9a7221758df4b6de41b7ca29f45147ad12..61bedfacace298160a07831bdc5d23c0e56c938a 100644 (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());
 
index 3266a49f9246c92bf87201f7421654d715eb41a9..d15cfebc1b8cf14231eedd2e010d84e4f7a818f7 100644 (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;
index f078bc4e47b8b1e943e1ac32307ab38e333dd8de..6e0103c793b54787dd5f9f4535915e3484d81be6 100644 (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);
index 0eef7fcd4f1220a412ac4d1b7c3f157d1e0c819a..9078c8e0d64cdc89607b27b656c46967a919865d 100644 (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,
index c472f128f311fd9847d9c87f9103e5ab9711ba19..2fd71483e9465a23ba4865cfe440d359556f36d5 100644 (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)