Make plugin_registry protected

CURA-8587
This commit is contained in:
Jaime van Kessel 2021-12-13 11:57:00 +01:00
parent eb11e92637
commit 50f1afa5d9

View File

@ -27,7 +27,7 @@ class Marketplace(Extension):
def __init__(self) -> None: def __init__(self) -> None:
super().__init__() super().__init__()
self._window: Optional["QObject"] = None # If the window has been loaded yet, it'll be cached in here. self._window: Optional["QObject"] = None # If the window has been loaded yet, it'll be cached in here.
self.plugin_registry: Optional[PluginRegistry] = None self._plugin_registry: Optional[PluginRegistry] = None
qmlRegisterType(RemotePackageList, "Marketplace", 1, 0, "RemotePackageList") qmlRegisterType(RemotePackageList, "Marketplace", 1, 0, "RemotePackageList")
qmlRegisterType(LocalPackageList, "Marketplace", 1, 0, "LocalPackageList") qmlRegisterType(LocalPackageList, "Marketplace", 1, 0, "LocalPackageList")
@ -41,7 +41,7 @@ class Marketplace(Extension):
If the window hadn't been loaded yet into Qt, it will be created lazily. If the window hadn't been loaded yet into Qt, it will be created lazily.
""" """
if self._window is None: if self._window is None:
self.plugin_registry = PluginRegistry.getInstance() self._plugin_registry = PluginRegistry.getInstance()
plugin_path = PluginRegistry.getInstance().getPluginPath(self.getPluginId()) plugin_path = PluginRegistry.getInstance().getPluginPath(self.getPluginId())
if plugin_path is None: if plugin_path is None:
plugin_path = os.path.dirname(__file__) plugin_path = os.path.dirname(__file__)