Use getPluginPath()

CURA-6005
This commit is contained in:
Lipu Fei 2019-01-09 08:41:13 +01:00
parent aee4034e3e
commit 520b34ab89

View file

@ -68,7 +68,8 @@ class DrivePluginExtension(QObject, Extension):
def showDriveWindow(self) -> None: def showDriveWindow(self) -> None:
if not self._drive_window: if not self._drive_window:
path = os.path.join(os.path.dirname(__file__), "qml", "main.qml") plugin_dir_path = CuraApplication.getInstance().getPluginRegistry().getPluginPath("CuraDrive")
path = os.path.join(plugin_dir_path, "src", "qml", "main.qml")
self._drive_window = CuraApplication.getInstance().createQmlComponent(path, {"CuraDrive": self}) self._drive_window = CuraApplication.getInstance().createQmlComponent(path, {"CuraDrive": self})
self.refreshBackups() self.refreshBackups()
if self._drive_window: if self._drive_window: