File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616
1717void AiPlugin::initialize ()
1818{
19+ // load Ai service.
20+ QString errStr;
21+ auto &ctx = dpfInstance.serviceContext ();
22+ if (!ctx.load (dpfservice::AiService::name (), &errStr)) {
23+ qCritical () << errStr;
24+ }
1925}
2026
2127bool AiPlugin::start ()
2228{
2329 using namespace dpfservice ;
2430 auto aiService = dpfGetService (AiService);
31+ if (!aiService)
32+ return false ;
33+
2534 auto impl = AiManager::instance ();
2635 using namespace std ::placeholders;
2736 aiService->getAllModel = std::bind (&AiManager::getAllModel, impl);
Original file line number Diff line number Diff line change 1212#include " services/window/windowservice.h"
1313#include " services/option/optionservice.h"
1414#include " services/option/optiondatastruct.h"
15- #include " services/ai/aiservice.h"
1615#include " services/editor/editorservice.h"
1716#include " copilot.h"
1817
@@ -27,12 +26,6 @@ using namespace dpfservice;
2726
2827void ChatPlugin::initialize ()
2928{
30- // load Ai service.
31- QString errStr;
32- auto &ctx = dpfInstance.serviceContext ();
33- if (!ctx.load (AiService::name (), &errStr)) {
34- qCritical () << errStr;
35- }
3629}
3730
3831bool ChatPlugin::start ()
You can’t perform that action at this time.
0 commit comments