From 87e31105e38e64535ecfa926e9e7e4171c7cc4c5 Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Mon, 18 May 2020 16:32:53 -0400 Subject: [PATCH] Code cleanup --- src/nim_status_client.nim | 23 +++++++---------------- src/status/core.nim | 4 ---- 2 files changed, 7 insertions(+), 20 deletions(-) diff --git a/src/nim_status_client.nim b/src/nim_status_client.nim index 53a6e06ba0..6925708a91 100644 --- a/src/nim_status_client.nim +++ b/src/nim_status_client.nim @@ -14,34 +14,25 @@ import status/wallet as status_wallet import status/libstatus import state -# From QT docs: -# For any GUI application using Qt, there is precisely one QApplication object, -# no matter whether the application has 0, 1, 2 or more windows at any given time. -# For non-QWidget based Qt applications, use QGuiApplication instead, as it does -# not depend on the QtWidgets library. Use QCoreApplication for non GUI apps - var signalsQObjPointer: pointer proc mainProc() = - var app = newQApplication() + let app = newQApplication() + let engine = newQQmlApplicationEngine() + let signalController = signals.newController(app) - var signalController = signals.newController(app) + defer: # Defer will run this just before mainProc() function ends + app.delete() + engine.delete() + signalController.delete() # We need this global variable in order to be able to access the application # from the non-closure callback passed to `libstatus.setSignalEventCallback` signalsQObjPointer = cast[pointer](signalController.vptr) - defer: app.delete() # Defer will run this just before mainProc() function ends - - var engine = newQQmlApplicationEngine() - defer: engine.delete() - var appState = state.newAppState() echo appState.title - # TODO: @RR: commented until I'm able to fix the global variable issue described below - #status.init(appState) - status_test.setupNewAccount() status_chat.startMessenger() diff --git a/src/status/core.nim b/src/status/core.nim index 85ec2689e8..7ee99bb8e0 100644 --- a/src/status/core.nim +++ b/src/status/core.nim @@ -1,10 +1,6 @@ import libstatus import chat -# TODO: move signal handler from nim_status_client.nim -# proc init*(state: AppState) = -# setSignalHandler(onSignal(state)) - proc startMessenger*() = chat.startMessenger()