feat: Python Plugins

This commit is contained in:
Ian Chua
2026-07-02 17:49:36 +08:00
parent 395e070a0e
commit ecddf3d18f
183 changed files with 49955 additions and 2120 deletions

View File

@@ -115,15 +115,11 @@ void NetworkAgent::add_cloud_agent(const std::string& provider, std::shared_ptr<
void NetworkAgent::set_printer_agent(std::shared_ptr<IPrinterAgent> printer_agent)
{
if (!printer_agent) {
return;
}
// Disconnect all callbacks from the old agent
auto old_printer_agent = m_printer_agent;
m_printer_agent = std::move(printer_agent);
m_printer_agent_id = m_printer_agent->get_agent_info().id;
m_printer_agent_id = m_printer_agent ? m_printer_agent->get_agent_info().id : "";
// Disconnect the old agent's connections/threads.
if (old_printer_agent && old_printer_agent != m_printer_agent) {
@@ -131,6 +127,9 @@ void NetworkAgent::set_printer_agent(std::shared_ptr<IPrinterAgent> printer_agen
apply_printer_callbacks(old_printer_agent, {});
}
if (!m_printer_agent)
return;
apply_printer_callbacks(m_printer_agent, m_printer_callbacks);
}