@@ -54,7 +54,7 void NetworkController::onProcessRequested(std::shared_ptr<QNetworkRequest> requ | |||||
54 | if (it != impl->m_NetworkReplyToId.cend()) { |
|
54 | if (it != impl->m_NetworkReplyToId.cend()) { | |
55 | impl->lockWrite(); |
|
55 | impl->lockWrite(); | |
56 | qCDebug(LOG_NetworkController()) << tr("Remove for reply: ") |
|
56 | qCDebug(LOG_NetworkController()) << tr("Remove for reply: ") | |
57 | << impl->m_NetworkReplyToId[reply]; |
|
57 | << impl->m_NetworkReplyToId[reply]; | |
58 | impl->m_NetworkReplyToId.erase(reply); |
|
58 | impl->m_NetworkReplyToId.erase(reply); | |
59 | impl->unlock(); |
|
59 | impl->unlock(); | |
60 | // Deletes reply |
|
60 | // Deletes reply | |
@@ -72,8 +72,8 void NetworkController::onProcessRequested(std::shared_ptr<QNetworkRequest> requ | |||||
72 | if (totalBytes > 0) { |
|
72 | if (totalBytes > 0) { | |
73 | double progress = (bytesRead * 100.0) / totalBytes; |
|
73 | double progress = (bytesRead * 100.0) / totalBytes; | |
74 | qCDebug(LOG_NetworkController()) << tr("NetworkController onReplyProgress") << progress |
|
74 | qCDebug(LOG_NetworkController()) << tr("NetworkController onReplyProgress") << progress | |
75 | << QThread::currentThread() << request.get() << reply |
|
75 | << QThread::currentThread() << request.get() << reply | |
76 | << bytesRead << totalBytes; |
|
76 | << bytesRead << totalBytes; | |
77 | impl->lockRead(); |
|
77 | impl->lockRead(); | |
78 | auto it = impl->m_NetworkReplyToId.find(reply); |
|
78 | auto it = impl->m_NetworkReplyToId.find(reply); | |
79 | impl->unlock(); |
|
79 | impl->unlock(); | |
@@ -100,7 +100,6 void NetworkController::initialize() | |||||
100 |
|
100 | |||
101 |
|
101 | |||
102 | auto onReplyErrors = [this](QNetworkReply *reply, const QList<QSslError> &errors) { |
|
102 | auto onReplyErrors = [this](QNetworkReply *reply, const QList<QSslError> &errors) { | |
103 |
|
||||
104 | qCCritical(LOG_NetworkController()) << tr("NetworkAcessManager errors: ") << errors; |
|
103 | qCCritical(LOG_NetworkController()) << tr("NetworkAcessManager errors: ") << errors; | |
105 |
|
104 | |||
106 | }; |
|
105 | }; | |
@@ -120,7 +119,7 void NetworkController::onReplyCanceled(QUuid identifier) | |||||
120 | { |
|
119 | { | |
121 | auto findReply = [identifier](const auto &entry) { return identifier == entry.second; }; |
|
120 | auto findReply = [identifier](const auto &entry) { return identifier == entry.second; }; | |
122 | qCDebug(LOG_NetworkController()) << tr("NetworkController onReplyCanceled") |
|
121 | qCDebug(LOG_NetworkController()) << tr("NetworkController onReplyCanceled") | |
123 | << QThread::currentThread() << identifier; |
|
122 | << QThread::currentThread() << identifier; | |
124 |
|
123 | |||
125 |
|
124 | |||
126 | impl->lockRead(); |
|
125 | impl->lockRead(); | |
@@ -129,11 +128,11 void NetworkController::onReplyCanceled(QUuid identifier) | |||||
129 | impl->unlock(); |
|
128 | impl->unlock(); | |
130 | if (it != end) { |
|
129 | if (it != end) { | |
131 | qCDebug(LOG_NetworkController()) << tr("NetworkController onReplyCanceled ABORT DONE") |
|
130 | qCDebug(LOG_NetworkController()) << tr("NetworkController onReplyCanceled ABORT DONE") | |
132 | << QThread::currentThread() << identifier; |
|
131 | << QThread::currentThread() << identifier; | |
133 | it->first->abort(); |
|
132 | it->first->abort(); | |
134 | } |
|
133 | } | |
135 | qCDebug(LOG_NetworkController()) << tr("NetworkController onReplyCanceled END") |
|
134 | qCDebug(LOG_NetworkController()) << tr("NetworkController onReplyCanceled END") | |
136 | << QThread::currentThread(); |
|
135 | << QThread::currentThread(); | |
137 | } |
|
136 | } | |
138 |
|
137 | |||
139 | void NetworkController::waitForFinish() |
|
138 | void NetworkController::waitForFinish() |
General Comments 0
You need to be logged in to leave comments.
Login now