diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-02-28 19:51:52 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-03-01 11:57:43 +0100 |
commit | fea05bb0dba069c82b9dbe2a71b31f88cf54a712 (patch) | |
tree | 86516997de75fb734a03f9a532bc6d821aba847b /components/mail/contents/ui | |
parent | 0203557d72eceddf19bbca8143e12be95adab2d7 (diff) | |
download | kube-fea05bb0dba069c82b9dbe2a71b31f88cf54a712.tar.gz kube-fea05bb0dba069c82b9dbe2a71b31f88cf54a712.zip |
Avoid "Unable to assign...." errors
i.e. "Unable to assign [undefined] to Sink::ApplicationDomain::Folder::Ptr"
Because qml does not know how to assign a default-constructed value we
have to use conditional bindings. The !! operator checks for
availability of the property which then triggers the binding.
I assume an alternative viable approach would be to expose all
controller properties as QVariants only, in which case an assignment
from null would work (it doesn't for Folder::Ptr).
Diffstat (limited to 'components/mail/contents/ui')
-rw-r--r-- | components/mail/contents/ui/Mail.qml | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/components/mail/contents/ui/Mail.qml b/components/mail/contents/ui/Mail.qml index b88e846d..c400d8f3 100644 --- a/components/mail/contents/ui/Mail.qml +++ b/components/mail/contents/ui/Mail.qml | |||
@@ -84,12 +84,20 @@ Controls2.ApplicationWindow { | |||
84 | //Controller | 84 | //Controller |
85 | KubeFramework.MailController { | 85 | KubeFramework.MailController { |
86 | id: mailController | 86 | id: mailController |
87 | threadLeader: mailListView.currentMail | 87 | Binding on threadLeader { |
88 | //!! checks for the availability of the type | ||
89 | when: !!mailListView.currentMail | ||
90 | value: mailListView.currentMail | ||
91 | } | ||
88 | } | 92 | } |
89 | 93 | ||
90 | KubeFramework.FolderController { | 94 | KubeFramework.FolderController { |
91 | id: folderController | 95 | id: folderController |
92 | folder: folderListView.currentFolder | 96 | Binding on folder { |
97 | //!! checks for the availability of the type | ||
98 | when: !!folderListView.currentFolder | ||
99 | value: folderListView.currentFolder | ||
100 | } | ||
93 | } | 101 | } |
94 | 102 | ||
95 | //BEGIN Shortcuts | 103 | //BEGIN Shortcuts |