Don't keep a copy of currently connected printer

This QML file was holding a copy of the currently connected printer, stored in connectingToPrinter. This copy got out of sync when you load a project file which had a different connected printer. Instead, ask the manager for the currently connected printer key every time you click the button.

Contributes to issue CURA-3839.
This commit is contained in:
Ghostkeeper 2017-05-19 12:30:00 +02:00
parent 5a6049ddea
commit bd361e500c
No known key found for this signature in database
GPG key ID: C5F96EE2BC0F7E75

View file

@ -12,7 +12,6 @@ Cura.MachineAction
anchors.fill: parent;
property var selectedPrinter: null
property bool completeProperties: true
property var connectingToPrinter: null
Connections
{
@ -33,9 +32,8 @@ Cura.MachineAction
if(base.selectedPrinter && base.completeProperties)
{
var printerKey = base.selectedPrinter.getKey()
if(connectingToPrinter != printerKey) {
// prevent an infinite loop
connectingToPrinter = printerKey;
if(manager.getStoredKey() != printerKey)
{
manager.setKey(printerKey);
completed();
}