Attempt to fix 'FileNotFoundError' (defensive coding).

hopefully fixes sentry#CURA-3JS
This commit is contained in:
Remco Burema 2024-11-13 09:31:02 +01:00
parent f0a7205267
commit 1c6e14eb7d

View file

@ -217,8 +217,7 @@ class WelcomePagesModel(ListModel):
def _getBuiltinWelcomePagePath(page_filename: str) -> QUrl: def _getBuiltinWelcomePagePath(page_filename: str) -> QUrl:
"""Convenience function to get QUrl path to pages that's located in "resources/qml/WelcomePages".""" """Convenience function to get QUrl path to pages that's located in "resources/qml/WelcomePages"."""
from cura.CuraApplication import CuraApplication from cura.CuraApplication import CuraApplication
return QUrl.fromLocalFile(Resources.getPath(CuraApplication.ResourceTypes.QmlFiles, return QUrl.fromLocalFile(Resources.getPath(CuraApplication.ResourceTypes.QmlFiles, "WelcomePages", page_filename))
os.path.join("WelcomePages", page_filename)))
# FIXME: HACKs for optimization that we don't update the model every time the active machine gets changed. # FIXME: HACKs for optimization that we don't update the model every time the active machine gets changed.
def _onActiveMachineChanged(self) -> None: def _onActiveMachineChanged(self) -> None: