From ef86eb480f20add58653c0cbbd9f3aec67c9999a Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Tue, 7 Jul 2015 12:59:51 +0200 Subject: [PATCH] Do not use a lambda but a member function so reloading works properly Fixes #99 --- cura/CuraApplication.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index a7c82e87ab..5e2ba4a08a 100644 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -330,7 +330,8 @@ class CuraApplication(QtApplication): file_name = node.getMeshData().getFileName() if file_name: job = ReadMeshJob(file_name) - job.finished.connect(lambda j: node.setMeshData(j.getResult())) + job._node = node + job.finished.connect(self._reloadMeshFinished) job.start() ## Get logging data of the backend engine @@ -538,3 +539,6 @@ class CuraApplication(QtApplication): Preferences.getInstance().setValue("cura/recent_files", pref) self.recentFilesChanged.emit() + + def _reloadMeshFinished(self, job): + job._node.setMeshData(job.getResult())