| 320 | } |
| 321 | |
| 322 | auto NetRequest::abort() -> bool |
| 323 | { |
| 324 | m_state = State::AbortedByUser; |
| 325 | if (m_reply) { |
| 326 | #if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) // QNetworkReply::errorOccurred added in 5.15 |
| 327 | disconnect(m_reply.get(), &QNetworkReply::errorOccurred, nullptr, nullptr); |
| 328 | #else |
| 329 | disconnect(m_reply.get(), QOverload<QNetworkReply::NetworkError>::of(&QNetworkReply::error), nullptr, nullptr); |
| 330 | #endif |
| 331 | m_reply->abort(); |
| 332 | } |
| 333 | return true; |
| 334 | } |
| 335 | |
| 336 | int NetRequest::replyStatusCode() const |
| 337 | { |