Showing the changes to interface/src/scripting/ScreenshareScriptingInterface.cpp (1 of 2 files). Show all
Unified · Split
| @@ -135,23 +135,21 @@ void ScreenshareScriptingInterface::stopScreenshare() { · 134 unmodified lines | ||
| 135 | 135 | |
| 136 | 136 | void ScreenshareScriptingInterface::handleSuccessfulScreenshareInfoGet(QNetworkReply* reply) { |
| 137 | 137 | QString answer = reply->readAll(); |
| 138 | − qDebug() << "\n\n MN HERE: REPLY" << answer; | |
| 139 | 138 | |
| 140 | 139 | QByteArray answerByteArray = answer.toUtf8(); |
| 141 | 140 | QJsonDocument answerJSONObject = QJsonDocument::fromJson(answerByteArray); |
| 142 | 141 | |
| 143 | 142 | QString status = answerJSONObject["status"].toString(); |
| 144 | 143 | if (status != "success") { |
| 145 | − qDebug() << "\n\n MN HERE: SCREENSHARE REPLY FAIL"; | |
| 144 | + qDebug() << "Error when retrieving screenshare info via HTTP. Error:" << reply->errorString(); | |
| 146 | 145 | stopScreenshare(); |
| 147 | 146 | emit screenshareError(); |
| 148 | 147 | return; |
| 149 | 148 | } |
| 150 | 149 | |
| 151 | 150 | _token = answerJSONObject["token"].toString(); |
| 152 | − _projectAPIKey = answerJSONObject["projectAPIKey"].toString(); | |
| 151 | + _projectAPIKey = answerJSONObject["projectApiKey"].toString(); | |
| 153 | 152 | _sessionID = answerJSONObject["sessionID"].toString(); |
| 154 | − qDebug() << "token:" << _token << " projectAPIKey:" << _projectAPIKey << " sessionID: " << _sessionID; | |
| 155 | 153 | |
| 156 | 154 | if (_token.isEmpty() || _projectAPIKey.isEmpty() || _sessionID.isEmpty()) { |
| 157 | 155 | qDebug() << "Not all Screen Share information was retrieved from the backend. Stopping..."; |
| @@ -167,16 +165,10 @@ void ScreenshareScriptingInterface::handleSuccessfulScreenshareInfoGet(QNetworkR · 9 unmodified lines | ||
| 167 | 165 | arguments << "--projectAPIKey=" + _projectAPIKey << " "; |
| 168 | 166 | arguments << "--sessionID=" + _sessionID << " "; |
| 169 | 167 | |
| 170 | − connect(_screenshareProcess.get(), &QProcess::errorOccurred, | |
| 171 | − [=](QProcess::ProcessError error) { qDebug() << "ZRF QProcess::errorOccurred. `error`:" << error; }); | |
| 172 | − connect(_screenshareProcess.get(), &QProcess::started, [=]() { qDebug() << "ZRF QProcess::started"; }); | |
| 173 | − connect(_screenshareProcess.get(), &QProcess::stateChanged, [=](QProcess::ProcessState newState) { | |
| 174 | − qDebug() << "ZRF QProcess::stateChanged. `newState`:" << newState; | |
| 175 | − }); | |
| 176 | 168 | connect(_screenshareProcess.get(), QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished), |
| 177 | 169 | [=](int exitCode, QProcess::ExitStatus exitStatus) { |
| 178 | − qDebug() << "ZRF QProcess::finished. `exitCode`:" << exitCode << "`exitStatus`:" << exitStatus; | |
| 179 | 170 | stopScreenshare(); |
| 171 | + emit screenshareProcessTerminated(); | |
| 180 | 172 | }); |
| 181 | 173 | |
| 182 | 174 | _screenshareProcess->start(SCREENSHARE_EXE_PATH, arguments); |
| @@ -214,7 +206,7 @@ void ScreenshareScriptingInterface::handleSuccessfulScreenshareInfoGet(QNetworkR · 31 unmodified lines | ||
| 214 | 206 | } |
| 215 | 207 | |
| 216 | 208 | void ScreenshareScriptingInterface::handleFailedScreenshareInfoGet(QNetworkReply* reply) { |
| 217 | − qDebug() << "\n\n MN HERE: handleFailedScreenshareInfoGet():" << reply->readAll(); | |
| 209 | + qDebug() << "Failed to get screenshare info via HTTP. Error:" << reply->errorString(); | |
| 218 | 210 | stopScreenshare(); |
| 219 | 211 | emit screenshareError(); |
| 220 | 212 | } |