当前位置: 首页>>代码示例>>C++>>正文


C++ KviPointerList::first方法代码示例

本文整理汇总了C++中KviPointerList::first方法的典型用法代码示例。如果您正苦于以下问题:C++ KviPointerList::first方法的具体用法?C++ KviPointerList::first怎么用?C++ KviPointerList::first使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在KviPointerList的用法示例。


在下文中一共展示了KviPointerList::first方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: fillTreeWidget

void OptionsDialog::fillTreeWidget(QTreeWidgetItem * p,KviPointerList<OptionsWidgetInstanceEntry> * l,const QString &szGroup,bool bNotContainedOnly)
{
    if(!l)return;

    OptionsDialogTreeWidgetItem * it;
    OptionsWidgetInstanceEntry * e;

    KviPointerList<OptionsWidgetInstanceEntry> tmp;
    tmp.setAutoDelete(false);


    for(e = l->first(); e; e = l->next())
    {
        // must be in the correct group
        // if we want only containers then well.. must be one
        e->bDoInsert = KviQString::equalCI(szGroup,e->szGroup) && ((!bNotContainedOnly) || e->bIsContainer || e->bIsNotContained);
        OptionsWidgetInstanceEntry * ee = tmp.first();
        int idx = 0;
        while(ee)
        {
            if(ee->iPriority >= e->iPriority)break;
            idx++;
            ee = tmp.next();
        }
        tmp.insert(idx,e);
    }

    for(e = tmp.first(); e; e = tmp.next())
    {
        if(e->bDoInsert)
        {
            if(p)it = new OptionsDialogTreeWidgetItem(p,e);
            else it = new OptionsDialogTreeWidgetItem(m_pTreeWidget,e);
            if(!it->m_pOptionsWidget)
            {
                it->m_pOptionsWidget = g_pOptionsInstanceManager->getInstance(it->m_pInstanceEntry,m_pWidgetStack);

                if(it->m_pOptionsWidget)
                    m_pWidgetStack->addWidget(it->m_pOptionsWidget);
            }
        } else {
            it = (OptionsDialogTreeWidgetItem *)p;
        }

        if(e->pChildList)
        {
            if(e->bIsContainer)
            {
                // it's a container: add only eventual not contained children (containers or explicitly marked as not contained)
                fillTreeWidget(it,e->pChildList,szGroup,true);
            } else {
                // it's not a container, add any children
                fillTreeWidget(it,e->pChildList,szGroup,false);
            }
        }
    }
}
开发者ID:xeddmc,项目名称:KVIrc,代码行数:57,代码来源:OptionsDialog.cpp

示例2: 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;
			}
		}
	}
}
开发者ID:namikaze90,项目名称:KVIrc-old,代码行数:27,代码来源:KviKvsEventManager.cpp

示例3: unregisterExtensionsByModule

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());
	}
}
开发者ID:DINKIN,项目名称:KVIrc,代码行数:28,代码来源:KviModuleExtension.cpp

示例4: cleanupUnusedModules

void KviModuleManager::cleanupUnusedModules()
{
	KviPointerHashTableIterator<QString,KviModule> it(*m_pModuleDict);

	KviPointerList<KviModule> lModulesToUnload;
	lModulesToUnload.setAutoDelete(false);

	while(it.current())
	{
		if(it.current()->secondsSinceLastAccess() > KVI_OPTION_UINT(KviOption_uintModuleCleanupTimeout))
		{
			if(it.current()->moduleInfo()->can_unload)
			{
				if((it.current()->moduleInfo()->can_unload)(it.current()))
					lModulesToUnload.append(it.current());
				else {
					// the module don't want to be unloaded
					// keep it memory for a while
					it.current()->updateAccessTime();
				}
			} else {
				if(!(it.current()->isLocked()))
					lModulesToUnload.append(it.current());
			}
		}
		++it;
	}

	for(KviModule * pModule = lModulesToUnload.first();pModule;pModule = lModulesToUnload.next())
		unloadModule(pModule);
}
开发者ID:netrunner-debian-kde-extras,项目名称:kvirc,代码行数:31,代码来源:KviModuleManager.cpp

示例5: 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;
			}
		}
	}
}
开发者ID:AndrioCelos,项目名称:KVIrc,代码行数:28,代码来源:KviKvsEventManager.cpp

示例6: 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;
		}
	}
}
开发者ID:AndrioCelos,项目名称:KVIrc,代码行数:29,代码来源:KviKvsEventManager.cpp

示例7: load

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;
	}
}
开发者ID:DINKIN,项目名称:KVIrc,代码行数:28,代码来源:KviKvsAliasManager.cpp

示例8: 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);
	}
}
开发者ID:namikaze90,项目名称:KVIrc-old,代码行数:34,代码来源:KviKvsEventManager.cpp

示例9: 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();
	}
}
开发者ID:DINKIN,项目名称:KVIrc,代码行数:27,代码来源:KviKvsObjectController.cpp

示例10: findPage

	KviTalWizardPageData * findPage(QWidget * pWidget)
	{
		for(KviTalWizardPageData * pData = pPageList->first();pData;pData = pPageList->next())
		{
			if(pData->pWidget == pWidget) return pData;
		}
		return NULL;
	}
开发者ID:kartagis,项目名称:KVIrc,代码行数:8,代码来源:KviTalWizard.cpp

示例11: cleanup

void KviSharedFilesManager::cleanup()
{
	KviPointerHashTableIterator<QString, KviSharedFileList> it(*m_pSharedListDict);
	time_t curTime = time(nullptr);

	bool bOtherStuffToCleanup = false;

	KviPointerList<QString> lDying;
	lDying.setAutoDelete(true);

	while(KviSharedFileList * l = it.current())
	{
		KviPointerList<KviSharedFile> tmp;
		tmp.setAutoDelete(false);
		for(KviSharedFile * o = l->first(); o; o = l->next())
		{
			if(o->expireTime() > 0)
			{
				if(((int)o->expireTime()) <= ((int)curTime))
				{
					tmp.append(o);
				}
				else
				{
					bOtherStuffToCleanup = true;
				}
			}
		}
		for(KviSharedFile * fo = tmp.first(); fo; fo = tmp.next())
		{
			l->removeRef(fo);
			emit sharedFileRemoved(fo);
		}
		if(l->count() == 0)
			lDying.append(new QString(it.currentKey()));

		++it;
	}

	for(QString * pDyingKey = lDying.first(); pDyingKey; pDyingKey = lDying.next())
		m_pSharedListDict->remove(*pDyingKey);

	if(!bOtherStuffToCleanup)
		m_pCleanupTimer->stop();
}
开发者ID:Cizzle,项目名称:KVIrc,代码行数:45,代码来源:KviSharedFilesManager.cpp

示例12: findFirstEnabledPage

	KviTalWizardPageData * findFirstEnabledPage()
	{
		KviTalWizardPageData * pData;
		for(pData = pPageList->first();pData;pData = pPageList->next())
		{
			if(pData->bEnabled) return pData;
		}
		return NULL;
	}
开发者ID:kartagis,项目名称:KVIrc,代码行数:9,代码来源:KviTalWizard.cpp

示例13: reindexPages

	int reindexPages()
	{
		int iEnabledCount = 0;
		for(KviTalWizardPageData * pData = pPageList->first();pData;pData = pPageList->next())
		{
			if(pData->bEnabled)
			{
				iEnabledCount++;
				pData->iVisibleIndex = iEnabledCount;
			}
		}
		return iEnabledCount;
	}
开发者ID:kartagis,项目名称:KVIrc,代码行数:13,代码来源:KviTalWizard.cpp

示例14: 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);
}
开发者ID:wodim,项目名称:kronos,代码行数:13,代码来源:KviLagMeter.cpp

示例15: unloadAllModules

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);
}
开发者ID:netrunner-debian-kde-extras,项目名称:kvirc,代码行数:15,代码来源:KviModuleManager.cpp


注:本文中的KviPointerList::first方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。