mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
0905e4f0ab
commit
231e02f97d
1 changed files with 11 additions and 19 deletions
|
@ -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)
|
||||||
|
|
Loading…
Add table
Reference in a new issue