Use right enums for single instance

CURA-9183
This commit is contained in:
Jaime van Kessel 2022-04-22 09:36:46 +02:00
parent e1ec9d68f8
commit c1ed7b97f9

View File

@ -29,7 +29,7 @@ class SingleInstance:
single_instance_socket.connectToServer("ultimaker-cura") single_instance_socket.connectToServer("ultimaker-cura")
single_instance_socket.waitForConnected(msecs = 3000) # wait for 3 seconds single_instance_socket.waitForConnected(msecs = 3000) # wait for 3 seconds
if single_instance_socket.state() != QLocalSocket.ConnectedState: if single_instance_socket.state() != QLocalSocket.LocalSocketState.ConnectedState:
return False return False
# We only send the files that need to be opened. # We only send the files that need to be opened.
@ -37,7 +37,7 @@ class SingleInstance:
Logger.log("i", "No file need to be opened, do nothing.") Logger.log("i", "No file need to be opened, do nothing.")
return True return True
if single_instance_socket.state() == QLocalSocket.ConnectedState: if single_instance_socket.state() == QLocalSocket.LocalSocketState.ConnectedState:
Logger.log("i", "Connection has been made to the single-instance Cura socket.") Logger.log("i", "Connection has been made to the single-instance Cura socket.")
# Protocol is one line of JSON terminated with a carriage return. # Protocol is one line of JSON terminated with a carriage return.