diff --git a/src/adaptors/publishing/UBDocumentPublisher.cpp b/src/adaptors/publishing/UBDocumentPublisher.cpp index bb2c477b..5e20e144 100644 --- a/src/adaptors/publishing/UBDocumentPublisher.cpp +++ b/src/adaptors/publishing/UBDocumentPublisher.cpp @@ -574,27 +574,31 @@ void UBDocumentPublisher::onFinished(QNetworkReply *reply) // Now we isolate every cookie value QStringList qslCookieVals = qsCookieValue.split("; "); - bool bTransferOk = false; - for(int j = 0; j <= qslCookieVals.size(); j++) - { - if(qslCookieVals.at(j).startsWith("assetStatus")) - { - QStringList qslAsset = qslCookieVals.at(j).split("="); - if(qslAsset.at(1) == "UPLOADED") - { - bTransferOk = true; - break; - } - } - } - if(bTransferOk) - { - UBApplication::showMessage(tr("Document uploaded correctly on the web.")); - } - else + bool bTransferOk = false; + + for(int j = 0; j < qslCookieVals.size(); j++) + { + qDebug() << j; + if(qslCookieVals.at(j).startsWith("assetStatus")) + { + QStringList qslAsset = qslCookieVals.at(j).split("="); + if(qslAsset.at(1) == "UPLOADED") { - UBApplication::showMessage(tr("Failed to upload document on the web.")); + bTransferOk = true; + break; } + } + } + + if(bTransferOk) + { + UBApplication::showMessage(tr("Document uploaded correctly on the web.")); + } + else + { + UBApplication::showMessage(tr("Failed to upload document on the web.")); + } + reply->deleteLater(); }