Exemple #1
0
void VInfoRequest::onRequestFinished()
{
	Vreen::Reply *reply = qobject_cast<Vreen::Reply*>(sender());
	m_data = reply->response().toList().value(0).toMap();
	ensureAddress(Country);
	ensureAddress(City);
	if (m_unknownCount == 0)
		setState(InfoRequest::RequestDone);
}
Exemple #2
0
    void testRequest()
    {
        VREEN_CREATE_CLIENT();

        if (!client.isOnline())
            QFAIL("Client is offline!");

		Vreen::Reply *reply = client.request("getUserSettings");
        connect(reply, SIGNAL(resultReady(QVariant)), &loop, SLOT(quit()));
        loop.exec();
        QCOMPARE(reply->response().toInt() > 6, true);
    }
Exemple #3
0
void VInfoRequest::onAddressEnsured()
{
	Vreen::Reply *reply = qobject_cast<Vreen::Reply*>(sender());
	QString field = reply->property("field").toString();
	qptrdiff tmp = reply->property("mapper").value<qptrdiff>();
	FuncPointerHelper *helper = reinterpret_cast<FuncPointerHelper*>(tmp);
	QVariantMap data = reply->response().toList().value(0).toMap();
	QString name = data.value("name").toString();
	m_data.insert(field, name);
	helper->mapper->insert(data.value("cid").toInt(), new QString(name));
	delete helper;
	m_unknownCount--;
	if (m_unknownCount == 0)
		setState(InfoRequest::RequestDone);
}