summaryrefslogtreecommitdiff
path: root/rockworkd/libpebble/jskit
diff options
context:
space:
mode:
Diffstat (limited to 'rockworkd/libpebble/jskit')
-rw-r--r--rockworkd/libpebble/jskit/jskitpebble.cpp5
-rw-r--r--rockworkd/libpebble/jskit/jskitpebble.h3
2 files changed, 6 insertions, 2 deletions
diff --git a/rockworkd/libpebble/jskit/jskitpebble.cpp b/rockworkd/libpebble/jskit/jskitpebble.cpp
index e755d60..5ea94b7 100644
--- a/rockworkd/libpebble/jskit/jskitpebble.cpp
+++ b/rockworkd/libpebble/jskit/jskitpebble.cpp
@@ -4,8 +4,9 @@
#include "jskitpebble.h"
#include "jskitxmlhttprequest.h"
+#if QT_VERSION >= 0x050300
#include "jskitwebsocket.h"
-
+#endif
static const char *token_salt = "0feeb7416d3c4546a19b04bccd8419b1";
JSKitPebble::JSKitPebble(const AppInfo &info, JSKitManager *mgr, QObject *parent) :
@@ -319,11 +320,13 @@ QJSValue JSKitPebble::createXMLHttpRequest()
return m_mgr->engine()->newQObject(xhr);
}
+#if QT_VERSION >= 0x050300
QJSValue JSKitPebble::createWebSocket(const QString &url, const QJSValue &protocols)
{
JSKitWebSocket *ws = new JSKitWebSocket(m_mgr->engine(), url, protocols);
return m_mgr->engine()->newQObject(ws);
}
+#endif
QJSValue JSKitPebble::buildAckEventObject(uint transaction, const QString &message) const
diff --git a/rockworkd/libpebble/jskit/jskitpebble.h b/rockworkd/libpebble/jskit/jskitpebble.h
index c461adb..836a08f 100644
--- a/rockworkd/libpebble/jskit/jskitpebble.h
+++ b/rockworkd/libpebble/jskit/jskitpebble.h
@@ -32,8 +32,9 @@ public:
Q_INVOKABLE void openURL(const QUrl &url);
Q_INVOKABLE QJSValue createXMLHttpRequest();
+#if QT_VERSION >= 0x050300
Q_INVOKABLE QJSValue createWebSocket(const QString &url, const QJSValue &protocols=QJSValue{});
-
+#endif
void invokeCallbacks(const QString &type, const QJSValueList &args = QJSValueList());
private: