void PhoneReg::onCodeRequestDone(const QVariantMap &result) { if (!result.contains("status")) { emit codeFailed(result); } else { if (result["status"].toString() == "sent") { emit codeRequested(result); } else { if (result["status"].toString() == "ok") { emit finished(result); } else { emit codeFailed(result); } } } }
void PhoneReg::onCodeRequestDone(const QVariantMap &result) { if (!result.contains("status")) { emit codeFailed(result); } else { if (result["status"].toString() == "sent") { emit codeRequested(result); listener = new SMSListener(this); QObject::connect(listener,SIGNAL(codeReceived(QString)), this,SLOT(onSMSReceived(QString))); } else { if (result["status"].toString() == "ok") { emit finished(result); } else { emit codeFailed(result); } } } }