mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
profile: redo eventname handling
The eventname handling code was splattered all over the place. Collect it in a single source file and use C++ idioms to avoid nasty memory management. Provide a C-only interface, however. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
ab7b9329c0
commit
0d3c9954f4
10 changed files with 94 additions and 70 deletions
|
|
@ -4,6 +4,7 @@
|
|||
#include "profile-widget/divepixmapcache.h"
|
||||
#include "profile-widget/animationfunctions.h"
|
||||
#include "core/event.h"
|
||||
#include "core/eventname.h"
|
||||
#include "core/format.h"
|
||||
#include "core/profile.h"
|
||||
#include "core/gettextfromc.h"
|
||||
|
|
@ -225,11 +226,7 @@ bool DiveEventItem::isInteresting(const struct dive *d, const struct divecompute
|
|||
|
||||
bool DiveEventItem::shouldBeHidden()
|
||||
{
|
||||
for (int i = 0; i < evn_used; i++) {
|
||||
if (!strcmp(ev->name, ev_namelist[i].ev_name) && ev_namelist[i].plot_ev == false)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return is_event_hidden(ev->name);
|
||||
}
|
||||
|
||||
void DiveEventItem::recalculatePos()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue