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

VPN-6375 - Fix QML modules import #9531

Merged
merged 3 commits into from
May 13, 2024
Merged
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: 4 additions & 2 deletions nebula/ui/components/MZScreenBase.qml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ Item {
_menuIconButtonMirror: stackview.depth !== 1 && MZLocalizer.isRightToLeft
_iconButtonAccessibleName: stackview.depth === 1 ? MZI18n.GlobalClose : MZI18n.GlobalGoBack
_menuOnBackClicked: () => maybeRequestPreviousScreen()
titleComponent: stackview.currentItem.titleComponent ? stackview.currentItem.titleComponent : null
rightButtonComponent: stackview.currentItem.rightMenuButton ? stackview.currentItem.rightMenuButton : null
titleComponent: stackview.currentItem && stackview.currentItem.titleComponent
? stackview.currentItem.titleComponent : null
rightButtonComponent: stackview.currentItem && stackview.currentItem.rightMenuButton
? stackview.currentItem.rightMenuButton : null

title: ""

Expand Down
1 change: 1 addition & 0 deletions src/ui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
qt_add_qml_module(mozillavpn-ui
VERSION 1.0
URI Mozilla.VPN
NO_PLUGIN_OPTIONAL
Copy link
Contributor Author

@brizental brizental May 13, 2024

Choose a reason for hiding this comment

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

Ok, so here is the thing: this fixes the issue and I don't know why.

With the removal of qmldir files manually written by developers
and the usage of qt_add_qml_module, it's not like there will not
be any more qmldir files, it's that they will be generated for us.

When I looked at the generated files I noted they have this in the header

linktarget mozillavpn-uiplugin
optional plugin mozillavpn-uiplugin
classname Mozilla_VPNPlugin
typeinfo mozillavpn-ui.qmltypes
prefer :/Mozilla/VPN/

These are not defined in the lottie and nebula qmldir files -- which work.

I started playing around with options that would change this such as
NO_PLUGIN (which did nothing) and NO_PLUGIN_OPTINAL which fixed the import
issues we were having :shrug.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh yeah, just for the record. After I aded this property
this is what the header looks like:

linktarget mozillavpn-uiplugin
plugin mozillavpn-uiplugin
classname Mozilla_VPNPlugin
typeinfo mozillavpn-ui.qmltypes
prefer :/Mozilla/VPN/

STATIC
OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Mozilla/VPN
QML_FILES
Expand Down
2 changes: 1 addition & 1 deletion src/ui/screens/messaging/ViewMessage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ MZViewBase {
anchors.left: parent.left
anchors.right: parent.right

view: MZComposerView.View.Message
view: MZComposerView.View && MZComposerView.View.Message
addon: message
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/ui/screens/messaging/ViewMessagesInbox.qml
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ MZViewBase {
Layout.preferredHeight: 8
Layout.preferredWidth: 8

opacity: addon.isRead? 0 : 1
opacity: addon && addon.isRead ? 0 : 1
radius: Layout.preferredHeight / 2
color: MZTheme.theme.blue
}
Expand Down
Loading