Public feed
#891956
Metastring Protocol communication
=================================
VALIDATION
----------
Applet Sends %1|validate|%2 Where %1 is the Ion plugin name (ie envcan)
Where %2 is the Place to validate (ie 'Calgary, AB')
- This goes to the Ions
Ion parses the Applet string sent and sends the validate() routine %1|%2
- Where %1 is the Ion plugin name (envcan)
- Where %2 is the Place to validate (Calgary, AB)
validate returns place|%1 - Where %1 is the place that was confirmed valid ('Calgary AB')
- These strings are reused and sent back to the applet to confirm they are valid locations.
The Ion sends back the following to the Applet from the Ion's updateIonSource() method
pluginname|valid|single|%1 - Where %1 is place name (when only one match is found)
pluginname|valid|multiple|%1 - Where %1 is a QString that contains all the places concatenated
pluginname|invalid|single|%1 - Where %1 is the place name that is not valid (there can only be one invalid patch per plugin)
Note: some plugins like BBC return 'extra' data this is appended
pluginname|valid|single|place|%1|extra|%2 - Where %1 is a place and %2 is extra data (a URL we need to when reloading the applet)
or for Multiple places
pluginname|valid|multiple|place|%1|extra|%2 - Where %1 is a place and %2 is extra data this is all concatenated place|%1|extra|...repeats.
Applet then parses the ion metastring data returned.
WEATHER
-------
Once validation is completed, we need to get the weather to do this we send to the ion engine:
%1|weather|%2|%3 - Where %1 is the plugin name
- Where %2 is the place
- Where %3 - optional is any extra data the ion provided us (so we can store this in a
KConfig
When this is sent the ion parses the string 'weather' and dumps the data associated to the place.
PROPERTIES
----------
We use a Q_PROPERTY to pass 'WINDFORMAT|%1' to the ion we use %1|weather|%2|%3 as a 'key' for the Q_PROPERTY so it can be uniquely identified with the correct data source (ion) and place. So, if you load Plasma with 6 applets each applet with a wind format is uniquely handled as stored in the KConfig.