예제 #1
0
파일: ajax.cpp 프로젝트: erikku/frosty
void ajax::request(const QUrl& url, const QVariant& req)
{
	if( mRequestQueue.value(url).count() >= 4 )
		dispatchQueue(url);

	mRequestQueue[url].append(req);
	mRequestQueueTimer->start();
}
예제 #2
0
ajax::ajax(QObject *parent_object) : QObject(parent_object)
{
	Q_ASSERT(g_ajax_inst == 0);

	mLog = LogWidget::getSingletonPtr();
	mRequestQueueTimer = new QTimer;
	mRequestQueueTimer->setSingleShot(true);

	connect(mRequestQueueTimer, SIGNAL(timeout()), this, SLOT(dispatchQueue()));

	g_ajax_inst = this;
}
예제 #3
0
파일: ajax.cpp 프로젝트: erikku/frosty
ajax::ajax(QObject *parent_object) : QObject(parent_object)
{
	Q_ASSERT(g_ajax_inst == 0);

	mURL = settings->url();

	mLog = LogWidget::getSingletonPtr();
	mRequestQueueTimer = new QTimer;
	mRequestQueueTimer->setSingleShot(true);

	connect(mRequestQueueTimer, SIGNAL(timeout()), this, SLOT(dispatchQueue()));

	offlineTransfer *transfer = offlineTransfer::inst();

	connect(transfer, SIGNAL(transferFinished(const QVariantMap&,
		const QString&)), this, SIGNAL(response(const QVariantMap&,
		const QString&)), Qt::QueuedConnection);
	connect(transfer, SIGNAL(transferFailed(const QString&)),
		this, SLOT(handleError(const QString&)), Qt::QueuedConnection);

	g_ajax_inst = this;
}