Skip to content

Fix MobileTextActionsToolBar

Joshua Goins requested to merge work/redstrate/fix-mobileactiontoolbar into master

In KF6, there is this really annoying error message that spams the logs:

Warning: file:///home/josh/kde6/usr/lib/qml/org/kde/desktop/private/MobileCursor.qml:33:13: Unable to assign [undefined] to bool (file:///home/josh/kde6/usr/lib/qml/org/kde/desktop/private/MobileCursor.qml:33, )
Warning: file:///home/josh/kde6/usr/lib/qml/org/kde/desktop/private/MobileCursor.qml:33:13: Unable to assign [undefined] to bool (file:///home/josh/kde6/usr/lib/qml/org/kde/desktop/private/MobileCursor.qml:33, )
Warning: file:///home/josh/kde6/usr/lib/qml/org/kde/desktop/private/MobileCursor.qml:33:13: Unable to assign [undefined] to bool (file:///home/josh/kde6/usr/lib/qml/org/kde/desktop/private/MobileCursor.qml:33, )
Warning: file:///home/josh/kde6/usr/lib/qml/org/kde/desktop/private/MobileCursor.qml:33:13: Unable to assign [undefined] to bool (file:///home/josh/kde6/usr/lib/qml/org/kde/desktop/private/MobileCursor.qml:33, )

What does this mean? Well it's trying to access a property on MobileTextActionsToolbar, which is a singleton. This means that these singletons are actually null and causing all sorts of issues apart from the (terrifyingly) few errors Qt Quick throws at us. The root cause is actually !176 (merged), which uses the ECMQmlModule to handle installing the QML files. This is fine, except that qqc2-desktop-style didn't install them properly. See the qmldir:

# This file was automatically generated by ECMQmlModule and should not be modified
module org.kde.desktop
BusyIndicator 1.0 BusyIndicator.qml
Button 1.0 Button.qml
CheckBox 1.0 CheckBox.qml
CheckDelegate 1.0 CheckDelegate.qml
CheckIndicator 1.0 CheckIndicator.qml
ComboBox 1.0 ComboBox.qml
Container 1.0 Container.qml
Control 1.0 Control.qml
DelayButton 1.0 DelayButton.qml
Dial 1.0 Dial.qml
Dialog 1.0 Dialog.qml
DialogButtonBox 1.0 DialogButtonBox.qml
Drawer 1.0 Drawer.qml
Frame 1.0 Frame.qml
GroupBox 1.0 GroupBox.qml
ItemDelegate 1.0 ItemDelegate.qml
Label 1.0 Label.qml
Menu 1.0 Menu.qml
MenuBar 1.0 MenuBar.qml
MenuBarItem 1.0 MenuBarItem.qml
MenuItem 1.0 MenuItem.qml
MenuSeparator 1.0 MenuSeparator.qml
Page 1.0 Page.qml
Pane 1.0 Pane.qml
Popup 1.0 Popup.qml
ProgressBar 1.0 ProgressBar.qml
RadioButton 1.0 RadioButton.qml
RadioDelegate 1.0 RadioDelegate.qml
RangeSlider 1.0 RangeSlider.qml
RoundButton 1.0 RoundButton.qml
ScrollBar 1.0 ScrollBar.qml
ScrollView 1.0 ScrollView.qml
Slider 1.0 Slider.qml
SpinBox 1.0 SpinBox.qml
StackView 1.0 StackView.qml
Switch 1.0 Switch.qml
SwitchDelegate 1.0 SwitchDelegate.qml
SwitchIndicator 1.0 SwitchIndicator.qml
TabBar 1.0 TabBar.qml
TabButton 1.0 TabButton.qml
TextArea 1.0 TextArea.qml
TextField 1.0 TextField.qml
ToolBar 1.0 ToolBar.qml
ToolButton 1.0 ToolButton.qml
ToolSeparator 1.0 ToolSeparator.qml
ToolTip 1.0 ToolTip.qml
DefaultListItemBackground 1.0 DefaultListItemBackground.qml
FocusRect 1.0 FocusRect.qml
MobileCursor 1.0 MobileCursor.qml
MobileTextActionsToolBar 1.0 MobileTextActionsToolBar.qml
TextFieldContextMenu 1.0 TextFieldContextMenu.qml
# KDE-qmldir-Version: 1.0

The private components are not specified properly (they live under private/, not under the root of the directory) and the MobileTextActionsToolBar is not a singleton here either, it's missing the singleton keyword. Support for these had to be added through ECM, which I did here: extra-cmake-modules!359 (merged). In qqc2-desktop-style: I set the MobileTextActionsToolBar as singleton, marked the sources as private, and yeeted the old qmldir.

Edited by Joshua Goins

Merge request reports