Divelogs.de: parse response once the upload is finished

This is based on the GTK version.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
Lubomir I. Ivanov 2013-12-07 14:56:03 +02:00
parent 0905e4f0ab
commit 231e02f97d

View file

@ -724,27 +724,19 @@ void DivelogsDeWebServices::uploadFinished()
// check what the server sent us: it might contain // check what the server sent us: it might contain
// an error condition, such as a failed login // an error condition, such as a failed login
QByteArray xmlData = reply->readAll(); QByteArray xmlData = reply->readAll();
char *resp = xmlData.data();
// ### FIXME: what's the format? if (resp) {
/* char *parsed = strstr(resp, "<Login>");
// char *error; // char *endat = strstr(resp, "</divelogsDataImport>");
if (error) { if (parsed) {
parsed = strstr(error, "<Login>"); if (strstr(resp, "failed"))
endat = strstr(error, "</divelogsDataImport>"); ui.status->setText(tr("Login failed"));
if (parsed && endat) else
*endat = '\0'; ui.status->setText(tr("Upload successful"));
} else {
ui.status->setText(tr("Cannot parse response"));
} }
if (error && strstr(error, "failed"))
type = GTK_MESSAGE_ERROR;
else
type = GTK_MESSAGE_INFO;
} }
if (parsed)
divelogs_status_dialog(parsed, type);
else if (error)
divelogs_status_dialog(error, type);
free(error);
*/
} }
void DivelogsDeWebServices::setStatusText(int status) void DivelogsDeWebServices::setStatusText(int status)