MCPcopy Create free account
hub / github.com/RGAA-Software/GoDesk / LoadPanelCompanion

Method LoadPanelCompanion

src/render_panel/gr_application.cpp:463–491  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

461 }
462
463 void GrApplication::LoadPanelCompanion() {
464 auto base_path = QCoreApplication::applicationDirPath();
465#ifdef WIN32
466 auto lib_name = "panel_companion.dll";
467#else
468 auto lib_name = "panel_companion.so";
469#endif
470 auto library = new QLibrary(base_path + "/" + lib_name);
471 library->load();
472 auto fn_get_instance = (FnGetInstance)library->resolve("GetInstance");
473 auto func = (FnGetInstance) fn_get_instance;
474 if (!func) {
475 LOGE("Don't have GetInstance in panel_companion.");
476 return;
477 }
478
479 auto plugin = (PanelCompanion*)func();
480 if (!plugin) {
481 LOGE("Can't exe GetInstance in panel_companion");
482 return;
483 }
484
485 if (!plugin->Init()) {
486 LOGE("Can't init panel_companion");
487 return;
488 }
489 LOGI("Load panel_companion success.");
490 companion_ = plugin;
491 }
492
493 PanelCompanion* GrApplication::GetCompanion() {
494 return companion_;

Callers

nothing calls this directly

Calls 1

InitMethod · 0.45

Tested by

no test coverage detected