void HTTPRequest connectReply const char func QNetworkReply reply conn

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
void HTTPRequest::connectReply(const char* func, QNetworkReply *reply)
{
connect(reply, SIGNAL(finished()), this, func);
connect(reply, SIGNAL(error(QNetworkReply::NetworkError)),
this, SLOT(fail(QNetworkReply::NetworkError)));
}
bool HTTPRequest::putFile(QSharedPointer<Media> media, QVector<QPair<QString, QString> > fields)
{
if (inProgress) return false;
failed = false;
inProgress = true;
QNetworkRequest req("http://" + QString(CHUNKED_VIDEO_UPLOAD_HOSTNAME) + CHUNKED_VIDEO_UPLOAD_PATH + '/start');
qDebug() << "putFile making request...";
reply = qnam.post(req, formStartPostData(media, fields));
connectReply(SLOT(putFile2()), reply);
return true;
}