From kfm-devel Mon Sep 16 22:15:49 2013 From: "Commit Hook" Date: Mon, 16 Sep 2013 22:15:49 +0000 To: kfm-devel Subject: Re: Review Request 112728: Move KItemRange to its own header, and factor out the code that transform Message-Id: <20130916221549.21103.46526 () vidsolbach ! de> X-MARC-Message: https://marc.info/?l=kfm-devel&m=137936977620241 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============5052129119790555601==" --===============5052129119790555601== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/112728/ ----------------------------------------------------------- (Updated Sept. 16, 2013, 10:15 p.m.) Status ------ This change has been marked as submitted. Review request for Dolphin. Description ------- There is some code duplication in KFileItemModel: We have two different implementations for the transformation of a sorted QList to a KItemRangeList. I propose to change this by factoring out this code, and moving KItemRange(List) to its own header file while we're at it. It's header-only with inline functions for simplicity and efficiency. Moreover, I made the function that takes the sorted list a template, such that one can easily replace QList by QVector, for example. Note that overriding operator<<() in KItemRangeList was necessary because it's not a typedef for QList, but a class derived from that with my patch, and some code fails to compile if the return type of that function is QList and not KItemRangeList. Diffs ----- dolphin/src/kitemviews/kfileitemmodel.cpp 51ff142 dolphin/src/kitemviews/kitemmodelbase.h 7545192 dolphin/src/kitemviews/kitemmodelbase.cpp c13c9f8 dolphin/src/kitemviews/kitemrange.h PRE-CREATION Diff: http://git.reviewboard.kde.org/r/112728/diff/ Testing ------- Unit tests pass. Thanks, Frank Reininghaus --===============5052129119790555601== Content-Type: text/html; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit
This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/112728/

This change has been marked as submitted.


Review request for Dolphin.
By Frank Reininghaus.

Updated Sept. 16, 2013, 10:15 p.m.

Description

There is some code duplication in KFileItemModel: We have two different implementations for the transformation of a sorted QList<int> to a KItemRangeList.

I propose to change this by factoring out this code, and moving KItemRange(List) to its own header file while we're at it. It's header-only with inline functions for simplicity and efficiency. Moreover, I made the function that takes the sorted list a template, such that one can easily replace QList by QVector, for example.

Note that overriding operator<<() in KItemRangeList was necessary because it's not a typedef for QList<KItemRange>, but a class derived from that with my patch, and some code fails to compile if the return type of that function is QList<KItemRange> and not KItemRangeList.

Testing

Unit tests pass.

Diffs

  • dolphin/src/kitemviews/kfileitemmodel.cpp (51ff142)
  • dolphin/src/kitemviews/kitemmodelbase.h (7545192)
  • dolphin/src/kitemviews/kitemmodelbase.cpp (c13c9f8)
  • dolphin/src/kitemviews/kitemrange.h (PRE-CREATION)

View Diff

--===============5052129119790555601==--