コード例 #1
0
/* Prepare network-reply: */
void UINetworkRequest::prepareNetworkReply()
{
    /* Make network-request: */
    switch (m_type)
    {
        case UINetworkRequestType_HEAD:
        {
            m_pReply = gNetworkManager->head(m_request);
            break;
        }
        case UINetworkRequestType_GET:
        {
            m_pReply = gNetworkManager->get(m_request);
            break;
        }
        default:
            break;
    }

    /* Prepare listeners for m_pReply: */
    AssertMsg(m_pReply, ("Unable to make network-request!\n"));
    connect(m_pReply, SIGNAL(downloadProgress(qint64, qint64)), this, SLOT(sltHandleNetworkReplyProgress(qint64, qint64)));
    connect(m_pReply, SIGNAL(finished()), this, SLOT(sltHandleNetworkReplyFinish()));

    /* Set as running: */
    m_fRunning = true;

    /* Notify general network-requests listeners: */
    emit sigStarted(m_uuid);
    /* Notify particular network-request listeners: */
    emit sigStarted();
}
コード例 #2
0
/* Prepare network-reply: */
void UINetworkRequest::prepareNetworkReply()
{
    /* Make network-request: */
    m_pReply = new UINetworkReply(m_request, m_type);
    AssertMsg(m_pReply, ("Unable to make network-request!\n"));
    /* Prepare listeners for m_pReply: */
    connect(m_pReply, SIGNAL(downloadProgress(qint64, qint64)), this, SLOT(sltHandleNetworkReplyProgress(qint64, qint64)));
    connect(m_pReply, SIGNAL(finished()), this, SLOT(sltHandleNetworkReplyFinish()));

    /* Set as running: */
    m_fRunning = true;

    /* Notify general network-requests listeners: */
    emit sigStarted(m_uuid);
    /* Notify particular network-request listeners: */
    emit sigStarted();
}
コード例 #3
0
void UINetworkRequest::prepareNetworkReply()
{
    /* Create network-reply: */
    m_pReply = new UINetworkReply(m_type, m_url, m_requestHeaders);
    AssertPtrReturnVoid(m_pReply.data());
    {
        /* Prepare network-reply: */
        connect(m_pReply, SIGNAL(downloadProgress(qint64, qint64)),
                this, SLOT(sltHandleNetworkReplyProgress(qint64, qint64)));
        connect(m_pReply, SIGNAL(finished()), this, SLOT(sltHandleNetworkReplyFinish()));

        /* Mark network-reply as running: */
        m_fRunning = true;

        /* Notify common network-request listeners: */
        emit sigStarted(m_uuid);
        /* Notify own network-request listeners: */
        emit sigStarted();
    }
}