cleanup: remove unused imports in modules
This commit is contained in:
parent
0d7cb1b401
commit
729fa1f31c
|
@ -1,6 +1,5 @@
|
||||||
import NimQml
|
import NimQml
|
||||||
import json, eventemitter
|
import json, eventemitter
|
||||||
import ../../status/chat as status_chat
|
|
||||||
import ../../models/chat as chat_model
|
import ../../models/chat as chat_model
|
||||||
import ../../signals/types
|
import ../../signals/types
|
||||||
import view
|
import view
|
||||||
|
|
|
@ -0,0 +1,58 @@
|
||||||
|
import NimQml
|
||||||
|
import mailserversList
|
||||||
|
|
||||||
|
QtObject:
|
||||||
|
type ProfileView* = ref object of QObject
|
||||||
|
username*: string
|
||||||
|
identicon*: string
|
||||||
|
mailserversList*: MailServersList
|
||||||
|
|
||||||
|
proc setup(self: ProfileView) =
|
||||||
|
self.QObject.setup
|
||||||
|
|
||||||
|
proc delete*(self: ProfileView) =
|
||||||
|
self.QObject.delete
|
||||||
|
|
||||||
|
proc newProfileView*(): ProfileView =
|
||||||
|
new(result, delete)
|
||||||
|
result.username = ""
|
||||||
|
result.identicon = ""
|
||||||
|
result.mailserversList = newMailServersList()
|
||||||
|
result.setup
|
||||||
|
|
||||||
|
proc username*(self: ProfileView): string {.slot.} =
|
||||||
|
result = self.username
|
||||||
|
|
||||||
|
proc receivedUsername*(self: ProfileView, username: string) {.signal.}
|
||||||
|
|
||||||
|
proc addMailserverToList*(self: ProfileView, name: string, endpoint: string) {.slot.} =
|
||||||
|
self.mailserversList.add(name, endpoint)
|
||||||
|
|
||||||
|
proc setUsername*(self: ProfileView, username: string) {.slot.} =
|
||||||
|
self.username = username
|
||||||
|
self.receivedUsername(username)
|
||||||
|
|
||||||
|
QtProperty[string] username:
|
||||||
|
read = username
|
||||||
|
write = setUsername
|
||||||
|
notify = receivedUsername
|
||||||
|
|
||||||
|
proc identicon*(self: ProfileView): string {.slot.} =
|
||||||
|
result = self.identicon
|
||||||
|
|
||||||
|
proc getMailserversList(self: ProfileView): QVariant {.slot.} =
|
||||||
|
return newQVariant(self.mailserversList)
|
||||||
|
|
||||||
|
QtProperty[QVariant] mailserversList:
|
||||||
|
read = getMailserversList
|
||||||
|
|
||||||
|
proc receivedIdenticon*(self: ProfileView, identicon: string) {.signal.}
|
||||||
|
|
||||||
|
proc setIdenticon*(self: ProfileView, identicon: string) {.slot.} =
|
||||||
|
self.identicon = identicon
|
||||||
|
self.receivedIdenticon(identicon)
|
||||||
|
|
||||||
|
QtProperty[string] identicon:
|
||||||
|
read = identicon
|
||||||
|
write = setIdenticon
|
||||||
|
notify = receivedIdenticon
|
|
@ -1,6 +1,5 @@
|
||||||
import NimQml
|
import NimQml
|
||||||
import Tables
|
import Tables
|
||||||
import strformat
|
|
||||||
import ../../../models/profile
|
import ../../../models/profile
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import json
|
import json
|
||||||
import eventemitter
|
import eventemitter
|
||||||
import ../status/accounts as status_accounts
|
import ../status/accounts as status_accounts
|
||||||
import ../status/utils
|
|
||||||
import ../status/types
|
import ../status/types
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
|
@ -1,6 +1,3 @@
|
||||||
import core as status
|
|
||||||
import json
|
|
||||||
|
|
||||||
proc getMailservers*(): array[0..8, (string, string)] =
|
proc getMailservers*(): array[0..8, (string, string)] =
|
||||||
result = [
|
result = [
|
||||||
(
|
(
|
||||||
|
|
Loading…
Reference in New Issue