1. 09 Dec, 2020 11 commits
  2. 08 Dec, 2020 7 commits
    • Romain Vimont's avatar
      qt: medialib: merge base list models · 5c7d8711
      Romain Vimont authored and Pierre Lamot's avatar Pierre Lamot committed
      
      
      Since Qt signals/slots are incompatible with templates, the base list
      model was initially split into two parts:
       - MLBaseModel, non-template, with signals/slots
       - MLSlidingWindowModel, template, inheriting MLBaseModel
      
      Now that MLSlidingWindowModel is not template anymore, there is no
      reason to keep it separated. Simplify.
      Signed-off-by: Pierre Lamot's avatarPierre Lamot <pierre@videolabs.io>
      5c7d8711
    • Romain Vimont's avatar
      qt: medialib: do not depend on ListCache header · a408b111
      Romain Vimont authored and Pierre Lamot's avatar Pierre Lamot committed
      
      
      MLSlidingWindowModel has many subclasses. Since it depended on the
      ListCache<T> header, every change in this header caused huge incremental
      compilation times.
      
      Before this commit and the two previous ones, here is the time it took
      on my machine to recompile after touching listcache.hpp:
      
          $ time make -j8
          ...
          real    0m45.001s
          user    4m55.672s
          sys     0m9.414s
      
      After these changes:
      
          $ time make -j8
          real    0m10.676s
          user    0m11.840s
          sys     0m0.946s
      Signed-off-by: Pierre Lamot's avatarPierre Lamot <pierre@videolabs.io>
      a408b111
    • Romain Vimont's avatar
      qt: medialib: move implementation to cpp · 69b13cf0
      Romain Vimont authored and Pierre Lamot's avatar Pierre Lamot committed
      
      
      Now that MLSlidingWindowModel is not template anymore, move its
      implementation to the cpp file.
      Signed-off-by: Pierre Lamot's avatarPierre Lamot <pierre@videolabs.io>
      69b13cf0
    • Romain Vimont's avatar
      qt: medialib: un-templatize MLSlidingWindowModel · 1b186d57
      Romain Vimont authored and Pierre Lamot's avatar Pierre Lamot committed
      
      
      MLSlidingWindowModel was generic over its item type, and with many
      non-template subclasses, each subclasses defining the actual concrete
      type.
      
      Therefore, this static genericity was "internal". In practice, it didn't
      bring a lot a value, but it caused every subclass to recompile
      the whole implementation.
      
      To improve compilation times, remove the template parameter and always
      use the item super-type MLItem. When an item of the concrete type is
      necessary (once per subclass), just cast locally.
      
      This change alone does not improve complitation times significantly,
      because the implementation is still in the header file, which also
      includes the whole ListCache implementation. The following commits will
      solve these problems.
      Signed-off-by: Pierre Lamot's avatarPierre Lamot <pierre@videolabs.io>
      1b186d57
    • Romain Vimont's avatar
      qt: medialib: define a super-type for list items · 985b37d0
      Romain Vimont authored and Pierre Lamot's avatar Pierre Lamot committed
      
      
      Concrete medialib item types are defined by the template parameter on
      MLSlidingWindowModel.
      
      Create a super-type to be able to "untemplatize" MLSlidingWindowModel
      (in order to simplify and improve compilation times).
      
      As a side-effect, this also makes explicit the necessity to define a
      getId() method (called from MLSlidingWindowModel), a constraint which
      could not be explicitly expressed on a template parameter.
      Signed-off-by: Pierre Lamot's avatarPierre Lamot <pierre@videolabs.io>
      985b37d0
    • Romain Vimont's avatar
      qt: medialib: define equality operator on MLItemId · f727ef34
      Romain Vimont authored and Pierre Lamot's avatar Pierre Lamot committed
      
      
      For symmetry, define operator==() in addition to operator!=().
      Signed-off-by: Pierre Lamot's avatarPierre Lamot <pierre@videolabs.io>
      f727ef34
    • Romain Vimont's avatar
      qt: medialib: rename MLParentId to MLItemId · 7fa1de99
      Romain Vimont authored and Pierre Lamot's avatar Pierre Lamot committed
      
      
      The item id sometimes represents the id of the "current" item, sometimes
      the id of the "parent" item. Therefore, the fact that it is a "parent"
      id depends on the context, and is not intrinsic to the type.
      
      This caused confusion when getId() returned a MLParentId, representing
      the id of the current item.
      
      Rename to MLItemId to clarify.
      Signed-off-by: Pierre Lamot's avatarPierre Lamot <pierre@videolabs.io>
      7fa1de99
  3. 07 Dec, 2020 22 commits