summaryrefslogtreecommitdiffstats
path: root/components/mail/contents/ui/Mail.qml
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-02-28 19:51:52 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-03-01 11:57:43 +0100
commitfea05bb0dba069c82b9dbe2a71b31f88cf54a712 (patch)
tree86516997de75fb734a03f9a532bc6d821aba847b /components/mail/contents/ui/Mail.qml
parent0203557d72eceddf19bbca8143e12be95adab2d7 (diff)
downloadkube-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/Mail.qml')
-rw-r--r--components/mail/contents/ui/Mail.qml12
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