1
0
Fork 0

Sentry: correct breadcrumbs for menu item activates.

This commit is contained in:
James Turner 2021-04-08 07:16:06 +01:00
parent c951f3fcf4
commit 28f562d0ec
2 changed files with 6 additions and 4 deletions

View file

@ -12,6 +12,7 @@
#include <Main/fg_props.hxx>
#include <GUI/CocoaHelpers_private.h>
#include <Main/sentryIntegration.hxx>
#include <iostream>
@ -222,7 +223,10 @@ void FGCocoaMenuBar::CocoaMenuBarPrivate::fireBindingsForItem(NSMenuItem *item)
if (it == itemBindings.end()) {
return;
}
NSString* label = [item title];
const auto s = stdStringFromCocoa(label);
flightgear::addSentryBreadcrumb("fire menu item:" + s, "info");
fireBindingList(it->second);
}

View file

@ -161,9 +161,7 @@ FGPUIMenuBar::fireItem (puObject * item)
const char * name = item->getLegend();
vector<SGBinding *> &bindings = _bindings[name];
int nBindings = bindings.size();
const string label = item->getLabel() ? string{ item->getLabel() } : "<unknown>";
flightgear::addSentryBreadcrumb("fire menu item:" + label, "info");
flightgear::addSentryBreadcrumb("fire menu item:" + string{name}, "info");
for (int i = 0; i < nBindings; i++)
bindings[i]->fire();