summaryrefslogtreecommitdiffstats
path: root/qt-ui/subsurfacewebservices.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-06-15 06:05:00 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-06-15 10:22:00 -0700
commitc593dea119b4c5fa77a8b2cc129d048d7d56afa4 (patch)
tree89e7e7105fb6d8d625f880e6b709cfe23e6d144a /qt-ui/subsurfacewebservices.cpp
parent617b105458f362516de9bf2997f747de5dc14e44 (diff)
downloadsubsurface-c593dea119b4c5fa77a8b2cc129d048d7d56afa4.tar.gz
Cloud storage: use preference member instead of hard coded strings
This creates the basis to allow other backends to be used with the cloud storage infrastructure. So far this should all just transparently continue to work. A user would have to manually add the cloud_base_url entry to the CloudStorage section in their config file in order to use a different backend server. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/subsurfacewebservices.cpp')
-rw-r--r--qt-ui/subsurfacewebservices.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/qt-ui/subsurfacewebservices.cpp b/qt-ui/subsurfacewebservices.cpp
index dfaf69468..665bcf43a 100644
--- a/qt-ui/subsurfacewebservices.cpp
+++ b/qt-ui/subsurfacewebservices.cpp
@@ -946,9 +946,9 @@ CloudStorageAuthenticate::CloudStorageAuthenticate(QObject *parent) : QObject(pa
userAgent = getUserAgent();
}
-#define CLOUDURL "https://cloud.subsurface-divelog.org/"
-#define CLOUDBACKENDSTORAGE CLOUDURL "storage"
-#define CLOUDBACKENDVERIFY CLOUDURL "verify"
+#define CLOUDURL QString(prefs.cloud_base_url)
+#define CLOUDBACKENDSTORAGE CLOUDURL + "/storage"
+#define CLOUDBACKENDVERIFY CLOUDURL + "/verify"
QNetworkReply* CloudStorageAuthenticate::authenticate(QString email, QString password, QString pin)
{
@@ -1013,7 +1013,7 @@ CheckCloudConnection::CheckCloudConnection(QObject *parent)
}
-#define TEAPOT "https://cloud.subsurface-divelog.org/make-latte?number-of-shots=3"
+#define TEAPOT "/make-latte?number-of-shots=3"
#define HTTP_I_AM_A_TEAPOT 418
#define MILK "Linus does not like non-fat milk"
bool CheckCloudConnection::checkServer()
@@ -1024,7 +1024,7 @@ bool CheckCloudConnection::checkServer()
QNetworkRequest request;
request.setRawHeader("Accept", "text/plain");
request.setRawHeader("User-Agent", getUserAgent().toUtf8());
- request.setUrl(QString(TEAPOT));
+ request.setUrl(QString(prefs.cloud_base_url) + TEAPOT);
QNetworkAccessManager *mgr = new QNetworkAccessManager();
QNetworkReply *reply = mgr->get(request);
connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit()));