<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en_US" xml:lang="en_US"> <head> <title>kutils: KSettings::Dispatcher Class Reference (kutils)</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <meta http-equiv="pics-label" content='(pics-1.1 "http://www.icra.org/ratingsv02.html" comment "ICRAonline DE v2.0" l gen true for "http://www.kde.org" r (nz 1 vz 1 lz 1 oz 1 cb 1) "http://www.rsac.org/ratingsv01.html" l gen true for "http://www.kde.org" r (n 0 s 0 v 0 l 0))' /> <meta name="trademark" content="KDE e.V." /> <meta name="description" content="K Desktop Environment Homepage, KDE.org" /> <meta name="MSSmartTagsPreventParsing" content="true" /> <meta name="robots" content="all" /> <link rel="shortcut icon" href="../../favicon.ico" /> <link rel="stylesheet" media="screen" type="text/css" title="APIDOX" href="doxygen.css" /> </head> <body> <div id="nav_header_top" align="right"> <a href="#content" class="doNotDisplay" accesskey="2">Skip to main content ::</a> <a href="../.."><img id="nav_header_logo" alt="Home" align="left" src="../../kde_gear_64.png" border="0" /></a> <span class="doNotDisplay">::</span> <div id="nav_header_title" align="left">KDE API Reference</div> </div> <div id="nav_header_bottom" align="right"> <span class="doNotDisplay">:: <a href="#navigation" accesskey="5">Skip to Link Menu</a><br/></span> <div id="nav_header_bottom_right" style="text-align: left;"> / <a href="../..">API Reference</a> / <a href=".">kutils</a> </div> </div> <table id="main" border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td valign="top" class="menuheader" height="0"></td> <td id="contentcolumn" valign="top" rowspan="2" > <div id="content" style="padding-top: 0px;"><div style="width:100%; margin: 0px; padding: 0px;"> <a name="content"></a> <!-- Generated by Doxygen 1.7.4 --> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="namespaceKSettings.html">KSettings</a> </li> <li class="navelem"><a class="el" href="classKSettings_1_1Dispatcher.html">Dispatcher</a> </li> </ul> </div> </div> <div class="header"> <div class="summary"> <a href="#pub-slots">Public Slots</a> | <a href="#pub-methods">Public Member Functions</a> | <a href="#pub-static-methods">Static Public Member Functions</a> | <a href="#friends">Friends</a> </div> <div class="headertitle"> <div class="title">KSettings::Dispatcher Class Reference<div class="ingroups"><a class="el" href="group__settings.html">Settings UI classes</a></div></div> </div> </div> <div class="contents"> <!-- doxytag: class="KSettings::Dispatcher" --><!-- doxytag: inherits="QObject" --> <p>Dispatch change notifications from the KCMs to the program. <a href="classKSettings_1_1Dispatcher.html#details">More...</a></p> <p><code>#include <<a class="el" href="dispatcher_8h_source.html">dispatcher.h</a>></code></p> <div class="dynheader"> Inheritance diagram for KSettings::Dispatcher:</div> <div class="dyncontent"> <div class="center"> <img src="classKSettings_1_1Dispatcher.png" usemap="#KSettings::Dispatcher_map" alt=""/> <map id="KSettings::Dispatcher_map" name="KSettings::Dispatcher_map"> <area href="qobject.html" alt="QObject" shape="rect" coords="0,0,131,24"/> </map> </div></div> <p><a href="classKSettings_1_1Dispatcher-members.html">List of all members.</a></p> <table class="memberdecls"> <tr><td colspan="2"><h2><a name="pub-slots"></a> Public Slots</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classKSettings_1_1Dispatcher.html#ab6a3bac2a0b1fc5533fb3aa2e9b9fade">reparseConfiguration</a> (const <a class="elRef" href="qcstring.html">QCString</a> &instanceName)</td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classKSettings_1_1Dispatcher.html#a0bdd0012d29c2b1d681ae43f622a5916">syncConfiguration</a> ()</td></tr> <tr><td colspan="2"><h2><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classKSettings_1_1Dispatcher.html#a2c4f3f7998a8dea1c424c8abf06d6608">registerInstance</a> (<a class="elRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKInstance.html">KInstance</a> *instance, <a class="elRef" href="qobject.html">QObject</a> *recv, const char *slot)</td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="elRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfig.html">KConfig</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classKSettings_1_1Dispatcher.html#a3d5a4732dd8f574f0841ce7a0923959c">configForInstanceName</a> (const <a class="elRef" href="qcstring.html">QCString</a> &instanceName)</td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="elRef" href="qstrlist.html">QStrList</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classKSettings_1_1Dispatcher.html#a17b7865c53257961f512127b6b2cce1d">instanceNames</a> () const </td></tr> <tr><td colspan="2"><h2><a name="pub-static-methods"></a> Static Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classKSettings_1_1Dispatcher.html">Dispatcher</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classKSettings_1_1Dispatcher.html#a1686a1e21454ee58c826d4c0b4e60369">self</a> ()</td></tr> <tr><td colspan="2"><h2><a name="friends"></a> Friends</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a072c41f2ec2f598b2f14d50eade44764"></a><!-- doxytag: member="KSettings::Dispatcher::KStaticDeleter< Dispatcher >" ref="a072c41f2ec2f598b2f14d50eade44764" args="" --> class </td><td class="memItemRight" valign="bottom"><a class="el" href="classKSettings_1_1Dispatcher.html#a072c41f2ec2f598b2f14d50eade44764">KStaticDeleter< Dispatcher ></a></td></tr> </table> <hr/><a name="details" id="details"></a><h2>Detailed Description</h2> <div class="textblock"><p>Dispatch change notifications from the KCMs to the program. </p> <p>Since your program does not have direct control over the KCMs that get loaded into the KConfigureDialog you need a way to get notified. This is what you do: </p> <div class="fragment"><pre class="fragment"> <a class="code" href="classKSettings_1_1Dispatcher.html#a1686a1e21454ee58c826d4c0b4e60369" title="Get a reference the the Dispatcher object.">Dispatcher::self</a>()->registerInstance( <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/namespaceKNotifyClient.html#a1eb3ef58f2ad2a74b5c88f54d68de022">instance</a>(), <span class="keyword">this</span>, SLOT( loadSettings() ) ); </pre></div><dl class="author"><dt><b>Author:</b></dt><dd>Matthias Kretz <<a href="mailto:kretz@kde.org">kretz@kde.org</a>> </dd></dl> <dl class="since"><dt><b>Since:</b></dt><dd>3.2 </dd></dl> <p>Definition at line <a class="el" href="dispatcher_8h_source.html#l00051">51</a> of file <a class="el" href="dispatcher_8h_source.html">dispatcher.h</a>.</p> </div><hr/><h2>Member Function Documentation</h2> <a class="anchor" id="a3d5a4732dd8f574f0841ce7a0923959c"></a><!-- doxytag: member="KSettings::Dispatcher::configForInstanceName" ref="a3d5a4732dd8f574f0841ce7a0923959c" args="(const QCString &instanceName)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="elRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfig.html">KConfig</a> * KSettings::Dispatcher::configForInstanceName </td> <td>(</td> <td class="paramtype">const <a class="elRef" href="qcstring.html">QCString</a> & </td> <td class="paramname"><em>instanceName</em></td><td>)</td> <td></td> </tr> </table> </div> <div class="memdoc"> <dl class="return"><dt><b>Returns:</b></dt><dd>the <a class="elRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfig.html">KConfig</a> object that belongs to the instanceName </dd></dl> <p>Definition at line <a class="el" href="dispatcher_8cpp_source.html#l00086">86</a> of file <a class="el" href="dispatcher_8cpp_source.html">dispatcher.cpp</a>.</p> </div> </div> <a class="anchor" id="a17b7865c53257961f512127b6b2cce1d"></a><!-- doxytag: member="KSettings::Dispatcher::instanceNames" ref="a17b7865c53257961f512127b6b2cce1d" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="elRef" href="qstrlist.html">QStrList</a> KSettings::Dispatcher::instanceNames </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </div> <div class="memdoc"> <dl class="return"><dt><b>Returns:</b></dt><dd>a list of all the instance names that are currently registered </dd></dl> <p>Definition at line <a class="el" href="dispatcher_8cpp_source.html#l00100">100</a> of file <a class="el" href="dispatcher_8cpp_source.html">dispatcher.cpp</a>.</p> </div> </div> <a class="anchor" id="a2c4f3f7998a8dea1c424c8abf06d6608"></a><!-- doxytag: member="KSettings::Dispatcher::registerInstance" ref="a2c4f3f7998a8dea1c424c8abf06d6608" args="(KInstance *instance, QObject *recv, const char *slot)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void KSettings::Dispatcher::registerInstance </td> <td>(</td> <td class="paramtype"><a class="elRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKInstance.html">KInstance</a> * </td> <td class="paramname"><em>instance</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="elRef" href="qobject.html">QObject</a> * </td> <td class="paramname"><em>recv</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const char * </td> <td class="paramname"><em>slot</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Register a slot to be called when the configuration for the instance has changed. </p> <p><code>instance</code> is the <a class="elRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKInstance.html">KInstance</a> object that is passed to <a class="elRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKGenericFactory.html">KGenericFactory</a> (if it is used). You can query it with KGenericFactory<YourClassName>::instance(). instance->instanceName() is also the same name that is put into the .desktop file of the KCMs for the X-KDE-ParentComponents.</p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">instance</td><td>The <a class="elRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKInstance.html">KInstance</a> object </td></tr> <tr><td class="paramname">recv</td><td>The object that should receive the signal </td></tr> <tr><td class="paramname">slot</td><td>The slot to be called: SLOT( slotName() ) </td></tr> </table> </dd> </dl> <p>Definition at line <a class="el" href="dispatcher_8cpp_source.html#l00061">61</a> of file <a class="el" href="dispatcher_8cpp_source.html">dispatcher.cpp</a>.</p> </div> </div> <a class="anchor" id="ab6a3bac2a0b1fc5533fb3aa2e9b9fade"></a><!-- doxytag: member="KSettings::Dispatcher::reparseConfiguration" ref="ab6a3bac2a0b1fc5533fb3aa2e9b9fade" args="(const QCString &instanceName)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void KSettings::Dispatcher::reparseConfiguration </td> <td>(</td> <td class="paramtype">const <a class="elRef" href="qcstring.html">QCString</a> & </td> <td class="paramname"><em>instanceName</em></td><td>)</td> <td><code> [slot]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Call this slot when the configuration belonging to the associated instance name has changed. </p> <p>The registered slot will be called.</p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">instanceName</td><td>The value of X-KDE-ParentComponents. </td></tr> </table> </dd> </dl> <p>Definition at line <a class="el" href="dispatcher_8cpp_source.html#l00110">110</a> of file <a class="el" href="dispatcher_8cpp_source.html">dispatcher.cpp</a>.</p> </div> </div> <a class="anchor" id="a1686a1e21454ee58c826d4c0b4e60369"></a><!-- doxytag: member="KSettings::Dispatcher::self" ref="a1686a1e21454ee58c826d4c0b4e60369" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classKSettings_1_1Dispatcher.html">Dispatcher</a> * KSettings::Dispatcher::self </td> <td>(</td> <td class="paramname"></td><td>)</td> <td><code> [static]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Get a reference the the <a class="el" href="classKSettings_1_1Dispatcher.html" title="Dispatch change notifications from the KCMs to the program.">Dispatcher</a> object. </p> <p>Definition at line <a class="el" href="dispatcher_8cpp_source.html#l00040">40</a> of file <a class="el" href="dispatcher_8cpp_source.html">dispatcher.cpp</a>.</p> </div> </div> <a class="anchor" id="a0bdd0012d29c2b1d681ae43f622a5916"></a><!-- doxytag: member="KSettings::Dispatcher::syncConfiguration" ref="a0bdd0012d29c2b1d681ae43f622a5916" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void KSettings::Dispatcher::syncConfiguration </td> <td>(</td> <td class="paramname"></td><td>)</td> <td><code> [slot]</code></td> </tr> </table> </div> <div class="memdoc"> <p>When this slot is called the <a class="elRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfig.html">KConfig</a> objects of all the registered instances are sync()ed. </p> <p>This is usefull when some other <a class="elRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfig.html">KConfig</a> objects will read/write from/to the same config file, so that you can first write out the current state of the <a class="elRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfig.html">KConfig</a> objects. </p> <p>Definition at line <a class="el" href="dispatcher_8cpp_source.html#l00127">127</a> of file <a class="el" href="dispatcher_8cpp_source.html">dispatcher.cpp</a>.</p> </div> </div> <hr/>The documentation for this class was generated from the following files:<ul> <li><a class="el" href="dispatcher_8h_source.html">dispatcher.h</a></li> <li><a class="el" href="dispatcher_8cpp_source.html">dispatcher.cpp</a></li> </ul> </div> </div></div> </td> </tr> <tr> <td valign="top" id="leftmenu" width="25%"> <a name="navigation"></a> <div class="menu_box"><h2>kutils</h2> <div class="nav_list"> <ul><li><a href="index.html">Main Page</a></li><li><a href="modules.html">Modules</a></li><li><a href="namespaces.html">Namespace List</a></li><li><a href="hierarchy.html">Class Hierarchy</a></li><li><a href="classes.html">Alphabetical List</a></li><li><a href="annotated.html">Class List</a></li><li><a href="files.html">File List</a></li><li><a href="functions.html">Class Members</a></li><li><a href="pages.html">Related Pages</a></li></ul> <!-- <h2>Class Picker</h2> <div style="text-align: center;"> <form name="guideform"> <select name="guidelinks" style="width:100%;" onChange="window.location=document.guideform.guidelinks.options[document.guideform.guidelinks.selectedIndex].value"> <option value="annotated.html">-- Choose --</option> <option value="classKCModuleContainer.html">kcmodulecontainer</option>, <option value="classKCModuleInfo.html">kcmoduleinfo</option>, <option value="classKCModuleLoader.html">kcmoduleloader</option>, <option value="classKCModuleProxy.html">kcmoduleproxy</option>, <option value="classKCModuleProxyIface.html">kcmoduleproxyiface</option>, <option value="classKCModuleProxyRootDispatcher.html">kcmoduleproxyrootdispatcher</option>, <option value="classKCMultiDialog.html">kcmultidialog</option>, <option value="classKFind.html">kfind</option>, <option value="classKFindDialog.html">kfinddialog</option>, <option value="classKMultiTabBar.html">kmultitabbar</option>, <option value="classKMultiTabBarButton.html">kmultitabbarbutton</option>, <option value="classKMultiTabBarTab.html">kmultitabbartab</option>, <option value="classKPluginInfo.html">kplugininfo</option>, <option value="classKPluginSelector.html">kpluginselector</option>, <option value="classKReplace.html">kreplace</option>, <option value="classKReplaceDialog.html">kreplacedialog</option>, <option value="classKSettings_1_1ComponentsDialog.html">ksettings::componentsdialog</option>, <option value="classKSettings_1_1Dialog.html">ksettings::dialog</option>, <option value="classKSettings_1_1Dispatcher.html">ksettings::dispatcher</option>, <option value="classKSettings_1_1PluginPage.html">ksettings::pluginpage</option>, </select> </form> </div> --> </div></div> <div class="menu_box"><h2>API Dox</h2> <div class="nav_list"> <ul> <li><a href="../../arts/html/index.html">arts</a></li><li><a href="../../dcop/html/index.html">dcop</a></li><li><a href="../../dnssd/html/index.html">dnssd</a></li><li><a href="../../interfaces/html/index.html">interfaces</a></li><li> <a href="../../interfaces/kimproxy/interface/html/index.html">interface</a></li><li> <a href="../../interfaces/kimproxy/library/html/index.html">library</a></li><li> <a href="../../interfaces/kspeech/html/index.html">kspeech</a></li><li> <a href="../../interfaces/ktexteditor/html/index.html">ktexteditor</a></li><li><a href="../../kabc/html/index.html">kabc</a></li><li><a href="../../kate/html/index.html">kate</a></li><li><a href="../../kcmshell/html/index.html">kcmshell</a></li><li><a href="../../kdecore/html/index.html">kdecore</a></li><li><a href="../../kded/html/index.html">kded</a></li><li><a href="../../kdefx/html/index.html">kdefx</a></li><li><a href="../../kdeprint/html/index.html">kdeprint</a></li><li><a href="../../kdesu/html/index.html">kdesu</a></li><li><a href="../../kdeui/html/index.html">kdeui</a></li><li><a href="../../kdoctools/html/index.html">kdoctools</a></li><li><a href="../../khtml/html/index.html">khtml</a></li><li><a href="../../kimgio/html/index.html">kimgio</a></li><li><a href="../../kinit/html/index.html">kinit</a></li><li><a href="../../kio/html/index.html">kio</a></li><li> <a href="../../kio/bookmarks/html/index.html">bookmarks</a></li><li> <a href="../../kio/httpfilter/html/index.html">httpfilter</a></li><li> <a href="../../kio/kfile/html/index.html">kfile</a></li><li> <a href="../../kio/kio/html/index.html">kio</a></li><li> <a href="../../kio/kioexec/html/index.html">kioexec</a></li><li> <a href="../../kio/kpasswdserver/html/index.html">kpasswdserver</a></li><li> <a href="../../kio/kssl/html/index.html">kssl</a></li><li><a href="../../kioslave/html/index.html">kioslave</a></li><li> <a href="../../kioslave/http/html/index.html">http</a></li><li><a href="../../kjs/html/index.html">kjs</a></li><li><a href="../../kmdi/html/index.html">kmdi</a></li><li> <a href="../../kmdi/kmdi/html/index.html">kmdi</a></li><li><a href="../../knewstuff/html/index.html">knewstuff</a></li><li><a href="../../kparts/html/index.html">kparts</a></li><li><a href="../../kresources/html/index.html">kresources</a></li><li><a href="../../kspell2/html/index.html">kspell2</a></li><li><a href="../../kunittest/html/index.html">kunittest</a></li><li><a href="../../kutils/html/index.html">kutils</a></li><li><a href="../../kwallet/html/index.html">kwallet</a></li><li><a href="../../libkmid/html/index.html">libkmid</a></li><li><a href="../../libkscreensaver/html/index.html">libkscreensaver</a></li> </ul></div></div> </td> </tr> </table> <span class="doNotDisplay"> <a href="http://www.kde.org/" accesskey="8">KDE Home</a> | <a href="http://accessibility.kde.org/" accesskey="9">KDE Accessibility Home</a> | <a href="http://www.kde.org/media/accesskeys.php" accesskey="0">Description of Access Keys</a> </span> <div style="height: 8px"></div> <div id="footer"> <div id="footer_left"> Maintained by <a href="mailto:groot@kde.org">Adriaan de Groot</a> and <a href="mailto:winter@kde.org">Allen Winter</a>. <br/> KDE and K Desktop Environment are trademarks of <a href="http://www.kde.org/areas/kde-ev/" title="Homepage of the KDE non-profit Organization">KDE e.V.</a> | <a href="http://www.kde.org/contact/impressum.php">Legal</a> </div> <div id="footer_right"><img src="/media/images/footer_right.png" style="margin: 0px" alt="" /></div> </div> <!-- WARNING: DO NOT SEND MAIL TO THE FOLLOWING EMAIL ADDRESS! YOU WILL BE BLOCKED INSTANTLY AND PERMANENTLY! <a href="mailto:aaaatrap-425acc3b5374943f@kde.org">Block me</a> WARNING END --> </body> </html>