本文整理汇总了C++中KviPointerList类的典型用法代码示例。如果您正苦于以下问题:C++ KviPointerList类的具体用法?C++ KviPointerList怎么用?C++ KviPointerList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了KviPointerList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: removeAllModuleAppHandlers
void KviKvsEventManager::removeAllModuleAppHandlers(KviKvsModuleInterface *pIface)
{
KviKvsEventHandler * h;
for(unsigned int i =0;i< KVI_KVS_NUM_APP_EVENTS;i++)
{
if(!m_appEventTable[i].handlers())continue;
KviPointerList<KviKvsEventHandler> l;
l.setAutoDelete(false);
for(h = m_appEventTable[i].handlers()->first();h;h = m_appEventTable[i].handlers()->next())
{
if(h->type() == KviKvsEventHandler::Module)
{
if(((KviKvsModuleEventHandler *)h)->moduleInterface() == pIface)
{
l.append(h);
}
}
// COMPAT
/*
} else if(h->type() == KviKvsEventHandler::OldModule)
{
if(((KviKvsOldModuleEventHandler *)h)->module() == pIface)
{
l.append(h);
}
}
*/
// END COMPAT
}
for(h = l.first();h;h = l.next())m_appEventTable[i].removeHandler(h);
}
}
示例2: removeAllScriptRawHandlers
void KviKvsEventManager::removeAllScriptRawHandlers()
{
for(auto & i : m_rawEventTable)
{
if(i)
{
KviPointerList<KviKvsEventHandler> dl;
dl.setAutoDelete(false);
KviKvsEventHandler * e;
for(e = i->first(); e; e = i->next())
{
if(e->type() == KviKvsEventHandler::Script)
dl.append(e);
}
for(e = dl.first(); e; e = dl.next())
{
i->removeRef(e);
}
if(i->isEmpty())
{
delete i;
i = nullptr;
}
}
}
}
示例3: removeAllScriptRawHandlers
void KviKvsEventManager::removeAllScriptRawHandlers()
{
for(int i=0;i< KVI_KVS_NUM_RAW_EVENTS;i++)
{
if(m_rawEventTable[i])
{
KviPointerList<KviKvsEventHandler> dl;
dl.setAutoDelete(false);
KviKvsEventHandler * e;
for(e = m_rawEventTable[i]->first();e;e = m_rawEventTable[i]->next())
{
if(e->type() == KviKvsEventHandler::Script)dl.append(e);
}
for(e = dl.first();e;e = dl.next())
{
m_rawEventTable[i]->removeRef(e);
}
if(m_rawEventTable[i]->isEmpty())
{
delete m_rawEventTable[i];
m_rawEventTable[i] = 0;
}
}
}
}
示例4: removeAllModuleRawHandlers
void KviKvsEventManager::removeAllModuleRawHandlers(KviKvsModuleInterface * pIface)
{
KviKvsEventHandler * h;
for(auto & i : m_rawEventTable)
{
if(!i)
continue;
KviPointerList<KviKvsEventHandler> l;
l.setAutoDelete(false);
for(h = i->first(); h; h = i->next())
{
if(h->type() == KviKvsEventHandler::Module)
{
if(((KviKvsModuleEventHandler *)h)->moduleInterface() == pIface)
{
l.append(h);
}
}
}
for(h = l.first(); h; h = l.next())
i->removeRef(h);
if(i->isEmpty())
{
delete i;
i = nullptr;
}
}
}
示例5: it
void KviModuleExtensionManager::unregisterExtensionsByModule(KviModule * m)
{
KviPointerHashTableIterator<const char *,KviModuleExtensionDescriptorList> it(*m_pExtensionDict);
KviPointerList<KviCString> dying;
dying.setAutoDelete(true);
while(KviModuleExtensionDescriptorList * l = it.current())
{
KviPointerList<KviModuleExtensionDescriptor> dying2;
dying2.setAutoDelete(true);
for(KviModuleExtensionDescriptor * d = l->first();d;d = l->next())
{
if(d->module() == m)dying2.append(d);
}
for(KviModuleExtensionDescriptor * de = dying2.first();de;de = dying2.next())
{
l->removeRef(de);
}
if(l->isEmpty())dying.append(new KviCString(it.currentKey()));
++it;
}
for(KviCString * li = dying.first();li;li = dying.next())
{
m_pExtensionDict->remove(li->ptr());
}
}
示例6: cfg
void KviKvsAliasManager::load(const QString & filename)
{
m_pAliasDict->clear();
KviConfigurationFile cfg(filename,KviConfigurationFile::Read);
KviConfigurationFileIterator it(*(cfg.dict()));
KviPointerList<QString> l;
l.setAutoDelete(true);
while(it.current())
{
l.append(new QString(it.currentKey()));
++it;
}
for(QString * s = l.first();s;s = l.next())
{
cfg.setGroup(*s);
QString szCode = cfg.readEntry("_Buffer","");
if(!szCode.isEmpty())
{
KviKvsScript * m = new KviKvsScript(*s,szCode);
m_pAliasDict->insert(*s,m);
}
++it;
}
}
示例7: killAllObjectsWithClass
void KviKvsObjectController::killAllObjectsWithClass(KviKvsObjectClass * pClass)
{
if(!m_pObjectDict)
return; // no more objects at all...
KviPointerList< QPointer<KviKvsObject> > lDying;
lDying.setAutoDelete(true);
KviKvsObject * pObject;
for(pObject = m_pTopLevelObjectList->first();pObject;pObject = m_pTopLevelObjectList->next())
{
if(pObject->getClass() == pClass)
{
lDying.append(new QPointer<KviKvsObject>(pObject));
} else {
pObject->killAllChildrenWithClass(pClass);
}
}
for(QPointer<KviKvsObject> * pObject = lDying.first();pObject;pObject = lDying.next())
{
if(pObject->isNull())
continue; // already dead ?
(*pObject)->dieNow();
}
}
示例8: theme_kvs_cmd_pack
static bool theme_kvs_cmd_pack(KviKvsModuleCommandCall * c)
{
QString szPath, szName, szVersion, szDescription, szAuthor, szImage;
KviKvsArrayCast aCast;
KVSM_PARAMETERS_BEGIN(c)
KVSM_PARAMETER("package_path", KVS_PT_NONEMPTYSTRING, 0, szPath)
KVSM_PARAMETER("package_name", KVS_PT_NONEMPTYSTRING, 0, szName)
KVSM_PARAMETER("package_version", KVS_PT_NONEMPTYSTRING, 0, szVersion)
KVSM_PARAMETER("package_description", KVS_PT_STRING, 0, szDescription)
KVSM_PARAMETER("package_author", KVS_PT_NONEMPTYSTRING, 0, szAuthor)
KVSM_PARAMETER("package_image", KVS_PT_STRING, 0, szImage)
KVSM_PARAMETER("theme", KVS_PT_ARRAYCAST, 0, aCast)
KVSM_PARAMETERS_END(c)
KviKvsArray * pArray = aCast.array();
if((!pArray) || (pArray->size() < 1))
{
c->error(__tr2qs_ctx("No themes specified", "theme"));
return false;
}
kvs_uint_t s = pArray->size();
QStringList lThemeList;
for(kvs_uint_t i = 0; i < s; i++)
{
KviKvsVariant * v = pArray->at(i);
if(!v)
continue; // ?
QString szVal;
v->asString(szVal);
if(szVal.isEmpty())
continue;
lThemeList.append(szVal);
}
KviPointerList<KviThemeInfo> lThemeInfoList;
lThemeInfoList.setAutoDelete(true);
Q_FOREACH(QString szTheme, lThemeList)
{
KviThemeInfo * pInfo = new KviThemeInfo();
if(!pInfo->load(szTheme, KviThemeInfo::External))
{
QString szErr = pInfo->lastError();
c->error(__tr2qs_ctx("Failed to load theme from directory %Q: %Q", "theme"), &szTheme, &szErr);
delete pInfo;
return false;
}
lThemeInfoList.append(pInfo);
}
示例9: removeClicked
void KviChannelListSelector::removeClicked()
{
KviPointerList<QTreeWidgetItem> lst;
QList<QTreeWidgetItem *> items=m_pTreeWidget->selectedItems () ;
for (int i=0;i<items.count();i++)
{
lst.append((QTreeWidgetItem *)items.at(i));
}
lst.setAutoDelete(true);
lst.clear();
}
示例10: lagCheckAbort
void KviLagMeter::lagCheckAbort(const char * key)
{
KviPointerList<KviLagCheck> l;
l.setAutoDelete(false);
KviLagCheck * c;
if(_OUTPUT_PARANOIC)
m_pConnection->console()->output(KVI_OUT_VERBOSE,__tr2qs("Lag check aborted (%s)"),key);
for(c = m_pCheckList->first();c;c = m_pCheckList->next())
if(kvi_strEqualCS(c->szKey.ptr(),key))l.append(c);
for(c = l.first();c;c = l.next())m_pCheckList->removeRef(c);
}
示例11: packTheme
void ThemeManagementDialog::packTheme()
{
KviPointerList<KviThemeInfo> dl;
dl.setAutoDelete(false);
QList<QListWidgetItem*> itemsSelected = m_pListWidget->selectedItems ();
for(int i=0;i<itemsSelected.count();i++)
dl.append(((ThemeListWidgetItem *)itemsSelected.at(i))->themeInfo());
if(dl.isEmpty())return;
PackThemeDialog * pDialog = new PackThemeDialog(this,&dl);
pDialog->exec();
pDialog->deleteLater();
}
示例12: it
void KviModuleManager::unloadAllModules()
{
KviPointerHashTableIterator<QString,KviModule> it(*m_pModuleDict);
KviPointerList<KviModule> lModulesToUnload;
lModulesToUnload.setAutoDelete(false);
while(KviModule * pModule = it.current())
{
lModulesToUnload.append(pModule);
++it;
}
for(KviModule * pModule = lModulesToUnload.first();pModule;pModule = lModulesToUnload.next())
unloadModule(pModule);
}
示例13: completeModuleCommand
void KviKvsKernel::completeModuleCommand(const QString &szModuleName,const QString &szCommandBegin,KviPointerList<QString> * pMatches)
{
KviModule * pModule = g_pModuleManager->getModule(szModuleName);
if(!pModule)return;
KviPointerList<QString> lModuleMatches;
lModuleMatches.setAutoDelete(true);
pModule->completeCommand(szCommandBegin,&lModuleMatches);
for(QString * pszModuleMatch = lModuleMatches.first();pszModuleMatch;pszModuleMatch = lModuleMatches.next())
{
QString * pszMatch = new QString(*pszModuleMatch);
pszMatch->prepend(".");
pszMatch->prepend(szModuleName);
pMatches->append(pszMatch);
}
}
示例14: killAllKvsUserActions
void KviActionManager::killAllKvsUserActions()
{
KviPointerList<KviKvsUserAction> dying;
dying.setAutoDelete(true);
KviPointerHashTableIterator<QString, KviAction> it(*m_pActions);
while(KviAction * a = it.current())
{
if(a->isKviUserActionNeverOverrideThis())
{
dying.append(((KviKvsUserAction *)a));
}
++it;
}
dying.clear(); // bye :)
}
示例15: findPage
KviTalWizardPageData * findPage(QWidget * pWidget)
{
for(KviTalWizardPageData * pData = pPageList->first();pData;pData = pPageList->next())
{
if(pData->pWidget == pWidget) return pData;
}
return NULL;
}