MCPcopy Create free account
hub / github.com/KangLin/RabbitRemoteControl / AppendPlugin

Method AppendPlugin

Src/Manager.cpp:330–361  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

328}
329
330int CManager::AppendPlugin(CPlugin *p)
331{
332 if(!p) return -1;
333 m_Plugins.insert(p->Id(), p);
334 //p->InitTranslator();
335 int val = 0;
336 bool bRet = QMetaObject::invokeMethod(
337 p,
338 "InitTranslator",
339 Qt::DirectConnection,
340 Q_RETURN_ARG(int, val));
341 if(!bRet || val)
342 {
343 qCritical(log) << "The plugin" << p->Name()
344 << "initial translator fail" << bRet << val;
345 }
346
347 m_szDetails += "### " + p->DisplayName() + "\n";
348 m_szDetails += "- " + tr("Version:") + " " + p->Version() + "\n";
349 m_szDetails += "- " + tr("Type:") + " " + p->TypeName(p->Type()) + "\n";
350 if(!p->Protocol().isEmpty())
351 m_szDetails += "- " + tr("Protocol:") + " " + p->Protocol() + "\n";
352 m_szDetails += "- " + tr("ID:") + " " + p->Id() + "\n";
353 if(!p->Description().isEmpty())
354 m_szDetails += "- " + tr("Description:") + " " + p->Description() + "\n";
355
356 if(!p->Details().isEmpty())
357 m_szDetails += p->Details() + "\n";
358
359 bRet = connect(p, &CPlugin::sigNewOperate, this, &CManager::sigNewOperate);
360 return 0;
361}
362
363//! [CManager CreateOperate]
364COperate* CManager::CreateOperate(const QString& id)

Callers

nothing calls this directly

Calls 10

TypeNameMethod · 0.80
IdMethod · 0.45
NameMethod · 0.45
DisplayNameMethod · 0.45
VersionMethod · 0.45
TypeMethod · 0.45
isEmptyMethod · 0.45
ProtocolMethod · 0.45
DescriptionMethod · 0.45
DetailsMethod · 0.45

Tested by

no test coverage detected