Comment 17 for bug 1253810

Revision history for this message
MichaƂ Sawicz (saviq) wrote :

When I can see this happening, the following is logged:

(process:17651): GLib-GIO-CRITICAL **: g_bus_watch_name: assertion 'g_dbus_is_name (name)' failed
file:///home/phablet/shell/builddir/plugins/Unity/Indicators/MenuItemFactory.qml:205: TypeError: Cannot call method 'loadExtendedAttributes' of null
file:///home/phablet/shell/builddir/plugins/Unity/Indicators/Messaging/MessageMenuItemFactory.qml:46: TypeError: Cannot read property 'xCanonicalText' of undefined
file:///home/phablet/shell/builddir/plugins/Unity/Indicators/Messaging/MessageMenuItemFactory.qml:45: TypeError: Cannot read property 'xCanonicalTime' of undefined
file:///home/phablet/shell/builddir/plugins/Unity/Indicators/Messaging/MessageMenuItemFactory.qml:49: TypeError: Cannot read property 'xCanonicalAppIcon' of undefined
file:///home/phablet/shell/builddir/plugins/Unity/Indicators/Messaging/MessageMenuItemFactory.qml:48: TypeError: Cannot read property 'icon' of undefined
file:///home/phablet/shell/builddir/plugins/Unity/Indicators/Messaging/MessageMenuItemFactory.qml:28: TypeError: Cannot read property 'xCanonicalMessageActions' of undefined
file:///home/phablet/shell/builddir/plugins/Unity/Indicators/MenuItemFactory.qml:76: TypeError: Cannot call method 'loadExtendedAttributes' of undefined
file:///home/phablet/shell/builddir/plugins/Unity/Indicators/MenuItemFactory.qml:187: TypeError: Cannot call method 'loadExtendedAttributes' of undefined
file:///home/phablet/shell/builddir/plugins/Unity/Indicators/MenuItemFactory.qml:187: TypeError: Cannot call method 'loadExtendedAttributes' of undefined
file:///home/phablet/shell/builddir/plugins/Unity/Indicators/MenuItemFactory.qml:187: TypeError: Cannot call method 'loadExtendedAttributes' of undefined
file:///home/phablet/shell/builddir/plugins/Unity/Indicators/MenuItemFactory.qml:187: TypeError: Cannot call method 'loadExtendedAttributes' of undefined
file:///home/phablet/shell/builddir/plugins/Unity/Indicators/MenuItemFactory.qml:187: TypeError: Cannot call method 'loadExtendedAttributes' of undefined

That seems to explain why that data is unavailable - the extended attributes were never loaded correctly. You can't see the icon, the text, the time - that's the metadata that comes via extended attributes - and they can't be loaded.

What I'm seeing is that loadExtendedAttributes is just called too early sometimes - when the model isn't yet available in the context.

Seems what we need to make sure of, then, is to a) not assume the model is there when we want it b) protect against not-yet-loaded extended attributes. The properties (model and modelIndex) should also be made properties of the BaseMenuItem, I'd say, so that they don't reach out of their scope.

The previously attached branch doesn't address this issue, then.