Taskwarrior.qml: workaround handling of files in qml.
This commit is contained in:
parent
325d4638cc
commit
ab969a10c8
2 changed files with 11 additions and 6 deletions
|
@ -15,7 +15,11 @@ Item {
|
|||
property ListModel model : ListModel { id: jsonModel }
|
||||
property alias count: jsonModel.count
|
||||
|
||||
onSourceChanged: {
|
||||
onSourceChanged: fetchJSONModel()
|
||||
onJsonChanged: updateJSONModel()
|
||||
onQueryChanged: updateJSONModel()
|
||||
|
||||
function fetchJSONModel() {
|
||||
var xhr = new XMLHttpRequest;
|
||||
xhr.open("GET", source);
|
||||
xhr.onreadystatechange = function() {
|
||||
|
@ -25,9 +29,6 @@ Item {
|
|||
xhr.send();
|
||||
}
|
||||
|
||||
onJsonChanged: updateJSONModel()
|
||||
onQueryChanged: updateJSONModel()
|
||||
|
||||
function updateJSONModel() {
|
||||
jsonModel.clear();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue