Skip to content

Commit d316258

Browse files
committed
fix: wrong initialize position
Log: Change-Id: Iec6ec233f3564020fe825600d8947390cfe5855e
1 parent 2024cce commit d316258

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

src/plugins/aimanager/aiplugin.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,21 @@
1616

1717
void 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

2127
bool 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);

src/plugins/chat/chat.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
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

2827
void 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

3831
bool ChatPlugin::start()

0 commit comments

Comments
 (0)