Fix compilation with CMake.

This changes are only to make CMake compile again after the
addition of the export dialog.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Create a 'remove_event' function that removes an event.

The logic of removing the event was in the UI, and this makes
the code harder to test because we need to take into account
also the events that the interface is receiving, instead of
only relying on the algorithm to test.

so, now it lives in dive.h/.c and a unittest is easyer to make.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Code Cleanup: Move the Hide/Show ruler to an internal method

By moving the Hide/Show of the ruler to an internal method, we gain a bit
of codecleanuperism by removing a lot of unnecessary calls to their dest
and source drag-handlers.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Remove use of QSettings for ruler visibility, use prefs.rulergraph instead.

The QSettings is a bit bloated on its use, so we are trying to narrow
down the amount of calls to it. We have a preferences struct, use that
instead.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Don't replot every time a pref changes, regardless of what preferences.

The list of preferences that should trigger a full repaint are at the top
of this method, *if* this introduces a bug it is because some of the
preferences are not being correctly triaged yet and that needs to be
fixed.  Regardless of that, now the profile will only enable / disable
the *ruler* instead of replotting everything.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>