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
|
||||
// an error condition, such as a failed login
|
||||
QByteArray xmlData = reply->readAll();
|
||||
|
||||
// ### FIXME: what's the format?
|
||||
/*
|
||||
// char *error;
|
||||
if (error) {
|
||||
parsed = strstr(error, "<Login>");
|
||||
endat = strstr(error, "</divelogsDataImport>");
|
||||
if (parsed && endat)
|
||||
*endat = '\0';
|
||||
char *resp = xmlData.data();
|
||||
if (resp) {
|
||||
char *parsed = strstr(resp, "<Login>");
|
||||
// char *endat = strstr(resp, "</divelogsDataImport>");
|
||||
if (parsed) {
|
||||
if (strstr(resp, "failed"))
|
||||
ui.status->setText(tr("Login failed"));
|
||||
else
|
||||
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)
|
||||
|
|
Loading…
Add table
Reference in a new issue