Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid Actions.qml cyclic dependency #19654

Open
wants to merge 1 commit into
base: 5.8
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions cura/CuraApplication.py
Original file line number Diff line number Diff line change
Expand Up @@ -1296,6 +1296,9 @@ def registerObjects(self, engine):
qmlRegisterSingletonType(CuraSceneController, "Cura", 1, 0, self.getCuraSceneController, "SceneController")
qmlRegisterSingletonType(ExtruderManager, "Cura", 1, 0, self.getExtruderManager, "ExtruderManager")
qmlRegisterSingletonType(MachineManager, "Cura", 1, 0, self.getMachineManager, "MachineManager")
# Give Actions.qml another namespace to import instead of "Cura" which
# it is a member of and causes a cyclic dependency.
qmlRegisterSingletonType(MachineManager, "_CuraActionsDependencies", 1, 5, self.getMachineManager, "MachineManager")
qmlRegisterSingletonType(IntentManager, "Cura", 1, 6, self.getIntentManager, "IntentManager")
qmlRegisterSingletonType(SettingInheritanceManager, "Cura", 1, 0, self.getSettingInheritanceManager, "SettingInheritanceManager")
qmlRegisterSingletonType(SimpleModeSettingsManager, "Cura", 1, 0, self.getSimpleModeSettingsManagerWrapper, "SimpleModeSettingsManager")
Expand Down Expand Up @@ -1346,6 +1349,9 @@ def registerObjects(self, engine):
qmlRegisterType(MachineNameValidator, "Cura", 1, 0, "MachineNameValidator")
qmlRegisterType(UserChangesModel, "Cura", 1, 0, "UserChangesModel")
qmlRegisterSingletonType(ContainerManager, "Cura", 1, 0, ContainerManager.getInstance, "ContainerManager")
# Give Actions.qml another namespace to import instead of "Cura" which
# it is a member of and causes a cyclic dependency.
qmlRegisterSingletonType(ContainerManager, "_CuraActionsDependencies", 1, 5, ContainerManager.getInstance, "ContainerManager")
qmlRegisterType(SidebarCustomMenuItemsModel, "Cura", 1, 0, "SidebarCustomMenuItemsModel")

qmlRegisterType(PrinterOutputDevice, "Cura", 1, 0, "PrinterOutputDevice")
Expand Down
5 changes: 4 additions & 1 deletion resources/qml/Actions.qml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ pragma Singleton
import QtQuick 2.10
import QtQuick.Controls 2.4
import UM 1.1 as UM
import Cura 1.5 as Cura
import _CuraActionsDependencies 1.5 as Cura
// Was "import Cura 1.5 as Cura", except that results in
// "Cyclic dependency detected between" Actions.qml and Actions.qml
// Actions can't import the namespace that it has already been registered to.

Item
{
Expand Down
Loading