[PATCH] Add signals support to kconfig_compiler

Michaël Larouche michael.larouche at kdemail.net
Tue Jan 31 15:03:44 GMT 2006


This patch add support for signals in kconfig_compiler. What does it means ? 
It means that a changed entry can emit a signal to dispatch it to another 
component.  I needed it in Kopete to replace a old hand-made configuration 
class.

First you need to define a list of signals in the configuration file like 
this.
<kcfg>
<signal name="emoticonSettingsChanged" />

<signal name="styleChanged">
  <label>Tell when a complete style change.</label>
    <argument type="String">stylePath</argument>
    <argument type="String">StyleCSSVariant</argument>
</signal>
</kcfg>

After, add to the entry the signal to emit:
<entry key="stylePath" type="String">
  <label>Absolute path to a directory containing a Adium/Kopete chat window 
style.</label>
  <emit signal="styleChanged" />
</entry>

To acheive it, I needed to make KConfigSkeleton derive from QObject to be able 
to call signals in derived classes. 
I define a enum list in the devirated class that I store in a bitmask to 
determine which signal was modified. Then in the derivated usrWriteConfig() 
method, it emit the changed signals. 

Patch included also fix to reference files(to make tests pass), the new test 
files, modifications to build system (automake and CMake), addition to the 
Doxygen files.

--
Michaël Larouche (Shock The Dark Mage)
KDE developer working on Kopete, Kamefu...on dial-up :P
--------------------------------------
Blog: http://mlarouche.blogspot.com/
MSN/Email: michael.larouche at kdemail.net
IRC: irc.freenode.org/DarkShock on #kopete,#solid,#kamefu,#plasma
Jabber: darkshock at myjabber.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kconfig_compiler_signals.patch.gz
Type: application/x-gzip
Size: 8848 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20060131/9999dfec/attachment.bin>


More information about the kde-core-devel mailing list