feat(@desktop/keycard): user profile prop `address` renamed to `keyUid`

Prop `address` renamed to `keyUid` to be consistent in code and name the
things in the way what they really are.
This commit is contained in:
Sale Djenic 2022-09-13 11:40:54 +02:00 committed by saledjenic
parent f5cfdd3246
commit 7a998b0e21
2 changed files with 11 additions and 11 deletions

View File

@ -6,7 +6,7 @@ QtObject:
type UserProfile* = ref object of QObject
# fields which cannot change
username: string
address: string
keyUid: string
pubKey: string
# fields which may change during runtime
ensName: string
@ -27,16 +27,16 @@ QtObject:
new(result, delete)
result.setup
proc setFixedData*(self: UserProfile, username: string, address: string, pubKey: string) =
proc setFixedData*(self: UserProfile, username: string, keyUid: string, pubKey: string) =
self.username = username
self.address = address
self.keyUid = keyUid
self.pubKey = pubKey
proc getAddress*(self: UserProfile): string {.slot.} =
self.address
proc getKeyUid*(self: UserProfile): string {.slot.} =
self.keyUid
QtProperty[string] address:
read = getAddress
QtProperty[string] keyUid:
read = getKeyUid
proc getPubKey*(self: UserProfile): string {.slot.} =

View File

@ -67,13 +67,13 @@ method viewDidLoad*(self: Module) =
self.delegate.profileModuleDidLoad()
method storeIdentityImage*(self: Module, imageUrl: string, aX: int, aY: int, bX: int, bY: int) =
let address = singletonInstance.userProfile.getAddress()
let keyUid = singletonInstance.userProfile.getKeyUid()
let image = singletonInstance.utils.formatImagePath(imageUrl)
self.controller.storeIdentityImage(address, image, aX, aY, bX, bY)
self.controller.storeIdentityImage(keyUid, image, aX, aY, bX, bY)
method deleteIdentityImage*(self: Module) =
let address = singletonInstance.userProfile.getAddress()
self.controller.deleteIdentityImage(address)
let keyUid = singletonInstance.userProfile.getKeyUid()
self.controller.deleteIdentityImage(keyUid)
method setDisplayName*(self: Module, displayName: string) =
self.controller.setDisplayName(displayName)