From 7f325c2f4c7c830bb7119a29eeea5f4449e41c49 Mon Sep 17 00:00:00 2001 From: Claudio Valerio Date: Wed, 24 Aug 2011 14:12:37 +0200 Subject: [PATCH] the new version check response is now parsed to find the two values version and url independently of the response id --- src/core/UBApplicationController.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/core/UBApplicationController.cpp b/src/core/UBApplicationController.cpp index c08ec695..6cecaae6 100644 --- a/src/core/UBApplicationController.cpp +++ b/src/core/UBApplicationController.cpp @@ -514,20 +514,16 @@ void UBApplicationController::checkUpdate() void UBApplicationController::ftpCommandFinished(int id, bool error) { + qDebug() << id; if (error){ qWarning() << "ftp command id" << id << "return the error: " << mFtp->errorString(); mFtp->close(); } else{ - // 3 stand for the third command we have sent - // in our case - // 1->connect - // 2->login - // 3->get - if (id == 3){ - QString updateString = QString(mFtp->readAll()); + QString responseString = QString(mFtp->readAll()); + if (!responseString.isEmpty() && responseString.contains("version:") && responseString.contains("url:")){ mFtp->close(); - downloadJsonFinished(updateString); + downloadJsonFinished(responseString); } } }