本文整理汇总了C++中AsyncOp::value方法的典型用法代码示例。如果您正苦于以下问题:C++ AsyncOp::value方法的具体用法?C++ AsyncOp::value怎么用?C++ AsyncOp::value使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AsyncOp
的用法示例。
在下文中一共展示了AsyncOp::value方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: notifyFinished
void CheckRouterSoapOp::onGetInfo3Finished()
{
AsyncOp *op = m_op;
m_op->deleteLater();
m_op = NULL;
if (op->isAborted())
{
LOG_DEBUG(QString::fromUtf8("CheckRouterSoapOp::onGetInfo3Finished() aborted"));
return;
}
int result = op->result();
LOG_DEBUG(QString::fromUtf8("CheckRouterSoapOp::onGetInfo3Finished() %1").arg(result));
if (result != NoError)
{
return notifyFinished(UnknownError);
}
bool ok;
int responseCode = op->value("responseCode").toInt(&ok);
if (!ok || responseCode != 0)
{
LOG_DEBUG(QString::fromUtf8("CheckRouterSoapOp::onGetInfo3Finished() response error: %1 %2").arg(responseCode).arg(ok));
return notifyFinished(result);
}
m_values.unite(qvariant_cast<QVariantMap>(op->value("response")));
setValues(m_values);
notifyFinished(result);
}
示例2: onGetKeysFinished
void ChangeRouterPasswordOp::onGetKeysFinished()
{
AsyncOp *op = m_op;
m_op->deleteLater();
m_op = NULL;
if (isAborted())
{
return;
}
int result = op->result();
if (result != NoError)
{
return notifyFinished(result);
}
QVariant varResponseCode = op->value("responseCode");
if (!varResponseCode.isValid())
{
return notifyFinished(UnknownError);
}
bool ok;
int responseCode = varResponseCode.toInt(&ok);
if (!ok)
{
return notifyFinished(UnknownError);
}
if (responseCode != 0)
{
return notifyFinished(UnknownError);
}
QVariant varResponse = op->value("response");
if (!varResponse.isValid())
{
return notifyFinished(UnknownError);
}
QVariantMap resp = qvariant_cast<QVariantMap>(varResponse);
m_currentWifiKey = resp.value(QLatin1String("NewWPAPassphrase")).toString();
m_bean->m_soapCore->setWrappedMode(false);
m_op = m_bean->m_soapCore->invoke(QLatin1String("LANConfigSecurity"), QLatin1String("GetInfo"));
connect(m_op, SIGNAL(finished()), SLOT(onGetLanInfoFinished()));
}
示例3: onSoapFinished
void ChangeRouterWanSettingsOp::onSoapFinished()
{
AsyncOp *op = m_op;
m_op->deleteLater();
m_op = NULL;
if (isAborted())
{
return;
}
int result = op->result();
if (result != NoError)
{
return notifyFinished(result);
}
QVariant varResponseCode = op->value("responseCode");
if (!varResponseCode.isValid())
{
return notifyFinished(UnknownError);
}
bool ok;
int responseCode = varResponseCode.toInt(&ok);
if (!ok)
{
return notifyFinished(UnknownError);
}
notifyFinished(NoError);
}
示例4: onDiscoverRouterFinished
void ReconnectRouterOp::onDiscoverRouterFinished()
{
AsyncOp *op = m_op;
m_op->deleteLater();
m_op = NULL;
if (isAborted())
{
LOG_DEBUG(QString::fromUtf8("discoverRouter self aborted!"));
return;
}
if (op->isAborted())
{
LOG_DEBUG(QString::fromUtf8("discoverRouter op aborted!"));
return notifyFinished(AbortedError);
}
int result = op->result();
LOG_DEBUG(QString::fromUtf8("discoverRouterSoap result: %1").arg(result));
if (result != NoError)
{
return retry();
}
int matchIndex = op->value("matchIndex").toInt();
LOG_DEBUG(QString::fromUtf8("matchIndex %1").arg(matchIndex));
if (matchIndex < 0)
{
return retry();
}
copyValues(op);
notifyFinished(NoError);
}
示例5: onSetWLANFinished
void ChangeRouterWifiPasswordOp::onSetWLANFinished()
{
AsyncOp *op = m_op;
m_op->deleteLater();
m_op = NULL;
if (isAborted())
{
return;
}
int result = op->result();
LOG_DEBUG(QString::fromUtf8("onSetWLANFinished %1").arg(result));
if (result != NoError)
{
return notifyFinished(result);
}
QVariant varResponseCode = op->value("responseCode");
if (!varResponseCode.isValid())
{
return notifyFinished(UnknownError);
}
bool ok;
int responseCode = varResponseCode.toInt(&ok);
if (!ok)
{
return notifyFinished(UnknownError);
}
if (responseCode != 0)
{
return notifyFinished(UnknownError);
}
if (m_configFinish)
{
m_op = m_bean->m_soapCore->invoke(QLatin1String("DeviceConfig"), QLatin1String("ConfigurationFinished"), QLatin1String("NewStatus"), QLatin1String("ChangesApplied"));
connect(m_op, SIGNAL(finished()), SLOT(onCommitFinished()));
connect(&m_timer1, SIGNAL(timeout()), SLOT(onTimeout1()));
m_timer1.setSingleShot(true);
m_timer1.start(8000);
}
else
{
notifyFinished(NoError);
}
}
示例6: onConfigOutFinished
void ChangeRouterPasswordOp::onConfigOutFinished()
{
m_timer1.stop();
AsyncOp *op = m_op;
m_op->deleteLater();
m_op = NULL;
if (op->isAborted())
{
return;
}
if (isAborted())
{
return;
}
int result = op->result();
if (result != NoError)
{
return notifyFinished(result);
}
QVariant varResponseCode = op->value("responseCode");
if (!varResponseCode.isValid())
{
return notifyFinished(UnknownError);
}
bool ok;
int responseCode = varResponseCode.toInt(&ok);
if (!ok)
{
return notifyFinished(UnknownError);
}
// if (responseCode != 0) {
// return notifyFinished(UnknownError);
// }
// notifyFinished(NoError);
updateProfile();
}
示例7: onWifiConfigFinished
void ChangeRouterPasswordOp::onWifiConfigFinished()
{
AsyncOp *op = m_op;
m_op->deleteLater();
m_op = NULL;
if (isAborted())
{
return;
}
int result = op->result();
if (result != NoError)
{
return notifyFinished(result);
}
QVariant varResponseCode = op->value("responseCode");
if (!varResponseCode.isValid())
{
return notifyFinished(UnknownError);
}
bool ok;
int responseCode = varResponseCode.toInt(&ok);
if (!ok)
{
return notifyFinished(UnknownError);
}
if (responseCode != 0)
{
return notifyFinished(UnknownError);
}
if (!m_adminPassword.isNull())
{
startAdminConfig();
}
else
{
startConfigOut();
}
}
示例8: onConfigStarted
void RestartRouterOp::onConfigStarted()
{
AsyncOp *op = m_op;
m_op->deleteLater();
m_op = NULL;
if (isAborted())
{
return;
}
int result = op->result();
LOG_DEBUG(QString::fromUtf8("onConfigStarted %1").arg(result));
if (result != NoError)
{
return notifyFinished(result);
}
QVariant varResponseCode = op->value("responseCode");
if (!varResponseCode.isValid())
{
return notifyFinished(UnknownError);
}
bool ok;
int responseCode = varResponseCode.toInt(&ok);
if (!ok)
{
return notifyFinished(UnknownError);
}
if (responseCode != 0)
{
return notifyFinished(UnknownError);
}
m_op = m_bean->m_soapCore->invoke(QLatin1String("DeviceConfig"), QLatin1String("ConfigurationFinished"), QLatin1String("NewStatus"), QLatin1String("RebootRequired"));
connect(m_op, SIGNAL(finished()), SLOT(onConfigFinished()));
}
示例9: onConfigFinished
void RestartRouterOp::onConfigFinished()
{
AsyncOp *op = m_op;
m_op->deleteLater();
m_op = NULL;
if (isAborted())
{
return;
}
int result = op->result();
LOG_DEBUG(QString::fromUtf8("onConfigFinished %1").arg(result));
if (result != NoError)
{
return notifyFinished(result);
}
QVariant varResponseCode = op->value("responseCode");
if (!varResponseCode.isValid())
{
return notifyFinished(UnknownError);
}
bool ok;
int responseCode = varResponseCode.toInt(&ok);
if (!ok)
{
return notifyFinished(UnknownError);
}
if (responseCode != 0)
{
return notifyFinished(UnknownError);
}
notifyFinished(NoError);
}
示例10: onGetLanInfoFinished
void ChangeRouterPasswordOp::onGetLanInfoFinished()
{
AsyncOp *op = m_op;
m_op->deleteLater();
m_op = NULL;
if (isAborted())
{
return;
}
int result = op->result();
if (result != NoError)
{
return notifyFinished(result);
}
QVariant varResponseCode = op->value("responseCode");
if (!varResponseCode.isValid())
{
return notifyFinished(UnknownError);
}
bool ok;
int responseCode = varResponseCode.toInt(&ok);
if (!ok)
{
return notifyFinished(UnknownError);
}
if (responseCode != 0)
{
return notifyFinished(UnknownError);
}
QVariant varResponse = op->value("response");
if (!varResponse.isValid())
{
return notifyFinished(UnknownError);
}
QVariantMap resp = qvariant_cast<QVariantMap>(varResponse);
/* if (!m_wifiPassword.isNull()) {
if (m_currentWifiKey != m_oldWifiPassword) {
return notifyFinished(InvalidWifiPasswordError);
}
}
*/
if (!m_adminPassword.isNull())
{
QString oldAdminPassword = resp.value(QLatin1String("NewPassword")).toString();
if (oldAdminPassword != m_oldAdminPassword)
{
return notifyFinished(InvalidAdminPasswordError);
}
}
m_bean->m_soapCore->setWrappedMode(false);
m_op = m_bean->m_soapCore->invoke(QLatin1String("DeviceConfig"), QLatin1String("ConfigurationStarted"), QStringList(QLatin1String("NewSessionID")), QStringList(m_bean->m_soapCore->sessionId()));
LOG_DEBUG(QString::fromUtf8("ConfigurationStarted ssid: %1").arg(m_bean->m_soapCore->sessionId()));
connect(m_op, SIGNAL(finished()), SLOT(onConfigInFinished()));
}
示例11: onGetInfoFinished
void ChangeRouterWifiPasswordOp::onGetInfoFinished()
{
AsyncOp *op = m_op;
m_op->deleteLater();
m_op = NULL;
if (isAborted())
{
return;
}
int result = op->result();
LOG_DEBUG(QString::fromUtf8("onGetInfoFinished %1").arg(result));
if (result != NoError)
{
return notifyFinished(result);
}
QVariant varResponseCode = op->value("responseCode");
if (!varResponseCode.isValid())
{
return notifyFinished(UnknownError);
}
bool ok;
int responseCode = varResponseCode.toInt(&ok);
if (!ok)
{
return notifyFinished(UnknownError);
}
if (responseCode != 0)
{
return notifyFinished(UnknownError);
}
QVariant varResponse = op->value("response");
if (!varResponse.isValid())
{
return notifyFinished(UnknownError);
}
QVariantMap response = qvariant_cast<QVariantMap>(varResponse);
QString ssid = m_ssid.isNull() ? response.value(QLatin1String("NewSSID")).toString() : m_ssid;
QStringList paramNames;
QStringList paramValues;
paramNames << QLatin1String("NewSSID") << QLatin1String("NewRegion") << QLatin1String("NewChannel") << QLatin1String("NewWirelessMode");
paramValues << ssid << response.value(QLatin1String("NewRegion")).toString() << response.value(QLatin1String("NewChannel")).toString() << response.value(QLatin1String("NewWirelessMode")).toString();
QString actionName;
if (m_password.isNull())
{
actionName = QLatin1String("SetWLANNoSecurity");
}
else
{
actionName = QLatin1String("SetWLANWPAPSKByPassphrase");
paramNames << QLatin1String("NewWPAEncryptionModes") << QLatin1String("NewWPAPassphrase");
paramValues << QLatin1String("WPA2-PSK") << m_password;
}
m_bean->m_soapCore->setWrappedMode(false);
m_op = m_bean->m_soapCore->invoke(NS_WLANConfiguration, actionName, paramNames, paramValues);
connect(m_op, SIGNAL(finished()), SLOT(onSetWLANFinished()));
}