From 938ea55a0a272b6fd1e35ee383c1f444cdbebf05 Mon Sep 17 00:00:00 2001 From: Erik Prabowo Kamal Date: Thu, 29 Aug 2019 14:32:39 +0800 Subject: Renamed NetworkWorker to just Worker --- main.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'main.cxx') diff --git a/main.cxx b/main.cxx index cacf2cd..5f0e13d 100644 --- a/main.cxx +++ b/main.cxx @@ -2,7 +2,7 @@ #include #include #include "user.hxx" -#include "networkworker.hxx" +#include "worker.hxx" int main(int argc, char* argv[]) { @@ -10,7 +10,7 @@ int main(int argc, char* argv[]) QGuiApplication app(argc, argv); QQmlApplicationEngine engine; - NetworkWorker worker{}; + Worker worker{}; QThread thread; worker.moveToThread(&thread); -- cgit v1.2.3 From c8891b50d1f30c7c07bf96f8eaf2e1002ce573b8 Mon Sep 17 00:00:00 2001 From: Erik Prabowo Kamal Date: Thu, 29 Aug 2019 15:30:00 +0800 Subject: Set up a way for the thread to quit --- main.cxx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'main.cxx') diff --git a/main.cxx b/main.cxx index 5f0e13d..0b52736 100644 --- a/main.cxx +++ b/main.cxx @@ -1,8 +1,7 @@ #include #include -#include #include "user.hxx" -#include "worker.hxx" +#include "controller.hxx" int main(int argc, char* argv[]) { @@ -10,10 +9,6 @@ int main(int argc, char* argv[]) QGuiApplication app(argc, argv); QQmlApplicationEngine engine; - Worker worker{}; - QThread thread; - worker.moveToThread(&thread); - qmlRegisterSingletonType("id.co.darapsa.kelakon.user", 0, 1, "User", [](QQmlEngine *engine, QJSEngine *scriptEngine) -> QObject* { Q_UNUSED(engine) Q_UNUSED(scriptEngine) @@ -23,7 +18,7 @@ int main(int argc, char* argv[]) }); engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); - thread.start(); + Controller controller{}; return app.exec(); } -- cgit v1.2.3