summaryrefslogtreecommitdiffstats
path: root/app/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'app/main.cpp')
-rw-r--r--app/main.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/app/main.cpp b/app/main.cpp
index a55ebad..381b936 100644
--- a/app/main.cpp
+++ b/app/main.cpp
@@ -79,17 +79,25 @@ int main(int argc, char *argv[])
if (!positionalArguments.isEmpty()) {
port = positionalArguments.takeFirst().toInt();
}
-// QString secret = positionalArguments.takeFirst();
+ QString secret = positionalArguments.takeFirst();
QUrl bindingAddress;
bindingAddress.setScheme(QStringLiteral("http"));
bindingAddress.setHost(QStringLiteral("localhost"));
bindingAddress.setPort(port);
bindingAddress.setPath(QStringLiteral("/api"));
-// QUrlQuery query;
-// query.addQueryItem(QStringLiteral("token"), secret);
-// bindingAddress.setQuery(query);
+ QUrlQuery query;
+ query.addQueryItem(QStringLiteral("token"), secret);
+ //bindingAddress.setQuery(query);
+
+ QUrl bindingAddressWS;
+ bindingAddressWS.setScheme(QStringLiteral("ws"));
+ bindingAddressWS.setHost(QStringLiteral("localhost"));
+ bindingAddressWS.setPort(port);
+ bindingAddressWS.setPath(QStringLiteral("/api"));
+ bindingAddressWS.setQuery(query);
QQmlContext *context = engine.rootContext();
context->setContextProperty(QStringLiteral("bindingAddress"), bindingAddress);
+ context->setContextProperty(QStringLiteral("bindingAddressWS"), bindingAddressWS);
QFile version("/proc/version");
if (version.open(QFile::ReadOnly)) {