Fixed plugin installing for windows

CURA-3856
This commit is contained in:
Jaime van Kessel 2017-07-07 10:31:26 +02:00
parent 12d8c7f4d7
commit fc70715cd1

View file

@ -102,8 +102,10 @@ class PluginBrowser(QObject, Extension):
self._download_plugin_reply.downloadProgress.disconnect(self._onDownloadPluginProgress)
self._temp_plugin_file = tempfile.NamedTemporaryFile(suffix = ".curaplugin")
self._temp_plugin_file.write(self._download_plugin_reply.readAll())
result = PluginRegistry.getInstance().installPlugin("file://" + self._temp_plugin_file.name)
location = self._temp_plugin_file.name
if not location.startswith("/"):
location = "/" + location # Ensure that it starts with a /, as otherwise it doesn't work on windows.
result = PluginRegistry.getInstance().installPlugin("file://" + location)
self._newly_installed_plugin_ids.append(result["id"])
self.pluginsMetadataChanged.emit()