Speed Improvement: hide events instead of replotting everything

The 'Hide Similar Events' function asked the Profile to replot eveything,
only because some events were hidden from the interface. Instead of that
we can simply hide the events since the graph will be the same.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2014-05-14 21:45:39 -03:00 committed by Dirk Hohndel
parent 4bc3687b21
commit 97419a0d6a

View file

@ -796,14 +796,18 @@ void ProfileWidget2::hideEvents()
QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Ok) {
if (event->name) {
for (int i = 0; i < evn_used; i++) {
if (!strcmp(event->name, ev_namelist[i].ev_name)) {
if (same_string(event->name, ev_namelist[i].ev_name)) {
ev_namelist[i].plot_ev = false;
break;
}
}
Q_FOREACH (DiveEventItem *evItem, eventItems) {
if(same_string(evItem->getEvent()->name, event->name))
evItem->hide();
}
} else {
item->hide();
replot();
}
}
}