From be52272e5c8016cb6fdfeeb8667093a15704d0ed Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Wed, 1 Aug 2018 21:29:03 -0700 Subject: [PATCH] Fix state corruption caused by having 2 separate ComputerModels. Fixes #6 --- app/gui/PcView.qml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/gui/PcView.qml b/app/gui/PcView.qml index bb008b39..eaf825de 100644 --- a/app/gui/PcView.qml +++ b/app/gui/PcView.qml @@ -81,7 +81,7 @@ GridView { return model } - model: createModel() + model: computerModel delegate: Item { width: 300; height: 300; @@ -250,12 +250,10 @@ GridView { modality:Qt.WindowModal property int pcIndex : -1; text:"Are you sure you want to remove this PC?" - standardButtons: StandardButton.Yes |StandardButton.No + standardButtons: StandardButton.Yes | StandardButton.No onYes: { console.log("deleting PC pairing for PC at index: " + pcIndex) computerModel.deleteComputer(pcIndex); - // hack to remove the child from the gridview - model = createModel() } }