CURA-1923: Remove tracking of jobs

Like suggested by @awhiemstra.

Contributes to CURA-1923
This commit is contained in:
Thomas Karl Pietrowski 2016-07-27 20:32:44 +02:00
parent 260b682864
commit 7581aded7a

View file

@ -13,7 +13,6 @@ from UM.Platform import Platform
from UM.Qt.Duration import DurationFormat from UM.Qt.Duration import DurationFormat
from UM.Job import Job from UM.Job import Job
import time
import platform import platform
import math import math
import urllib.request import urllib.request
@ -69,18 +68,6 @@ class SliceInfo(Extension):
self.send_slice_info_message.actionTriggered.connect(self.messageActionTriggered) self.send_slice_info_message.actionTriggered.connect(self.messageActionTriggered)
self.send_slice_info_message.show() self.send_slice_info_message.show()
self.runningJobs = []
def __del__(self):
for job in self.runningJobs:
while not job.isFinished():
time.sleep(1) # Wait for threads - shouldn't take much more time than the timeout. See above..
def _removeFinishedThreads(self):
for job in self.runningJobs:
if job.isFinished():
self.runningJobs.remove(job) # Remove finished threads
def messageActionTriggered(self, message_id, action_id): def messageActionTriggered(self, message_id, action_id):
self.send_slice_info_message.hide() self.send_slice_info_message.hide()
Preferences.getInstance().setValue("info/asked_send_slice_info", True) Preferences.getInstance().setValue("info/asked_send_slice_info", True)
@ -154,7 +141,6 @@ class SliceInfo(Extension):
# Sending slice info non-blocking # Sending slice info non-blocking
reportJob = SliceInfoThread(self.info_url, binary_data) reportJob = SliceInfoThread(self.info_url, binary_data)
self.runningJobs.append(reportJob)
reportJob.start() reportJob.start()
except: except:
# We really can't afford to have a mistake here, as this would break the sending of g-code to a device # We really can't afford to have a mistake here, as this would break the sending of g-code to a device