~blue-shell/blue-shell/muon-firefox-apps

Viewing all changes in revision 983.

  • Committer: Jonathan Thomas
  • Date: 2011-11-05 23:21:48 UTC
  • Revision ID: git-v1:6f2e00bd393e591da48bb8c650557d709ba8c4f8
Rework the way that the FilterWidget is populated.
Move from the procedurally-driven population method to a polymorphic method.

Added a "FilterModel" abstract class that acts as an interface for QStandardItemModels
that can be populate()'ed and reload()'ed. Instead of procedurally making
QStandardItemModels inside of FilterWidget::populateFilters(), create CategoryFilter,
StatusFilter and OriginFilter subclasses of the FilterModel class that take care of
the model population. This way we can keep a list of these FilterModels and run a few
for loops over them to populate and reload them.

As a result, adding a new filter category is now as simple as implementing a new
FilterModel subclass, adding it to the list in FilterWidget, and adding the GUI
components/wiring to FitlerWidget. There's also less duplicated procedural code, and
everything should be easier to read.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: