summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2013-12-07 14:56:03 +0200
committerGravatar Lubomir I. Ivanov <neolit123@gmail.com>2013-12-09 15:51:18 +0200
commit231e02f97ddcf355855190ed61c71e54c1ab5157 (patch)
treed28dfa2c4d784fba4081b40b3031c84ac48aa2dd /qt-ui
parent0905e4f0ab5eb9452af84d57e6bdf349fbf879ef (diff)
downloadsubsurface-231e02f97ddcf355855190ed61c71e54c1ab5157.tar.gz
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>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/subsurfacewebservices.cpp30
1 files changed, 11 insertions, 19 deletions
diff --git a/qt-ui/subsurfacewebservices.cpp b/qt-ui/subsurfacewebservices.cpp
index 5c2fa6d12..e92dd431c 100644
--- a/qt-ui/subsurfacewebservices.cpp
+++ b/qt-ui/subsurfacewebservices.cpp
@@ -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)