本文整理汇总了C++中PluginInterface::GetEnable方法的典型用法代码示例。如果您正苦于以下问题:C++ PluginInterface::GetEnable方法的具体用法?C++ PluginInterface::GetEnable怎么用?C++ PluginInterface::GetEnable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PluginInterface
的用法示例。
在下文中一共展示了PluginInterface::GetEnable方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadConfig
void Ztamp::LoadConfig()
{
QFile file(configFileName);
if (!file.open(QIODevice::ReadOnly))
{
LogError(QString("Cannot open config file for reading : %1").arg(configFileName));
return;
}
QDataStream in(&file);
in.setVersion(QDataStream::Qt_4_3);
in >> GlobalSettings >> PluginsSettings >> listOfPlugins;
if (in.status() != QDataStream::Ok)
{
LogWarning(QString("Problem when loading config file for ztamp : %1").arg(QString(id.toHex())));
}
// "Load" associated ztamp plugins
foreach(QString s, listOfPlugins)
{
PluginInterface * p = PluginManager::Instance().GetPluginByName(s);
if(p)
{
listOfPluginsPtr.append(p);
if(!p->GetEnable())
LogWarning(QString("Ztamp %1 : '%2' is globally disabled !").arg(QString(GetID()), s));
}
else
LogError(QString("Ztamp %1 has invalid plugin !").arg(QString(GetID())));
}
示例2: ApiError
ApiManager::ApiAnswer * ApiManager::ProcessPluginApiCall(Account const& account, QString const& request, HTTPRequest & hRequest)
{
QStringList list = QString(request).split('/', QString::SkipEmptyParts);
if(list.size() != 2)
return new ApiManager::ApiError(QString("Malformed Plugin Api Call : %1").arg(hRequest.toString()));
QString const& pluginName = list.at(0);
QString const& functionName = list.at(1);
PluginInterface * plugin = PluginManager::Instance().GetPluginByName(pluginName);
if(!plugin)
return new ApiManager::ApiError(QString("Unknown Plugin : %1<br />Request was : %2").arg(pluginName,hRequest.toString()));
if(!plugin->GetEnable())
return new ApiManager::ApiError("This plugin is disabled");
return plugin->ProcessApiCall(account, functionName, hRequest);
}
示例3: ApiError
ApiManager::ApiAnswer * ApiManager::ProcessBunnyApiCall(Account const& account, QString const& request, HTTPRequest const& hRequest)
{
QStringList list = QString(request).split('/', QString::SkipEmptyParts);
if(list.size() < 2)
return new ApiManager::ApiError(QString("Malformed Bunny Api Call : %1").arg(hRequest.toString()));
QByteArray const& bunnyID = list.at(0).toAscii();
if(!account.HasBunnyAccess(bunnyID))
return new ApiManager::ApiError("Access denied to this bunny");
Bunny * b = BunnyManager::GetBunny(bunnyID);
if(list.size() == 2)
{
QByteArray const& functionName = list.at(1).toAscii();
return b->ProcessApiCall(account, functionName, hRequest);
}
else if(list.size() == 3)
{
PluginInterface * plugin = PluginManager::Instance().GetPluginByName(list.at(1).toAscii());
if(!plugin)
return new ApiManager::ApiError(QString("Unknown Plugin : '%1'").arg(list.at(1)));
if(b->HasPlugin(plugin) || ( (plugin->GetType() == PluginInterface::SystemPlugin || plugin->GetType() == PluginInterface::RequiredPlugin ) && plugin->GetEnable()))
{
QByteArray const& functionName = list.at(2).toAscii();
return plugin->ProcessBunnyApiCall(b, account, functionName, hRequest);
}
else
return new ApiManager::ApiError("This plugin is not enabled for this bunny");
}
else
return new ApiManager::ApiError(QString("Malformed Plugin Api Call : %1").arg(hRequest.toString()));
}