the new version check response is now parsed to find the two values version and url independently of the response id

preferencesAboutTextFull
Claudio Valerio 13 years ago
parent dbaafbc95c
commit 7f325c2f4c
  1. 12
      src/core/UBApplicationController.cpp

@ -514,20 +514,16 @@ void UBApplicationController::checkUpdate()
void UBApplicationController::ftpCommandFinished(int id, bool error) void UBApplicationController::ftpCommandFinished(int id, bool error)
{ {
qDebug() << id;
if (error){ if (error){
qWarning() << "ftp command id" << id << "return the error: " << mFtp->errorString(); qWarning() << "ftp command id" << id << "return the error: " << mFtp->errorString();
mFtp->close(); mFtp->close();
} }
else{ else{
// 3 stand for the third command we have sent QString responseString = QString(mFtp->readAll());
// in our case if (!responseString.isEmpty() && responseString.contains("version:") && responseString.contains("url:")){
// 1->connect
// 2->login
// 3->get
if (id == 3){
QString updateString = QString(mFtp->readAll());
mFtp->close(); mFtp->close();
downloadJsonFinished(updateString); downloadJsonFinished(responseString);
} }
} }
} }

Loading…
Cancel
Save