You might remember that I spoke about Plasma’s Publictransport applet getting some reworking during the summer. It’s been over a month since I made that announcement on my blog and while ideally, I’d have liked to have blogged every week about my work, I haven’t really been able to. This is largely down to the fact that I was occupied with work on a project back at my university and I shifted back to home from my hostel as well, after finishing four years of undergraduate studies.
Nevertheless, in the little time that I did have at my disposal, I’ve been able to make some progress indeed and with around a month remaining, I hope to get down to reworking the UI of applets – which admittedly is the most challenging part of the project, as soon as possible.
Here’s what has been done so far,
- Publictransport engine ported to use KF5::ThreadWeaver
- While the engine was pretty much ported, it was more or less a workaround and still compiled against the old ThreadWeaver API.
- ThreadWeaver API for KF5 is noticeably different. Most noticeable of all was perhaps the fact that Job objects do not derive from QObject, hence use of the code in the previous setup was throwing a compile time error.
- This was fixed in a series of commits ( 94797a630cc851ffe9d04bc69e6d6d5a5f8ba66a , f8d5074ee715303cfb872003c937075a7b0c0aec and d67a907b6e602af7dac803ad5deea2d503fe148b )
- Publictransport dataengine is now visible in plasmaengineexplorer
- You’ll need a serviceProvider plugin which you’d have downloaded from GHNS in a typical KDE4 setup.
- GHNS facility is not yet working in the KF5 version of the applet, so this needs to be done manually.
Configuring service providers manually on KF5
This is a really dirty workaround but if you’re really curious and want to try out a few things, here’s what you can do.
First things first, you’ll need to get/download the service providers, somehow. I was able to do this by logging into a KDE4 session, building and running the publictransport applet there. I’ve with me, copies of the Swiss public transport service provider thanks to opendata.ch and a German one provided by Deutsche Bahn. I’ve uploaded these two to my Dropbox and enabled public access.
So if you have a working KDE4 setup, in some distros, the publictransport applet might be provided by your package manager(eg: OpenSuse). In which case, install it, run the applet, download the relevant service providers and look into ~/.kde/share/apps and copy the plasma_engine_publictransport directory as such and place it inside your ~/.local/share directory.
If the applet is not packaged by your distro, I’m afraid you’ll have to build it by source(which is the way I’d recommend btw) or you could request me for the service provider files which you’d like to have and I’d be happy to help.
Hardcode the value of your service provider filename in the serviceproviderplugin.xml file. This shouldn’t be needed and the wildcard entries present there should be picking up all relevant files. That’s something that needs some looking at.
For eg: If I wanted to use the Swiss service provider, I’d add a line as such, inside the <mime-type …> </mime-type> tags of the serviceproviderplugin.xml file
<glob pattern="ch_opendata.pts" />
where “ch_opendata.pts” resides inside your ~/.local/share/plasma_engine_publictransport/serviceProviders directory. The same applies for other service providers. Look for the .pts files.
So to sum it up, you would need to
- Download the application source code
- Download the service providers
- Setup your environment correctly
- Hardcode the service provider filename in the plugin xml file (BUG)
I’ll get down to rewriting the UI as soon as #4 is fixed. Our aim is to list stop details for either an arrival/departure for a vehicle line using just the data from the dataengine, which means I still have lots of work to do.
See you soon!