本文整理汇总了C++中AsyncOp::isFinished方法的典型用法代码示例。如果您正苦于以下问题:C++ AsyncOp::isFinished方法的具体用法?C++ AsyncOp::isFinished怎么用?C++ AsyncOp::isFinished使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AsyncOp
的用法示例。
在下文中一共展示了AsyncOp::isFinished方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: process
void DiscoverRouterSoapOp::process()
{
QStringList ls1;
QList<QVariantMap> ls2;
for (int i = 0; i < m_opList.count(); i++)
{
AsyncOp *op = m_opList.at(i);
if (op->isFinished() && op->result() == NoError)
{
ls1.append(m_ls.at(i));
ls2.append(op->values());
}
}
if (ls1.isEmpty())
{
LOG_DEBUG(QString::fromUtf8("No router found!"));
notifyFinished(UnknownError);
return;
}
QSet<QString> set1;
int count = ls1.count();
int i = 0;
while (i < count)
{
const QVariantMap& varMap = ls2.at(i);
QString mac = varMap.value(QLatin1String("newwlanmacaddress")).toString().toUpper();
if (set1.find(mac) == set1.end())
{
set1.insert(mac);
i++;
}
else
{
ls1.removeAt(i);
ls2.removeAt(i);
count--;
}
}
int matchIndex = -1;
QVariantList fullList;
LOG_DEBUG(QString::fromUtf8("found %1 router(s)").arg(ls1.count()));
for (int i = 0; i < ls1.count(); i++)
{
QString hostName = ls1.at(i);
QVariantMap varMap = ls2.at(i);
varMap.insert(QLatin1String("soapHostName"), hostName);
QString mac = varMap.value(QLatin1String("newwlanmacaddress")).toString().toUpper();
fullList.push_back(varMap);
m_mac = mac;
//if (!m_mac.isNull() && mac.compare(m_mac, Qt::CaseInsensitive) == 0) {
matchIndex = i;
//}
LOG_DEBUG(QString::fromUtf8("%1 [%2]").arg(hostName).arg(mac));
}
setValue("fullList", fullList);
setValue("matchIndex", matchIndex);
notifyFinished(NoError);
}