summaryrefslogtreecommitdiff
path: root/examples/webchannel/standalone/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/webchannel/standalone/main.cpp')
-rw-r--r--examples/webchannel/standalone/main.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/examples/webchannel/standalone/main.cpp b/examples/webchannel/standalone/main.cpp
index 9c03370..bd2b0a9 100644
--- a/examples/webchannel/standalone/main.cpp
+++ b/examples/webchannel/standalone/main.cpp
@@ -38,8 +38,8 @@
#include <QVariantMap>
#include <QDesktopServices>
#include <QUrl>
-#include <QDebug>
-
+#include <QDir>
+#include <QFileInfo>
#include <QtWebSockets/QWebSocketServer>
#include "../shared/websocketclientwrapper.h"
@@ -111,6 +111,11 @@ int main(int argc, char** argv)
{
QApplication app(argc, argv);
+ QFileInfo jsFileInfo(QDir::currentPath() + "/qwebchannel.js");
+
+ if (!jsFileInfo.exists())
+ QFile::copy(":/qtwebchannel/qwebchannel.js",jsFileInfo.absoluteFilePath());
+
// setup the QWebSocketServer
QWebSocketServer server(QStringLiteral("QWebChannel Standalone Example Server"), QWebSocketServer::NonSecureMode);
if (!server.listen(QHostAddress::LocalHost, 12345)) {