<div dir="ltr"><span style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:13px">Hi all,</span><div style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:13px">time ago I've designed  a Plasma 4 plasmoid together with a dataengine to configure and control a process (redshift). </div><div style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:13px"><br></div><div style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:13px">The structure is the following:</div><div style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:13px"><span style="line-height:1.5">- The plasmoid allow the user to start and stop the process, this is done by running a servicejob to commmunicate the dataengine to take an action</span></div><div style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:13px">- The dataengine controls the process (start and stop it) [I need a custom dataengine and I cannot use the executable dataengine]</div><div style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:13px">- Multiple instances of the plasmoid and the dataengine share the configuaration via KConfigXT (Singleton) <span style="line-height:1.5">in this way when the user access the plasmoid configuration this is propagated to the dataengine and synced with other instances of the plasmoid</span></div><div style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:13px"><br></div><div style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:13px">Now I want to port this to plasma 5 but I'm facing huge difficulties. I've managed to port the dataengine, rewrite the CMakeFiles and I've partially rewritten the apple in QML.</div><div style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:13px"><br></div><div style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:13px">The problem now is how to manage the configuration.</div><div style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:13px"><br></div><div style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:13px">I know that the plasmoid configuration can be accessed  via plasmoid.configuration and that I can map the fields in main.xml to the ui elements of the config dialog. The problem is how to synchronize this configuration with the other instances of the plasmoid (each plasmoid has his own configuration in plasma 5).</div><div style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:13px">How to pass this configuration to the dataengine?</div><div style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:13px">Any idea to do this in a simple way?</div><div style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:13px"><br></div><div style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:13px">I've tried to extend my plasmoid with a C++ plugin so that in C++ I can still use the old KConfigXT system in order to share a config file between the plasmoid and the dataengine.<br></div><div style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:13px"><br></div><div style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:13px">My current solution is pretty ugly but it works. It's the following:</div><div><font color="#212121" face="helvetica neue, helvetica, arial, sans-serif">- When the configuration of the plasmoid is edited (I check this throught the signal </font>userConfiguringChanged) I get the values from plasmoid.configuration and send it to the plasmoid C++ plugin (with a custom method writeConfig)</div><div>- The plasmoid C++ plugin use KonfigXT to save the configuration and emits a signal myConfigChanged</div><div>- The plasmoid run the service job so that the dataengine can act</div><div>- From all the instances of the plasmoid I monitor the dataengine onNewData signal and when it is catched I read the configuration from the C++ plugin (with a custom method readConfig) and the plugin read it from disk</div><div><br></div><div>In the configuration of all the instances of the plasmoid and the dataengine one are synchronized all the time. It's overly complicated though compared to the plasma 4 solution.</div><div><br></div><div style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:13px">Various doubt:</div><div style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:13px">1) The plasmoid configuration system is explained here: <a href="http://aseigo.blogspot.dk/2013/02/elegant-plasmoid-configuration.html" target="_blank">http://aseigo.blogspot.dk/2013/02/elegant-plasmoid-configuration.html</a>. Is it there any other page of documentation for this?</div><div style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:13px"><br></div><div style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:13px">2) Which is the proper way to extend the QML plasmoid in C++. I've seen two approaches.</div><div style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:13px">- plasmoid.nativeInterface as suggested in plasma-framework/templates/cpp-plasmoid/ (<- This should be documented in techbase, it's quite hidden)</div><div style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:13px">- The other as explained here<span> </span><a href="http://doc.qt.io/qt-5/qtqml-tutorials-extending-qml-example.html" target="_blank">http://doc.qt.io/qt-5/qtqml-tutorials-extending-qml-example.html</a><span> </span>and how I've seen implemented in many plasmoids </div><div style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:13px"><br></div><div style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:13px">Regards</div></div>