So yesterday we left off with the need to implement an Activate method on the Quickbar side; well, even after having that in place, the event doesn't seem to be seen by the application, when it's launched from the UI. So we need to dig a bit. That's easy, fire up an ssh shell, and start dbus-monitor -> we get (apologies for the mini-text):
So the interface registration is not correct. And in fact, it nees to be registered to the correct path: /org/freedesktop/DBus. With this fix, we get closer, but the method is not triggered still. The reason is the paramter type, which I had forgotten as "type". D'oh!
This was tricky as the information available was extremely scattered. But after some rambling with AI assitants and Google, I found this repo that helped me set it as QVariantMap. Great. Kicking off the build shows errors right away; and here's where things got obscure to say the least; The error was referring to an "incomplete QVariantMap" type; even tho it was clearly defined in the qmetatypes.h...but after a bit of thinking, by adding the correct includes (QVariant, QMap) before the relevant header files, the build succeeded. And I had finally Quickbar integrated! Working! Woot woot! Incredible! Even with SailJail in place!
There's still a few issues to be ironed out on the UI side however. And the way the app is built, its currently not possible to work solely
on the UI without running it on the phone (which is extremely unhandy).
Also launching apps doesnt seem to be functional (internally we rely on the libcontentaction::Action::triggerAndWait method, perhaps something has changed somewhere); this is worrying as even in debug mode it seems to be non-functional; however, we get "Exec action triggered without proper appInfo". Heading over to the libcontentaction repo gives some more hints and confusion. Apparently, the library attempts to re-create a new .desktop file from the existing one, only turning it into something unusable. I suspect File permissions, not some other error as the action can load the .desktop file from the app side just fine (and it appears to be valid when checked with the ContentAction::Action::isValid); keyFile is path to the .desktop file:
if (!execError)
appInfo = g_desktop_app_info_new_from_keyfile(keyFile);
it appears the appInfo is not properly set, or, better, not set at all. Unfortunately, the libcontentaction debugging is very limited. So there is only so much info we get get from it.
At least the implementation of g_desktop_app_info_new_from_keyfile here should give some insights. This method can fail if the relevant entries are not present (exec over all), or if it can't locate the program from the path. None of these should be the problem here, at least at first sight. So we have a bit of a conundrum. lca-tool from terminal seems to work; Quickbar follows the exactly same way to launch an app as lca-tool does; but still, for Quickbar fetching the appInfo fails. Even testing with QDesktopServices only is capable to launch fingerterm (and no other app), albeit with some weird notification. It is a mystery that remains to be solved!
And to solve it, we need to work on libcontentaction a tad.
For example, by adding some extra logging in the Exec action handler , in particular:
LCA_WARNING << "=============> EXEC ERROR " << execError
<< " EXEC STRING " << execString << " Invoker "
<< QFile::exists("/usr/bin/invoker");
Once we backup and patch the libcontentaction on the phone (under /usr/lib64), we get ths log when trying to launch say Terminal from Quickbar:
[W] ContentAction::ExecPrivate::ExecPrivate:67 -
libcontentaction: =============> EXEC ERROR 0x0 EXEC STRING /usr/bin/fingerterm Invoker false
[W] ContentAction::ExecPrivate::ExecPrivate:115 - libcontentaction: invalid desktop file "/home/defaultuser/.local/share/applications/fingerterm.desktop"
[W] ContentAction::ExecPrivate::trigger:146 - libcontentaction: Exec action triggered without proper appInfo^
As can be seen, the QFile::exists fails to validate the /usr/bin/invoker's presence, which then causes the libcontentaction to not rely on invoker. This might be intentional; but lets check with lca-tool from a terminal session:
lca-tool --triggerdesktop fingerterm.desktop
[W] ContentAction::ExecPrivate::ExecPrivate:67 - libcontentaction: =============> EXEC ERROR 0x0 EXEC STRING /usr/bin/fingerterm Invoker true
[W] ContentAction::ExecPrivate::ExecPrivate:100 - libcontentaction: =============> Invoker string %s invoker --type=generic --id=fingerterm --single-instance /usr/bin/fingerterm
So lca-tool appears to not be suffering from the same issue.
As we know, terminal has Sailjail disabled however. This might require some help from the sailors, to understand what is going on. Time to ask!