summaryrefslogtreecommitdiffstats
path: root/components/package
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/package
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/package')
-rw-r--r--components/package/contents/ui/FolderListView.qml8
-rw-r--r--components/package/contents/ui/MailListView.qml2
2 files changed, 7 insertions, 3 deletions
diff --git a/components/package/contents/ui/FolderListView.qml b/components/package/contents/ui/FolderListView.qml
index 9ac73fb4..a4d25e02 100644
--- a/components/package/contents/ui/FolderListView.qml
+++ b/components/package/contents/ui/FolderListView.qml
@@ -28,14 +28,18 @@ import org.kube.framework.domain 1.0 as KubeFramework
28Rectangle { 28Rectangle {
29 id: root 29 id: root
30 30
31 property variant currentFolder 31 property variant currentFolder: null
32 property variant accountId 32 property variant accountId
33 33
34 color: Kirigami.Theme.textColor 34 color: Kirigami.Theme.textColor
35 35
36 KubeFramework.FolderController { 36 KubeFramework.FolderController {
37 id: folderController 37 id: folderController
38 folder: root.currentFolder 38 Binding on folder {
39 //!! checks for the availability of the type
40 when: !!root.currentFolder
41 value: root.currentFolder
42 }
39 } 43 }
40 44
41 Menu { 45 Menu {
diff --git a/components/package/contents/ui/MailListView.qml b/components/package/contents/ui/MailListView.qml
index 1467979a..35fd4ec9 100644
--- a/components/package/contents/ui/MailListView.qml
+++ b/components/package/contents/ui/MailListView.qml
@@ -28,7 +28,7 @@ import org.kube.framework.domain 1.0 as KubeFramework
28Item { 28Item {
29 id: root 29 id: root
30 property variant parentFolder 30 property variant parentFolder
31 property variant currentMail 31 property variant currentMail: null
32 property bool isDraft : false 32 property bool isDraft : false
33 property int currentIndex 33 property int currentIndex
34 34