chore(@desktop/general): accounts service updated, inherits `QtObject` class

This commit is contained in:
Sale Djenic 2022-11-10 15:12:51 +01:00 committed by saledjenic
parent 662a11a57b
commit db7769b072
1 changed files with 586 additions and 585 deletions

View File

@ -1,4 +1,4 @@
import os, json, sequtils, strutils, uuids, times import NimQml, os, json, sequtils, strutils, uuids, times
import json_serialization, chronicles import json_serialization, chronicles
import ../../../app/global/global_singleton import ../../../app/global/global_singleton
@ -32,9 +32,8 @@ let TEST_PEER_ENR = getEnv("TEST_PEER_ENR").string
include utils include utils
QtObject:
type type Service* = ref object of QObject
Service* = ref object of RootObj
fleetConfiguration: FleetConfiguration fleetConfiguration: FleetConfiguration
generatedAccounts: seq[GeneratedAccountDto] generatedAccounts: seq[GeneratedAccountDto]
accounts: seq[AccountDto] accounts: seq[AccountDto]
@ -45,10 +44,12 @@ type
defaultWalletEmoji: string defaultWalletEmoji: string
proc delete*(self: Service) = proc delete*(self: Service) =
discard self.QObject.delete
proc newService*(fleetConfiguration: FleetConfiguration): Service = proc newService*(fleetConfiguration: FleetConfiguration): Service =
result = Service() result = Service()
new(result, delete)
result.QObject.setup
result.fleetConfiguration = fleetConfiguration result.fleetConfiguration = fleetConfiguration
result.isFirstTimeAccountLogin = false result.isFirstTimeAccountLogin = false
result.keyStoreDir = main_constants.ROOTKEYSTOREDIR result.keyStoreDir = main_constants.ROOTKEYSTOREDIR