From 97419a0d6a3617559d8bb05fc582a3ba7262649e Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Wed, 14 May 2014 21:45:39 -0300 Subject: 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 Signed-off-by: Dirk Hohndel --- qt-ui/profile/profilewidget2.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'qt-ui/profile') diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index 3d55a32ec..473f62d27 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -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(); } - item->hide(); - replot(); } } -- cgit v1.2.3-70-g09d2