示例#1
0
KviModuleExtension * KviModuleExtensionManager::allocateExtension(const KviCString &szType,const KviCString &szName,KviWindow * pWnd,KviPointerHashTable<QString,QVariant> * pParams,void * pSpecial,const QString &preloadModule)
{
	KviModuleExtensionDescriptorList * l = allocateExtensionGetDescriptorList(szType,preloadModule);
	if(!l)return 0;

	KviModuleExtensionDescriptor * d;

	for(d = l->first();d;d = l->next())
	{
		if(d->name().equalsCI(szName))return d->allocate(pWnd,pParams,pSpecial);
	}

	// uhm... not there ?
	g_pModuleManager->loadModulesByCaps(szType.ptr());
	// try again after loading the modules
	// l = m_pExtensionDict->find(szType.ptr()); <--- this shouldn't change!
	for(d = l->first();d;d = l->next())
	{
		if(d->name().equalsCI(szName))return d->allocate(pWnd,pParams,pSpecial);
	}

	// no way : no such extension

	return 0;
}
示例#2
0
KviModuleExtensionDescriptor * KviModuleExtensionManager::findExtensionDescriptor(const KviCString &szType,const KviCString &szName)
{
	KviModuleExtensionDescriptorList * l = m_pExtensionDict->find(szType.ptr());
	if(!l)return 0;

	for(KviModuleExtensionDescriptor * d = l->first();d;d = l->next())
	{
		if(d->name().equalsCI(szName))return d;
	}

	return 0;
}