mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-23 06:33:57 -06:00
ENH: optimize track logic
Change-Id: I1fea7eb9681389924c32f3754fc77ee21a3ab898 Signed-off-by: Stone Li <stone.li@bambulab.com>
This commit is contained in:
parent
0a1c597da0
commit
36e0cc0b12
3 changed files with 6 additions and 2 deletions
|
@ -3954,6 +3954,7 @@ void GUI_App::check_track_enable()
|
|||
wxString os_desc = wxGetOsDescription();
|
||||
int major = 0, minor = 0, micro = 0;
|
||||
header_json["os"] = std::string(os_desc.ToUTF8());
|
||||
header_json["name"] = std::string(SLIC3R_APP_NAME);
|
||||
if (m_agent) {
|
||||
m_agent->track_header(header_json.dump());
|
||||
m_agent->track_enable(true);
|
||||
|
|
|
@ -1144,6 +1144,7 @@ int NetworkAgent::get_my_profile(std::string token, unsigned int *http_code, std
|
|||
|
||||
int NetworkAgent::track_enable(bool enable)
|
||||
{
|
||||
enable_track = enable;
|
||||
int ret = 0;
|
||||
if (network_agent && track_enable_ptr) {
|
||||
ret = track_enable_ptr(network_agent, enable);
|
||||
|
@ -1155,6 +1156,9 @@ int NetworkAgent::track_enable(bool enable)
|
|||
|
||||
int NetworkAgent::track_event(std::string evt_key, std::string content)
|
||||
{
|
||||
if (!this->enable_track)
|
||||
return 0;
|
||||
|
||||
int ret = 0;
|
||||
if (network_agent && track_event_ptr) {
|
||||
ret = track_event_ptr(network_agent, evt_key, content);
|
||||
|
|
|
@ -170,9 +170,8 @@ public:
|
|||
int track_event(std::string evt_key, std::string content);
|
||||
int track_header(std::string header);
|
||||
int track_update_property(std::string name, std::string value, std::string type = "string");
|
||||
|
||||
private:
|
||||
|
||||
bool enable_track = false;
|
||||
void* network_agent { nullptr };
|
||||
|
||||
static func_check_debug_consistent check_debug_consistent_ptr;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue