forked from jeena/FeedTheMonkey
added post
This commit is contained in:
parent
9cab3341b6
commit
5101a426c0
9 changed files with 139 additions and 33 deletions
|
@ -39,14 +39,14 @@ void TinyTinyRSSLogin::reply()
|
|||
|
||||
if (reply) {
|
||||
if (reply->error() == QNetworkReply::NoError) {
|
||||
//read data from reply
|
||||
QJsonDocument json = QJsonDocument::fromBinaryData(reply->readAll());
|
||||
mSessionId = json.toVariant().toMap().value("session_id").toString();
|
||||
emit sessionIdChanged(mSessionId);
|
||||
} else {
|
||||
//get http status code
|
||||
int httpStatus = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
|
||||
//do some error management
|
||||
int httpStatus = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
|
||||
//do some error management
|
||||
qWarning() << "HTTP error: " << httpStatus;
|
||||
}
|
||||
reply->deleteLater();
|
||||
}
|
||||
mSessionId = "1234";
|
||||
emit sessionIdChanged(mSessionId);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue