View Single Post
Posts: 1,548 | Thanked: 7,510 times | Joined on Apr 2010 @ Czech Republic
#2020
Originally Posted by rinigus View Post
@MartinK: interesting, which limitations are you hitting with sailfish-qml? Having a dedicated launcher gives more flexibility in long run, though.
There were a couple, mainly with sailfish-qml forcing a certain application structure, which is not really compatible with how modRana files are laid out & how it is launcher on other platforms:
  • the main qml file needs to be called harbour-<app name> and located in /usr/share/harbour-<app name>
  • all the QML files need to be in in /usr/share/harbour-<app name>/qml
  • sailfish-qml sets the PWD to /home/nemo, which complicates loading of Python modules
  • there is no option to set QML import path (needed for Universal Components), it has to be done via an environmental variable, which is a problem as invoker can't really take those in the Exec line of a desktop file
Normally modRana supports multiple GUIs and the GUI files are located in the corresponding GUI sub folder, it's expected the PWD is pointing to the top level modRana directory and the currently selected UC backend should be added to the QML import path.

To achieve this I had to do some pretty nasty & fragile source code mangling during the build of the Sailfish OS package.

Now with the native launcher, I have full control over QML import path, PWD/PYTHONPATH, argv and the QML execution environment in general.

It has also the nice side effect that people now can easily start modRana by typing:

Code:
harbour-modrana
This is also in $PATH & autocomplete will find it, unlike before.

There are also some other reasons for this:
  • IIRC Flatpak will need a launcher like this anyway
  • if I ever start doing packages for Android again a similar type of launcher is needed there as well
  • argument passing should be more doable with native launcher
    • no arg - start Qt 5 GUI
    • some args - pass them to modrana.py instead of starting GUI
  • if I ever need access to some C/C++ API or just want to compute something really quickly in native code, I now have the option via the launcher (likely with a pure-Python fallback where possible)

The only possible downside/change (aside from the time spent on this) is that the modRana package is no longer noarch, but so far I have not hit any real issues because of that.
__________________
modRana: a flexible GPS navigation system
Mieru: a flexible manga and comic book reader
Universal Components - a solution for native looking yet component set independent QML appliactions (QtQuick Controls 2 & Silica supported as backends)
 

The Following 8 Users Say Thank You to MartinK For This Useful Post: