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

Fix caluculation of m_resourcePath in the testing case #14110

Merged
merged 1 commit into from
Feb 5, 2025

Conversation

daschuer
Copy link
Member

@daschuer daschuer commented Jan 3, 2025

It took me quite a while to figure that out. A related issue is that the path/line reported in the error message is wrong, because of a QML hack:

https://github.com/mixxxdj/mixxx/blob/main/src/controllers/scripting/legacy/controllerscriptenginelegacy.cpp#L763-L765

The hack allows statements like this:

import "." as Skin

instead of

import "../qml" as Skin

I would prefer to remove the hack and use the later, which feels correct for me.

@acolombier
Copy link
Member

The reason for introducing this is to allow consistency with the QML code. As you can see with the S4 Mk3 PR, advanced mapping will likely consist of multiple QML file at different location, so I would rather allow some consistency on how you can import and reuse Mixxx component.

That being said, I agree that the current implementation is flawdd, and we should likely publish a QML module instead, which can be imported, along the lines of

import Mixxx.Skin 1.0 as Skin

@daschuer
Copy link
Member Author

daschuer commented Jan 9, 2025

Filed a bug for the pass issue #14151

Ready for merge.

@daschuer
Copy link
Member Author

Can we merge this now?

@daschuer
Copy link
Member Author

daschuer commented Feb 4, 2025

@acolombier What do you think? Merge?

Copy link
Member

@acolombier acolombier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to merge the test update!

@@ -125,7 +125,7 @@ class ControllerScriptEngineLegacy : public ControllerScriptEngineBase {
std::unordered_map<QString, std::unique_ptr<mixxx::qml::QmlMixxxControllerScreen>> m_rootItems;
QList<LegacyControllerMapping::QMLModuleInfo> m_modules;
QList<LegacyControllerMapping::ScreenInfo> m_infoScreens;
QString m_resourcePath{QStringLiteral(".")};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you feel about keeping this default till we implement the proper module publishing?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we have a different topic. I have removed the default . because is never used. It is set via setResourcePath() to the correct value. Appart from that . would require to start Mixxx from the res directory

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, actually this should not break the current behaviour, but I thought it would be best to default the QML path to be ./qml rather than /qml, but since we are calling setResourcePath before loading the scene, I'm happy to ignore that

Copy link
Member

@acolombier acolombier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks

@@ -125,7 +125,7 @@ class ControllerScriptEngineLegacy : public ControllerScriptEngineBase {
std::unordered_map<QString, std::unique_ptr<mixxx::qml::QmlMixxxControllerScreen>> m_rootItems;
QList<LegacyControllerMapping::QMLModuleInfo> m_modules;
QList<LegacyControllerMapping::ScreenInfo> m_infoScreens;
QString m_resourcePath{QStringLiteral(".")};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, actually this should not break the current behaviour, but I thought it would be best to default the QML path to be ./qml rather than /qml, but since we are calling setResourcePath before loading the scene, I'm happy to ignore that

@acolombier acolombier merged commit 4b827a1 into mixxxdj:main Feb 5, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants