2013/12/3 Joel Madigan <notifications@github.com>

> In src/app/ui/editor/moving_pixels_state.cpp:
>
> >
> >    // Add this class as:
> >    // - observer of the UI context: so we know if the user wants to
> >    //   execute other command, so we can drop pixels.
> > -  // - observer of the status bar to know if the user has changed the
> > -  //   transparent color.
> > -  UIContext::instance()->addObserver(this);
> > -  StatusBar::instance()->addObserver(this);
> > -
> > -  // Show controls to modify the "pixels movement" options (e.g. the
> > -  // transparent color).
> > -  StatusBar::instance()->showMovePixelsOptions();
> > +  // - observer of SelectionSettings
> > +  context->addObserver(this);
> > +  context->settings()->selection()->addObserver(this);
>
> This is where SettingsObserver class is used. Per the interface in
> observable.h we define methods for the parts we want to observe and the
> notifying code takes care of which method of SettingsObserver is called.
>
>
> It looks like MovingPixelsState is our SelectionSettingsObserver. See
context->settings()->selection()->addObserver(this); where "this" is our
MovingPixelsState. Check if someone is creating an instance of
MovingPixelState::SettingsObserverImpl in the whole patch.

As a side note: Try to review the whole patch line by line and explain to
yourself (or adding a comment in the code) why we need that specific line
of code there (the "why", not the "what it does").