Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > media > main-release > by-pkgid > ea24284f03fd4a8a4b64047514d93f64 > files > 324

lib64kdegames1-devel-3.5.9-2mdv2008.1.x86_64.rpm

<?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>libkdegames: kgamepropertyhandler.cpp Source File (libkdegames)</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=".">libkdegames</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.5.5 -->
<h1>kgamepropertyhandler.cpp</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment">    This file is part of the KDE games library</span>
<a name="l00003"></a>00003 <span class="comment">    Copyright (C) 2001 Andreas Beckermann (b_mann@gmx.de)</span>
<a name="l00004"></a>00004 <span class="comment">    Copyright (C) 2001 Martin Heni (martin@heni-online.de)</span>
<a name="l00005"></a>00005 <span class="comment"></span>
<a name="l00006"></a>00006 <span class="comment">    This library is free software; you can redistribute it and/or</span>
<a name="l00007"></a>00007 <span class="comment">    modify it under the terms of the GNU Library General Public</span>
<a name="l00008"></a>00008 <span class="comment">    License version 2 as published by the Free Software Foundation.</span>
<a name="l00009"></a>00009 <span class="comment"></span>
<a name="l00010"></a>00010 <span class="comment">    This library is distributed in the hope that it will be useful,</span>
<a name="l00011"></a>00011 <span class="comment">    but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00012"></a>00012 <span class="comment">    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU</span>
<a name="l00013"></a>00013 <span class="comment">    Library General Public License for more details.</span>
<a name="l00014"></a>00014 <span class="comment"></span>
<a name="l00015"></a>00015 <span class="comment">    You should have received a copy of the GNU Library General Public License</span>
<a name="l00016"></a>00016 <span class="comment">    along with this library; see the file COPYING.LIB.  If not, write to</span>
<a name="l00017"></a>00017 <span class="comment">    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,</span>
<a name="l00018"></a>00018 <span class="comment">    Boston, MA 02110-1301, USA.</span>
<a name="l00019"></a>00019 <span class="comment">*/</span>
<a name="l00020"></a>00020 <span class="comment">/*</span>
<a name="l00021"></a>00021 <span class="comment">    $Id: kgamepropertyhandler.cpp 465369 2005-09-29 14:33:08Z mueller $</span>
<a name="l00022"></a>00022 <span class="comment">*/</span>
<a name="l00023"></a>00023 
<a name="l00024"></a>00024 <span class="preprocessor">#include "kgamepropertyhandler.h"</span>
<a name="l00025"></a>00025 <span class="preprocessor">#include "kgameproperty.h"</span>
<a name="l00026"></a>00026 <span class="preprocessor">#include "kgamemessage.h"</span>
<a name="l00027"></a>00027 
<a name="l00028"></a>00028 <span class="preprocessor">#include &lt;qmap.h&gt;</span>
<a name="l00029"></a>00029 <span class="preprocessor">#include &lt;qptrqueue.h&gt;</span>
<a name="l00030"></a>00030 
<a name="l00031"></a>00031 <span class="preprocessor">#include &lt;klocale.h&gt;</span>
<a name="l00032"></a>00032 <span class="preprocessor">#include &lt;typeinfo&gt;</span>
<a name="l00033"></a>00033 
<a name="l00034"></a>00034 <span class="preprocessor">#define KPLAYERHANDLER_LOAD_COOKIE 6239</span>
<a name="l00035"></a>00035 <span class="preprocessor"></span>
<a name="l00036"></a>00036 <span class="comment">//---------------------- KGamePropertyHandler -----------------------------------</span>
<a name="l00037"></a>00037 <span class="keyword">class </span>KGamePropertyHandlerPrivate
<a name="l00038"></a>00038 {
<a name="l00039"></a>00039 <span class="keyword">public</span>:
<a name="l00040"></a>00040     KGamePropertyHandlerPrivate()
<a name="l00041"></a>00041     {
<a name="l00042"></a>00042     }
<a name="l00043"></a>00043 
<a name="l00044"></a>00044     QMap&lt;int, QString&gt; mNameMap;
<a name="l00045"></a>00045     QIntDict&lt;KGamePropertyBase&gt; mIdDict;
<a name="l00046"></a>00046     <span class="keywordtype">int</span> mUniqueId;
<a name="l00047"></a>00047     <span class="keywordtype">int</span> mId;
<a name="l00048"></a>00048     <a class="code" href="classKGamePropertyBase.html#5a1327924368b7d080a417dcac821543" title="The policy of the property.">KGamePropertyBase::PropertyPolicy</a> mDefaultPolicy;
<a name="l00049"></a>00049     <span class="keywordtype">bool</span> mDefaultUserspace;
<a name="l00050"></a>00050   <span class="keywordtype">int</span> mIndirectEmit;
<a name="l00051"></a>00051   QPtrQueue&lt;KGamePropertyBase&gt; mSignalQueue;
<a name="l00052"></a>00052 };
<a name="l00053"></a>00053 
<a name="l00054"></a><a class="code" href="classKGamePropertyHandler.html#c275d5129b35996e7449d1aad47f3712">00054</a> <a class="code" href="classKGamePropertyHandler.html#3a26971c71f792310b1bcefd3ec6abdb" title="Construct an unregistered KGamePropertyHandler.">KGamePropertyHandler::KGamePropertyHandler</a>(<span class="keywordtype">int</span> <span class="keywordtype">id</span>, <span class="keyword">const</span> QObject* receiver, <span class="keyword">const</span> <span class="keywordtype">char</span> * sendf, <span class="keyword">const</span> <span class="keywordtype">char</span> *emitf, QObject* parent) : QObject(parent)
<a name="l00055"></a>00055 {
<a name="l00056"></a>00056  init();
<a name="l00057"></a>00057  <a class="code" href="classKGamePropertyHandler.html#14e83f975abe230d7d27d4e14cb4e309" title="Register the handler with a parent.">registerHandler</a>(<span class="keywordtype">id</span>,receiver,sendf,emitf);
<a name="l00058"></a>00058 }
<a name="l00059"></a>00059 
<a name="l00060"></a><a class="code" href="classKGamePropertyHandler.html#3a26971c71f792310b1bcefd3ec6abdb">00060</a> <a class="code" href="classKGamePropertyHandler.html#3a26971c71f792310b1bcefd3ec6abdb" title="Construct an unregistered KGamePropertyHandler.">KGamePropertyHandler::KGamePropertyHandler</a>(QObject* parent) : QObject(parent)
<a name="l00061"></a>00061 {
<a name="l00062"></a>00062  init();
<a name="l00063"></a>00063 }
<a name="l00064"></a>00064 
<a name="l00065"></a>00065 KGamePropertyHandler::~KGamePropertyHandler()
<a name="l00066"></a>00066 {
<a name="l00067"></a>00067  <a class="code" href="classKGamePropertyHandler.html#b191ae9647fa1fd9921c287d53a5f372" title="Clear the KGamePropertyHandler.">clear</a>();
<a name="l00068"></a>00068  <span class="keyword">delete</span> d;
<a name="l00069"></a>00069 }
<a name="l00070"></a>00070 
<a name="l00071"></a>00071 <span class="keywordtype">void</span> KGamePropertyHandler::init()
<a name="l00072"></a>00072 {
<a name="l00073"></a>00073  kdDebug(11001) &lt;&lt; k_funcinfo &lt;&lt; <span class="stringliteral">": this="</span> &lt;&lt; <span class="keyword">this</span> &lt;&lt; endl;
<a name="l00074"></a>00074  d = <span class="keyword">new</span> KGamePropertyHandlerPrivate; <span class="comment">// for future use - is BC important to us?</span>
<a name="l00075"></a>00075  d-&gt;mId = 0;
<a name="l00076"></a>00076  d-&gt;mUniqueId=KGamePropertyBase::IdAutomatic;
<a name="l00077"></a>00077  d-&gt;mDefaultPolicy=KGamePropertyBase::PolicyLocal;
<a name="l00078"></a>00078  d-&gt;mDefaultUserspace=<span class="keyword">true</span>;
<a name="l00079"></a>00079  d-&gt;mIndirectEmit=0;
<a name="l00080"></a>00080 }
<a name="l00081"></a>00081 
<a name="l00082"></a>00082 
<a name="l00083"></a><a class="code" href="classKGamePropertyHandler.html#fa51f60e3175f020bc1121d50d0ceebf">00083</a> <span class="keywordtype">int</span> <a class="code" href="classKGamePropertyHandler.html#fa51f60e3175f020bc1121d50d0ceebf">KGamePropertyHandler::id</a>()<span class="keyword"> const</span>
<a name="l00084"></a>00084 <span class="keyword"></span>{
<a name="l00085"></a>00085  <span class="keywordflow">return</span> d-&gt;mId;
<a name="l00086"></a>00086 }
<a name="l00087"></a>00087 
<a name="l00088"></a><a class="code" href="classKGamePropertyHandler.html#05298ea6f8c7a99ce28827a5f683389c">00088</a> <span class="keywordtype">void</span> <a class="code" href="classKGamePropertyHandler.html#05298ea6f8c7a99ce28827a5f683389c" title="Use id as new ID for this KGamePropertyHandler.">KGamePropertyHandler::setId</a>(<span class="keywordtype">int</span> <span class="keywordtype">id</span>)
<a name="l00089"></a>00089 {
<a name="l00090"></a>00090  d-&gt;mId = id;
<a name="l00091"></a>00091 }
<a name="l00092"></a>00092 
<a name="l00093"></a><a class="code" href="classKGamePropertyHandler.html#14e83f975abe230d7d27d4e14cb4e309">00093</a> <span class="keywordtype">void</span> <a class="code" href="classKGamePropertyHandler.html#14e83f975abe230d7d27d4e14cb4e309" title="Register the handler with a parent.">KGamePropertyHandler::registerHandler</a>(<span class="keywordtype">int</span> <span class="keywordtype">id</span>,<span class="keyword">const</span> QObject * receiver, <span class="keyword">const</span> <span class="keywordtype">char</span> * sendf, <span class="keyword">const</span> <span class="keywordtype">char</span> *emitf)
<a name="l00094"></a>00094 {
<a name="l00095"></a>00095  <a class="code" href="classKGamePropertyHandler.html#05298ea6f8c7a99ce28827a5f683389c" title="Use id as new ID for this KGamePropertyHandler.">setId</a>(<span class="keywordtype">id</span>); 
<a name="l00096"></a>00096  <span class="keywordflow">if</span> (receiver &amp;&amp; sendf) {
<a name="l00097"></a>00097     kdDebug(11001) &lt;&lt; <span class="stringliteral">"Connecting SLOT "</span> &lt;&lt; sendf &lt;&lt; endl;
<a name="l00098"></a>00098     connect(<span class="keyword">this</span>, SIGNAL(<a class="code" href="classKGamePropertyHandler.html#f853188d169ce36a5bb49f5a5a47d4a5" title="This signal is emitted when a property needs to be sent.">signalSendMessage</a>(<span class="keywordtype">int</span>, QDataStream &amp;, <span class="keywordtype">bool</span>*)), receiver, sendf);
<a name="l00099"></a>00099  }
<a name="l00100"></a>00100  <span class="keywordflow">if</span> (receiver &amp;&amp; emitf) {
<a name="l00101"></a>00101     kdDebug(11001) &lt;&lt; <span class="stringliteral">"Connecting SLOT "</span> &lt;&lt; emitf &lt;&lt; endl;
<a name="l00102"></a>00102     connect(<span class="keyword">this</span>, SIGNAL(<a class="code" href="classKGamePropertyHandler.html#d3a4e8f0a9155b9ff29284a9453bd554" title="This is emitted by a property.">signalPropertyChanged</a>(<a class="code" href="classKGamePropertyBase.html" title="Base class of KGameProperty.">KGamePropertyBase</a> *)), receiver, emitf);
<a name="l00103"></a>00103  }
<a name="l00104"></a>00104 }
<a name="l00105"></a>00105 
<a name="l00106"></a><a class="code" href="classKGamePropertyHandler.html#e8126cf894be87641c15bb59b070b4aa">00106</a> <span class="keywordtype">bool</span> <a class="code" href="classKGamePropertyHandler.html#e8126cf894be87641c15bb59b070b4aa" title="Main message process function.">KGamePropertyHandler::processMessage</a>(QDataStream &amp;stream, <span class="keywordtype">int</span> <span class="keywordtype">id</span>, <span class="keywordtype">bool</span> isSender)
<a name="l00107"></a>00107 {
<a name="l00108"></a>00108 <span class="comment">// kdDebug(11001) &lt;&lt; k_funcinfo &lt;&lt; ": id=" &lt;&lt; id &lt;&lt; " mId=" &lt;&lt; d-&gt;mId &lt;&lt; endl;</span>
<a name="l00109"></a>00109  <span class="keywordflow">if</span> (<span class="keywordtype">id</span> != d-&gt;mId) {
<a name="l00110"></a>00110     <span class="keywordflow">return</span> <span class="keyword">false</span>; <span class="comment">// Is the message meant for us?</span>
<a name="l00111"></a>00111  }
<a name="l00112"></a>00112  <a class="code" href="classKGamePropertyBase.html" title="Base class of KGameProperty.">KGamePropertyBase</a>* p;
<a name="l00113"></a>00113  <span class="keywordtype">int</span> propertyId;
<a name="l00114"></a>00114  KGameMessage::extractPropertyHeader(stream, propertyId);
<a name="l00115"></a>00115 <span class="comment">// kdDebug(11001) &lt;&lt; k_funcinfo &lt;&lt; ": Got property " &lt;&lt; propertyId &lt;&lt; endl;</span>
<a name="l00116"></a>00116  <span class="keywordflow">if</span> (propertyId==KGamePropertyBase::IdCommand) {
<a name="l00117"></a>00117     <span class="keywordtype">int</span> cmd;
<a name="l00118"></a>00118     KGameMessage::extractPropertyCommand(stream, propertyId, cmd);
<a name="l00119"></a>00119 <span class="comment">//kdDebug(11001) &lt;&lt; k_funcinfo &lt;&lt; ": Got COMMAND for id= "&lt;&lt;propertyId &lt;&lt;endl;</span>
<a name="l00120"></a>00120     p = d-&gt;mIdDict.find(propertyId);
<a name="l00121"></a>00121     <span class="keywordflow">if</span> (p) {
<a name="l00122"></a>00122         <span class="keywordflow">if</span> (!isSender || p-&gt;<a class="code" href="classKGamePropertyBase.html#800fa663bf1830db1e8b1ee1018a0e79">policy</a>()==KGamePropertyBase::PolicyClean) {
<a name="l00123"></a>00123             p-&gt;<a class="code" href="classKGamePropertyBase.html#fdcf1ba99963aa86c0fe77c7ec6129ff" title="send a command to advanced properties like arrays">command</a>(stream, cmd, isSender);
<a name="l00124"></a>00124         }
<a name="l00125"></a>00125     } <span class="keywordflow">else</span> {
<a name="l00126"></a>00126         kdError(11001) &lt;&lt; k_funcinfo &lt;&lt; <span class="stringliteral">": (cmd): property "</span> &lt;&lt; propertyId &lt;&lt; <span class="stringliteral">" not found"</span> &lt;&lt; endl;
<a name="l00127"></a>00127     }
<a name="l00128"></a>00128     <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00129"></a>00129  }
<a name="l00130"></a>00130  p = d-&gt;mIdDict.find(propertyId);
<a name="l00131"></a>00131  <span class="keywordflow">if</span> (p) {
<a name="l00132"></a>00132     <span class="comment">//kdDebug(11001) &lt;&lt; k_funcinfo &lt;&lt; ": Loading " &lt;&lt; propertyId &lt;&lt; endl;</span>
<a name="l00133"></a>00133     <span class="keywordflow">if</span> (!isSender || p-&gt;<a class="code" href="classKGamePropertyBase.html#800fa663bf1830db1e8b1ee1018a0e79">policy</a>()==KGamePropertyBase::PolicyClean) {
<a name="l00134"></a>00134         p-&gt;<a class="code" href="classKGamePropertyBase.html#5a0c456be1dc1afb9b34d8e565a44bef" title="This will read the value of this property from the stream.">load</a>(stream);
<a name="l00135"></a>00135     }
<a name="l00136"></a>00136  } <span class="keywordflow">else</span> {
<a name="l00137"></a>00137     kdError(11001) &lt;&lt; k_funcinfo &lt;&lt; <span class="stringliteral">": property "</span> &lt;&lt; propertyId &lt;&lt; <span class="stringliteral">" not found"</span> &lt;&lt; endl;
<a name="l00138"></a>00138  }
<a name="l00139"></a>00139  <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00140"></a>00140 }
<a name="l00141"></a>00141 
<a name="l00142"></a><a class="code" href="classKGamePropertyHandler.html#49952dac9f7425a9f56ab47b633a6589">00142</a> <span class="keywordtype">bool</span> <a class="code" href="classKGamePropertyHandler.html#49952dac9f7425a9f56ab47b633a6589" title="Removes a property from the handler.">KGamePropertyHandler::removeProperty</a>(<a class="code" href="classKGamePropertyBase.html" title="Base class of KGameProperty.">KGamePropertyBase</a>* data)
<a name="l00143"></a>00143 {
<a name="l00144"></a>00144  <span class="keywordflow">if</span> (!data) {
<a name="l00145"></a>00145     <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00146"></a>00146  }
<a name="l00147"></a>00147  d-&gt;mNameMap.erase(data-&gt;<a class="code" href="classKGamePropertyBase.html#737382aa3e0194409c3b56fcc2ea15cb">id</a>());
<a name="l00148"></a>00148  <span class="keywordflow">return</span> d-&gt;mIdDict.remove(data-&gt;<a class="code" href="classKGamePropertyBase.html#737382aa3e0194409c3b56fcc2ea15cb">id</a>());
<a name="l00149"></a>00149 }
<a name="l00150"></a>00150 
<a name="l00151"></a><a class="code" href="classKGamePropertyHandler.html#831b44307f2ca71f7f5e29cfe5694d55">00151</a> <span class="keywordtype">bool</span> <a class="code" href="classKGamePropertyHandler.html#831b44307f2ca71f7f5e29cfe5694d55" title="Adds a KGameProperty property to the handler.">KGamePropertyHandler::addProperty</a>(<a class="code" href="classKGamePropertyBase.html" title="Base class of KGameProperty.">KGamePropertyBase</a>* data, QString name)
<a name="l00152"></a>00152 {
<a name="l00153"></a>00153  <span class="comment">//kdDebug(11001) &lt;&lt; k_funcinfo &lt;&lt; ": " &lt;&lt; data-&gt;id() &lt;&lt; endl;</span>
<a name="l00154"></a>00154  <span class="keywordflow">if</span> (d-&gt;mIdDict.find(data-&gt;<a class="code" href="classKGamePropertyBase.html#737382aa3e0194409c3b56fcc2ea15cb">id</a>())) {
<a name="l00155"></a>00155     <span class="comment">// this id already exists</span>
<a name="l00156"></a>00156     kdError(11001) &lt;&lt; <span class="stringliteral">"  -&gt; cannot add property "</span> &lt;&lt; data-&gt;<a class="code" href="classKGamePropertyBase.html#737382aa3e0194409c3b56fcc2ea15cb">id</a>() &lt;&lt; endl;
<a name="l00157"></a>00157     <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00158"></a>00158  } <span class="keywordflow">else</span> {
<a name="l00159"></a>00159     d-&gt;mIdDict.insert(data-&gt;<a class="code" href="classKGamePropertyBase.html#737382aa3e0194409c3b56fcc2ea15cb">id</a>(), data);
<a name="l00160"></a>00160   <span class="comment">// if here is a check for "is_debug" or so we can add the strings only in debug mode</span>
<a name="l00161"></a>00161   <span class="comment">// and save memory!!</span>
<a name="l00162"></a>00162     <span class="keywordflow">if</span> (!name.isNull()) {
<a name="l00163"></a>00163         d-&gt;mNameMap[data-&gt;<a class="code" href="classKGamePropertyBase.html#737382aa3e0194409c3b56fcc2ea15cb">id</a>()] = name;
<a name="l00164"></a>00164         <span class="comment">//kdDebug(11001) &lt;&lt; k_funcinfo &lt;&lt; ": nid="&lt;&lt; (data-&gt;id()) &lt;&lt; " inserted in Map name=" &lt;&lt; d-&gt;mNameMap[data-&gt;id()] &lt;&lt;endl;</span>
<a name="l00165"></a>00165         <span class="comment">//kdDebug(11001) &lt;&lt; "Typeid=" &lt;&lt; typeid(data).name() &lt;&lt; endl;</span>
<a name="l00166"></a>00166     <span class="comment">//kdDebug(11001) &lt;&lt; "Typeid call=" &lt;&lt; data-&gt;typeinfo()-&gt;name() &lt;&lt; endl;</span>
<a name="l00167"></a>00167     }
<a name="l00168"></a>00168  }
<a name="l00169"></a>00169  <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00170"></a>00170 }
<a name="l00171"></a>00171 
<a name="l00172"></a><a class="code" href="classKGamePropertyHandler.html#5af05e30c7da306ffcb3c4e561334dd9">00172</a> QString <a class="code" href="classKGamePropertyHandler.html#5af05e30c7da306ffcb3c4e561334dd9">KGamePropertyHandler::propertyName</a>(<span class="keywordtype">int</span> <span class="keywordtype">id</span>)<span class="keyword"> const</span>
<a name="l00173"></a>00173 <span class="keyword"></span>{
<a name="l00174"></a>00174  QString s;
<a name="l00175"></a>00175  <span class="keywordflow">if</span> (d-&gt;mIdDict.find(<span class="keywordtype">id</span>)) {
<a name="l00176"></a>00176     <span class="keywordflow">if</span> (d-&gt;mNameMap.contains(<span class="keywordtype">id</span>)) {
<a name="l00177"></a>00177         s = i18n(<span class="stringliteral">"%1 (%2)"</span>).arg(d-&gt;mNameMap[<span class="keywordtype">id</span>]).arg(<span class="keywordtype">id</span>);
<a name="l00178"></a>00178     } <span class="keywordflow">else</span> {
<a name="l00179"></a>00179         s = i18n(<span class="stringliteral">"Unnamed - ID: %1"</span>).arg(<span class="keywordtype">id</span>);
<a name="l00180"></a>00180     }
<a name="l00181"></a>00181  } <span class="keywordflow">else</span> {
<a name="l00182"></a>00182     <span class="comment">// Should _never_ happen</span>
<a name="l00183"></a>00183     s = i18n(<span class="stringliteral">"%1 unregistered"</span>).arg(<span class="keywordtype">id</span>);
<a name="l00184"></a>00184  }
<a name="l00185"></a>00185  <span class="keywordflow">return</span> s;
<a name="l00186"></a>00186 }
<a name="l00187"></a>00187 
<a name="l00188"></a><a class="code" href="classKGamePropertyHandler.html#8e16a10cd3e5d50cb33e45283b325563">00188</a> <span class="keywordtype">bool</span> <a class="code" href="classKGamePropertyHandler.html#8e16a10cd3e5d50cb33e45283b325563" title="Loads properties from the datastream.">KGamePropertyHandler::load</a>(QDataStream &amp;stream)
<a name="l00189"></a>00189 {
<a name="l00190"></a>00190  <span class="comment">// Prevent direct emmiting until all is loaded</span>
<a name="l00191"></a>00191  <a class="code" href="classKGamePropertyHandler.html#99ac56d1cae4d8ac3c78a1860be2a8b0" title="Called by the KGame or KPlayer object or the handler itself to delay emmiting of...">lockDirectEmit</a>();
<a name="l00192"></a>00192  uint count,i;
<a name="l00193"></a>00193  stream &gt;&gt; count;
<a name="l00194"></a>00194  kdDebug(11001) &lt;&lt; k_funcinfo &lt;&lt; <span class="stringliteral">": "</span> &lt;&lt; count &lt;&lt; <span class="stringliteral">" KGameProperty objects "</span> &lt;&lt; endl;
<a name="l00195"></a>00195  <span class="keywordflow">for</span> (i = 0; i &lt; count; i++) {
<a name="l00196"></a>00196     <a class="code" href="classKGamePropertyHandler.html#e8126cf894be87641c15bb59b070b4aa" title="Main message process function.">processMessage</a>(stream, <span class="keywordtype">id</span>(),<span class="keyword">false</span>);
<a name="l00197"></a>00197  }
<a name="l00198"></a>00198  Q_INT16 cookie;
<a name="l00199"></a>00199  stream &gt;&gt; cookie;
<a name="l00200"></a>00200  <span class="keywordflow">if</span> (cookie == KPLAYERHANDLER_LOAD_COOKIE) {
<a name="l00201"></a>00201     kdDebug(11001) &lt;&lt; <span class="stringliteral">"   KGamePropertyHandler loaded propertly"</span>&lt;&lt;endl;
<a name="l00202"></a>00202  } <span class="keywordflow">else</span> {
<a name="l00203"></a>00203     kdError(11001) &lt;&lt; <span class="stringliteral">"KGamePropertyHandler loading error. probably format error"</span>&lt;&lt;endl;
<a name="l00204"></a>00204  }
<a name="l00205"></a>00205  <span class="comment">// Allow direct emmiting (if no other lock still holds)</span>
<a name="l00206"></a>00206  <a class="code" href="classKGamePropertyHandler.html#907d8708a0fc30609e433dbfc9065d69" title="Removes the lock from the emitting of property signals.">unlockDirectEmit</a>();
<a name="l00207"></a>00207  <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00208"></a>00208 }
<a name="l00209"></a>00209 
<a name="l00210"></a><a class="code" href="classKGamePropertyHandler.html#60ecc9e328c6bd580317858efc85a641">00210</a> <span class="keywordtype">bool</span> <a class="code" href="classKGamePropertyHandler.html#60ecc9e328c6bd580317858efc85a641" title="Saves properties into the datastream.">KGamePropertyHandler::save</a>(QDataStream &amp;stream)
<a name="l00211"></a>00211 {
<a name="l00212"></a>00212  kdDebug(11001) &lt;&lt; k_funcinfo &lt;&lt; <span class="stringliteral">": "</span> &lt;&lt; d-&gt;mIdDict.count() &lt;&lt; <span class="stringliteral">" KGameProperty objects "</span> &lt;&lt; endl;
<a name="l00213"></a>00213  stream &lt;&lt; (uint)d-&gt;mIdDict.count();
<a name="l00214"></a>00214  QIntDictIterator&lt;KGamePropertyBase&gt; it(d-&gt;mIdDict);
<a name="l00215"></a>00215  <span class="keywordflow">while</span> (it.current()) {
<a name="l00216"></a>00216     <a class="code" href="classKGamePropertyBase.html" title="Base class of KGameProperty.">KGamePropertyBase</a> *base=it.current();
<a name="l00217"></a>00217     <span class="keywordflow">if</span> (base) {
<a name="l00218"></a>00218         KGameMessage::createPropertyHeader(stream, base-&gt;<a class="code" href="classKGamePropertyBase.html#737382aa3e0194409c3b56fcc2ea15cb">id</a>());
<a name="l00219"></a>00219         base-&gt;<a class="code" href="classKGamePropertyBase.html#603b627316f0f379e5c93e1f70100a62" title="Write the value into a stream.">save</a>(stream);
<a name="l00220"></a>00220     }
<a name="l00221"></a>00221     ++it;
<a name="l00222"></a>00222  }
<a name="l00223"></a>00223  stream &lt;&lt; (Q_INT16)KPLAYERHANDLER_LOAD_COOKIE;
<a name="l00224"></a>00224  <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00225"></a>00225 }
<a name="l00226"></a>00226 
<a name="l00227"></a><a class="code" href="classKGamePropertyHandler.html#ece6e6fb27b74a2abf5e7f7aef6a3d76">00227</a> <a class="code" href="classKGamePropertyBase.html#5a1327924368b7d080a417dcac821543" title="The policy of the property.">KGamePropertyBase::PropertyPolicy</a> <a class="code" href="classKGamePropertyHandler.html#ece6e6fb27b74a2abf5e7f7aef6a3d76" title="Returns the default policy for this property handler.">KGamePropertyHandler::policy</a>()
<a name="l00228"></a>00228 {
<a name="l00229"></a>00229 <span class="comment">// kdDebug(11001) &lt;&lt; k_funcinfo &lt;&lt; ": " &lt;&lt; d-&gt;mDefaultPolicy &lt;&lt; endl;</span>
<a name="l00230"></a>00230  <span class="keywordflow">return</span> d-&gt;mDefaultPolicy;
<a name="l00231"></a>00231 }
<a name="l00232"></a><a class="code" href="classKGamePropertyHandler.html#1176d6e3f4000ff457e80cb8c57cbd13">00232</a> <span class="keywordtype">void</span> <a class="code" href="classKGamePropertyHandler.html#1176d6e3f4000ff457e80cb8c57cbd13" title="Set the policy for all kgame variables which are currently registerd in the KGame...">KGamePropertyHandler::setPolicy</a>(<a class="code" href="classKGamePropertyBase.html#5a1327924368b7d080a417dcac821543" title="The policy of the property.">KGamePropertyBase::PropertyPolicy</a> p,<span class="keywordtype">bool</span> userspace)
<a name="l00233"></a>00233 {
<a name="l00234"></a>00234  <span class="comment">// kdDebug(11001) &lt;&lt; k_funcinfo &lt;&lt; ": " &lt;&lt; p &lt;&lt; endl;</span>
<a name="l00235"></a>00235  d-&gt;mDefaultPolicy=p;
<a name="l00236"></a>00236  d-&gt;mDefaultUserspace=userspace;
<a name="l00237"></a>00237  QIntDictIterator&lt;KGamePropertyBase&gt; it(d-&gt;mIdDict);
<a name="l00238"></a>00238  <span class="keywordflow">while</span> (it.current()) {
<a name="l00239"></a>00239     <span class="keywordflow">if</span> (!userspace || it.current()-&gt;id()&gt;=KGamePropertyBase::IdUser) {
<a name="l00240"></a>00240         it.current()-&gt;setPolicy((<a class="code" href="classKGamePropertyBase.html#5a1327924368b7d080a417dcac821543" title="The policy of the property.">KGamePropertyBase::PropertyPolicy</a>)p);
<a name="l00241"></a>00241     }
<a name="l00242"></a>00242     ++it;
<a name="l00243"></a>00243  }
<a name="l00244"></a>00244 }
<a name="l00245"></a>00245 
<a name="l00246"></a><a class="code" href="classKGamePropertyHandler.html#83b0e900b3ede4fea73d36b945e69be0">00246</a> <span class="keywordtype">void</span> <a class="code" href="classKGamePropertyHandler.html#83b0e900b3ede4fea73d36b945e69be0" title="Calls KGamePropertyBase::setReadOnly(false) for all properties of this player.">KGamePropertyHandler::unlockProperties</a>()
<a name="l00247"></a>00247 {
<a name="l00248"></a>00248  QIntDictIterator&lt;KGamePropertyBase&gt; it(d-&gt;mIdDict);
<a name="l00249"></a>00249  <span class="keywordflow">while</span> (it.current()) {
<a name="l00250"></a>00250     it.current()-&gt;unlock();
<a name="l00251"></a>00251     ++it;
<a name="l00252"></a>00252  }
<a name="l00253"></a>00253 }
<a name="l00254"></a>00254 
<a name="l00255"></a><a class="code" href="classKGamePropertyHandler.html#230766caa8fe0fb982c5aa6b581fb45d">00255</a> <span class="keywordtype">void</span> <a class="code" href="classKGamePropertyHandler.html#230766caa8fe0fb982c5aa6b581fb45d" title="Calls KGamePropertyBase::setReadOnly(true) for all properties of this handler.">KGamePropertyHandler::lockProperties</a>()
<a name="l00256"></a>00256 {
<a name="l00257"></a>00257  QIntDictIterator&lt;KGamePropertyBase&gt; it(d-&gt;mIdDict);
<a name="l00258"></a>00258  <span class="keywordflow">while</span> (it.current()) {
<a name="l00259"></a>00259     it.current()-&gt;lock();
<a name="l00260"></a>00260     ++it;
<a name="l00261"></a>00261  }
<a name="l00262"></a>00262 }
<a name="l00263"></a>00263 
<a name="l00264"></a><a class="code" href="classKGamePropertyHandler.html#48b6bacc49ab9cdd08b72eaafb1c871b">00264</a> <span class="keywordtype">int</span> <a class="code" href="classKGamePropertyHandler.html#48b6bacc49ab9cdd08b72eaafb1c871b" title="returns a unique property ID starting called usually with a base of KGamePropertyBase::IdAutomatic...">KGamePropertyHandler::uniquePropertyId</a>()
<a name="l00265"></a>00265 {
<a name="l00266"></a>00266  <span class="keywordflow">return</span> d-&gt;mUniqueId++;
<a name="l00267"></a>00267 }
<a name="l00268"></a>00268 
<a name="l00269"></a><a class="code" href="classKGamePropertyHandler.html#6dcf86c943fe1b26630922d5c04e4a2a">00269</a> <span class="keywordtype">void</span> <a class="code" href="classKGamePropertyHandler.html#6dcf86c943fe1b26630922d5c04e4a2a" title="Sends all properties which are marked dirty over the network.">KGamePropertyHandler::flush</a>()
<a name="l00270"></a>00270 {
<a name="l00271"></a>00271  QIntDictIterator&lt;KGamePropertyBase&gt; it(d-&gt;mIdDict);
<a name="l00272"></a>00272  <span class="keywordflow">while</span> (it.current()) {
<a name="l00273"></a>00273     <span class="keywordflow">if</span> (it.current()-&gt;isDirty()) {
<a name="l00274"></a>00274         it.current()-&gt;sendProperty();
<a name="l00275"></a>00275     }
<a name="l00276"></a>00276     ++it;
<a name="l00277"></a>00277  }
<a name="l00278"></a>00278 }
<a name="l00279"></a>00279 
<a name="l00280"></a>00280 <span class="comment">/* Fire all property signal changed which are collected in</span>
<a name="l00281"></a>00281 <span class="comment"> * the queque</span>
<a name="l00282"></a>00282 <span class="comment"> **/</span>
<a name="l00283"></a><a class="code" href="classKGamePropertyHandler.html#99ac56d1cae4d8ac3c78a1860be2a8b0">00283</a> <span class="keywordtype">void</span> <a class="code" href="classKGamePropertyHandler.html#99ac56d1cae4d8ac3c78a1860be2a8b0" title="Called by the KGame or KPlayer object or the handler itself to delay emmiting of...">KGamePropertyHandler::lockDirectEmit</a>()
<a name="l00284"></a>00284 {
<a name="l00285"></a>00285   d-&gt;mIndirectEmit++;
<a name="l00286"></a>00286 }
<a name="l00287"></a>00287 
<a name="l00288"></a><a class="code" href="classKGamePropertyHandler.html#907d8708a0fc30609e433dbfc9065d69">00288</a> <span class="keywordtype">void</span> <a class="code" href="classKGamePropertyHandler.html#907d8708a0fc30609e433dbfc9065d69" title="Removes the lock from the emitting of property signals.">KGamePropertyHandler::unlockDirectEmit</a>()
<a name="l00289"></a>00289 {
<a name="l00290"></a>00290   <span class="comment">// If the flag is &lt;=0 we emit the queued signals</span>
<a name="l00291"></a>00291   d-&gt;mIndirectEmit--;
<a name="l00292"></a>00292   <span class="keywordflow">if</span> (d-&gt;mIndirectEmit&lt;=0)
<a name="l00293"></a>00293   {
<a name="l00294"></a>00294     <a class="code" href="classKGamePropertyBase.html" title="Base class of KGameProperty.">KGamePropertyBase</a> *prop;
<a name="l00295"></a>00295     <span class="keywordflow">while</span>((prop=d-&gt;mSignalQueue.dequeue()) != 0)
<a name="l00296"></a>00296     {
<a name="l00297"></a>00297       <span class="comment">// kdDebug(11001) &lt;&lt; "emmiting signal for " &lt;&lt; prop-&gt;id() &lt;&lt; endl;</span>
<a name="l00298"></a>00298       emit <a class="code" href="classKGamePropertyHandler.html#d3a4e8f0a9155b9ff29284a9453bd554" title="This is emitted by a property.">signalPropertyChanged</a>(prop);
<a name="l00299"></a>00299     }
<a name="l00300"></a>00300   }
<a name="l00301"></a>00301 }
<a name="l00302"></a>00302 
<a name="l00303"></a><a class="code" href="classKGamePropertyHandler.html#c472025b2fb62878b1acb7cd64843c49">00303</a> <span class="keywordtype">void</span> <a class="code" href="classKGamePropertyHandler.html#c472025b2fb62878b1acb7cd64843c49" title="called by a property to emit a signal This call is simply forwarded to the parent...">KGamePropertyHandler::emitSignal</a>(<a class="code" href="classKGamePropertyBase.html" title="Base class of KGameProperty.">KGamePropertyBase</a> *prop)
<a name="l00304"></a>00304 {
<a name="l00305"></a>00305  <span class="comment">// If the indirect flag is set (load and network transmit)</span>
<a name="l00306"></a>00306  <span class="comment">// we cannot emit the signals directly as it can happend that</span>
<a name="l00307"></a>00307  <span class="comment">// a sigal causes an access to a property which is e.g. not</span>
<a name="l00308"></a>00308  <span class="comment">// yet loaded or received</span>
<a name="l00309"></a>00309 
<a name="l00310"></a>00310  <span class="keywordflow">if</span> (d-&gt;mIndirectEmit&gt;0)
<a name="l00311"></a>00311  {
<a name="l00312"></a>00312   <span class="comment">// Queque the signal</span>
<a name="l00313"></a>00313   d-&gt;mSignalQueue.enqueue(prop);
<a name="l00314"></a>00314  }
<a name="l00315"></a>00315  <span class="keywordflow">else</span>
<a name="l00316"></a>00316  {
<a name="l00317"></a>00317   <span class="comment">// directly emit</span>
<a name="l00318"></a>00318   emit <a class="code" href="classKGamePropertyHandler.html#d3a4e8f0a9155b9ff29284a9453bd554" title="This is emitted by a property.">signalPropertyChanged</a>(prop);
<a name="l00319"></a>00319  }
<a name="l00320"></a>00320 }
<a name="l00321"></a>00321 
<a name="l00322"></a><a class="code" href="classKGamePropertyHandler.html#02d8ab64bc0e14cb86d7e5fb0849e5df">00322</a> <span class="keywordtype">bool</span> <a class="code" href="classKGamePropertyHandler.html#02d8ab64bc0e14cb86d7e5fb0849e5df" title="called by a property to send itself into the datastream.">KGamePropertyHandler::sendProperty</a>(QDataStream &amp;s)
<a name="l00323"></a>00323 {
<a name="l00324"></a>00324  <span class="keywordtype">bool</span> sent = <span class="keyword">false</span>;
<a name="l00325"></a>00325  emit <a class="code" href="classKGamePropertyHandler.html#f853188d169ce36a5bb49f5a5a47d4a5" title="This signal is emitted when a property needs to be sent.">signalSendMessage</a>(<span class="keywordtype">id</span>(), s, &amp;sent);
<a name="l00326"></a>00326  <span class="keywordflow">return</span> sent;
<a name="l00327"></a>00327 }
<a name="l00328"></a>00328 
<a name="l00329"></a><a class="code" href="classKGamePropertyHandler.html#93f0842998b8e2d06927e1cdce8dfa8b">00329</a> <a class="code" href="classKGamePropertyBase.html" title="Base class of KGameProperty.">KGamePropertyBase</a> *<a class="code" href="classKGamePropertyHandler.html#93f0842998b8e2d06927e1cdce8dfa8b">KGamePropertyHandler::find</a>(<span class="keywordtype">int</span> <span class="keywordtype">id</span>)
<a name="l00330"></a>00330 {
<a name="l00331"></a>00331  <span class="keywordflow">return</span> d-&gt;mIdDict.find(<span class="keywordtype">id</span>);
<a name="l00332"></a>00332 }
<a name="l00333"></a>00333 
<a name="l00334"></a><a class="code" href="classKGamePropertyHandler.html#b191ae9647fa1fd9921c287d53a5f372">00334</a> <span class="keywordtype">void</span> <a class="code" href="classKGamePropertyHandler.html#b191ae9647fa1fd9921c287d53a5f372" title="Clear the KGamePropertyHandler.">KGamePropertyHandler::clear</a>()
<a name="l00335"></a>00335 {
<a name="l00336"></a>00336  kdDebug(11001) &lt;&lt; k_funcinfo &lt;&lt; <a class="code" href="classKGamePropertyHandler.html#fa51f60e3175f020bc1121d50d0ceebf">id</a>() &lt;&lt; endl;
<a name="l00337"></a>00337  QIntDictIterator&lt;KGamePropertyBase&gt; it(d-&gt;mIdDict);
<a name="l00338"></a>00338  <span class="keywordflow">while</span> (it.toFirst()) {
<a name="l00339"></a>00339     <a class="code" href="classKGamePropertyBase.html" title="Base class of KGameProperty.">KGamePropertyBase</a>* p = it.toFirst();
<a name="l00340"></a>00340     p-&gt;<a class="code" href="classKGamePropertyBase.html#ca1319339ac637f767a719b0a9fc8d63">unregisterData</a>();
<a name="l00341"></a>00341     <span class="keywordflow">if</span> (d-&gt;mIdDict.find(p-&gt;<a class="code" href="classKGamePropertyBase.html#737382aa3e0194409c3b56fcc2ea15cb">id</a>())) {
<a name="l00342"></a>00342         <span class="comment">// shouldn't happen - but if mOwner in KGamePropertyBase is NULL</span>
<a name="l00343"></a>00343         <span class="comment">// this might be possible</span>
<a name="l00344"></a>00344         <a class="code" href="classKGamePropertyHandler.html#49952dac9f7425a9f56ab47b633a6589" title="Removes a property from the handler.">removeProperty</a>(p); 
<a name="l00345"></a>00345     }
<a name="l00346"></a>00346  }
<a name="l00347"></a>00347 }
<a name="l00348"></a>00348 
<a name="l00349"></a><a class="code" href="classKGamePropertyHandler.html#32a7e89e4b7bec5b390455b688598e85">00349</a> QIntDict&lt;KGamePropertyBase&gt;&amp; <a class="code" href="classKGamePropertyHandler.html#32a7e89e4b7bec5b390455b688598e85" title="Reference to the internal dictionary.">KGamePropertyHandler::dict</a>()<span class="keyword"> const</span>
<a name="l00350"></a>00350 <span class="keyword"></span>{ 
<a name="l00351"></a>00351  <span class="keywordflow">return</span> d-&gt;mIdDict; 
<a name="l00352"></a>00352 }
<a name="l00353"></a>00353 
<a name="l00354"></a><a class="code" href="classKGamePropertyHandler.html#492a22be2df3101ec60743fde0f518a6">00354</a> QString <a class="code" href="classKGamePropertyHandler.html#492a22be2df3101ec60743fde0f518a6" title="In several situations you just want to have a QString of a KGameProperty object.">KGamePropertyHandler::propertyValue</a>(<a class="code" href="classKGamePropertyBase.html" title="Base class of KGameProperty.">KGamePropertyBase</a>* prop)
<a name="l00355"></a>00355 {
<a name="l00356"></a>00356  <span class="keywordflow">if</span> (!prop) {
<a name="l00357"></a>00357          <span class="keywordflow">return</span> i18n(<span class="stringliteral">"NULL pointer"</span>);
<a name="l00358"></a>00358  }
<a name="l00359"></a>00359        
<a name="l00360"></a>00360  <span class="keywordtype">int</span> <span class="keywordtype">id</span> = prop-&gt;<a class="code" href="classKGamePropertyBase.html#737382aa3e0194409c3b56fcc2ea15cb">id</a>();
<a name="l00361"></a>00361  QString name = <a class="code" href="classKGamePropertyHandler.html#5af05e30c7da306ffcb3c4e561334dd9">propertyName</a>(<span class="keywordtype">id</span>);
<a name="l00362"></a>00362  QString value;
<a name="l00363"></a>00363 
<a name="l00364"></a>00364  <span class="keyword">const</span> type_info* t = prop-&gt;<a class="code" href="classKGamePropertyBase.html#1e9a0ba7673ae71c7962663ee8802cd9">typeinfo</a>();
<a name="l00365"></a>00365  <span class="keywordflow">if</span> (*t == <span class="keyword">typeid</span>(<span class="keywordtype">int</span>)) {
<a name="l00366"></a>00366     value = QString::number(((<a class="code" href="classKGameProperty.html">KGamePropertyInt</a>*)prop)-&gt;value());
<a name="l00367"></a>00367  } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (*t == <span class="keyword">typeid</span>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>)) {
<a name="l00368"></a>00368     value = QString::number(((<a class="code" href="classKGameProperty.html">KGamePropertyUInt</a> *)prop)-&gt;value());
<a name="l00369"></a>00369  } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (*t == <span class="keyword">typeid</span>(<span class="keywordtype">long</span> <span class="keywordtype">int</span>)) {
<a name="l00370"></a>00370     value = QString::number(((<a class="code" href="classKGameProperty.html" title="A class for network transparent games.">KGameProperty&lt;long int&gt;</a> *)prop)-&gt;value()); 
<a name="l00371"></a>00371  } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (*t == <span class="keyword">typeid</span>(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <span class="keywordtype">int</span>)) {
<a name="l00372"></a>00372     value = QString::number(((<a class="code" href="classKGameProperty.html" title="A class for network transparent games.">KGameProperty&lt;unsigned long int&gt;</a> *)prop)-&gt;value());
<a name="l00373"></a>00373  } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (*t == <span class="keyword">typeid</span>(QString)) { 
<a name="l00374"></a>00374     value = ((<a class="code" href="classKGameProperty.html">KGamePropertyQString</a>*)prop)-&gt;value();
<a name="l00375"></a>00375  } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (*t == <span class="keyword">typeid</span>(Q_INT8)) { 
<a name="l00376"></a>00376     value = ((<a class="code" href="classKGameProperty.html">KGamePropertyBool</a>*)prop)-&gt;value() ?  i18n(<span class="stringliteral">"True"</span>) : i18n(<span class="stringliteral">"False"</span>);
<a name="l00377"></a>00377  } <span class="keywordflow">else</span> {
<a name="l00378"></a>00378     emit <a class="code" href="classKGamePropertyHandler.html#0ea7049a4c265486305e2e60d49e2adb" title="If you call propertyValue with a non-standard KGameProperty it is possible that the...">signalRequestValue</a>(prop, value);
<a name="l00379"></a>00379  }
<a name="l00380"></a>00380            
<a name="l00381"></a>00381  <span class="keywordflow">if</span> (value.isNull()) {
<a name="l00382"></a>00382     value = i18n(<span class="stringliteral">"Unknown"</span>);
<a name="l00383"></a>00383  }
<a name="l00384"></a>00384  <span class="keywordflow">return</span> value;
<a name="l00385"></a>00385 }
<a name="l00386"></a>00386 
<a name="l00387"></a><a class="code" href="classKGamePropertyHandler.html#dbf00eded0369be18deeba7137bdc3fd">00387</a> <span class="keywordtype">void</span> <a class="code" href="classKGamePropertyHandler.html#dbf00eded0369be18deeba7137bdc3fd" title="Writes some debug output to the console.">KGamePropertyHandler::Debug</a>()
<a name="l00388"></a>00388 {
<a name="l00389"></a>00389  kdDebug(11001) &lt;&lt; <span class="stringliteral">"-----------------------------------------------------------"</span> &lt;&lt; endl;
<a name="l00390"></a>00390  kdDebug(11001) &lt;&lt; <span class="stringliteral">"KGamePropertyHandler:: Debug this="</span> &lt;&lt; <span class="keyword">this</span> &lt;&lt; endl;
<a name="l00391"></a>00391 
<a name="l00392"></a>00392  kdDebug(11001) &lt;&lt; <span class="stringliteral">"  Registered properties: (Policy,Lock,Emit,Optimized, Dirty)"</span> &lt;&lt; endl;
<a name="l00393"></a>00393  QIntDictIterator&lt;KGamePropertyBase&gt; it(d-&gt;mIdDict);
<a name="l00394"></a>00394  <span class="keywordflow">while</span> (it.current()) {
<a name="l00395"></a>00395     <a class="code" href="classKGamePropertyBase.html" title="Base class of KGameProperty.">KGamePropertyBase</a> *p=it.current();
<a name="l00396"></a>00396     kdDebug(11001) &lt;&lt; <span class="stringliteral">"  "</span>&lt;&lt; p-&gt;<a class="code" href="classKGamePropertyBase.html#737382aa3e0194409c3b56fcc2ea15cb">id</a>() &lt;&lt; <span class="stringliteral">": p="</span> &lt;&lt; p-&gt;<a class="code" href="classKGamePropertyBase.html#800fa663bf1830db1e8b1ee1018a0e79">policy</a>() 
<a name="l00397"></a>00397             &lt;&lt; <span class="stringliteral">" l="</span>&lt;&lt;p-&gt;<a class="code" href="classKGamePropertyBase.html#e489ae29929b2592a6b292e17de28144" title="A locked property can only be changed by the player who has set the lock.">isLocked</a>()
<a name="l00398"></a>00398             &lt;&lt; <span class="stringliteral">" e="</span>&lt;&lt;p-&gt;<a class="code" href="classKGamePropertyBase.html#982e064965d7e5d1b0e39442aeb19965" title="See also setEmittingSignal.">isEmittingSignal</a>() 
<a name="l00399"></a>00399             &lt;&lt; <span class="stringliteral">" o="</span> &lt;&lt; p-&gt;<a class="code" href="classKGamePropertyBase.html#1f22784787aa6a75c41ca6a31cfae2a3" title="See also setOptimize.">isOptimized</a>() 
<a name="l00400"></a>00400             &lt;&lt; <span class="stringliteral">" d="</span>&lt;&lt;p-&gt;<a class="code" href="classKGamePropertyBase.html#b0b5b01f8abcfe927966031dfc497f27">isDirty</a>() 
<a name="l00401"></a>00401             &lt;&lt; endl;
<a name="l00402"></a>00402     ++it;
<a name="l00403"></a>00403  }
<a name="l00404"></a>00404  kdDebug(11001) &lt;&lt; <span class="stringliteral">"-----------------------------------------------------------"</span> &lt;&lt; endl;
<a name="l00405"></a>00405 }
<a name="l00406"></a>00406 
<a name="l00407"></a>00407 <span class="preprocessor">#include "kgamepropertyhandler.moc"</span>
</pre></div></div>
    </div></div>


      </td>
  </tr>
  <tr>
    <td valign="top" id="leftmenu" width="25%">
      <a name="navigation"></a>
      <div class="menu_box"><h2>libkdegames</h2>
<div class="nav_list">
<ul><li><a href="index.html">Main Page</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="classKCanvasRootPixmap.html">kcanvasrootpixmap</option>,  <option value="classKCardDialog.html">kcarddialog</option>,  <option value="classKChat.html">kchat</option>,  <option value="classKChatBase.html">kchatbase</option>,  <option value="classKChatBaseText.html">kchatbasetext</option>,  <option value="classKExtHighscore_1_1Item.html">kexthighscore::item</option>,  <option value="classKExtHighscore_1_1ItemArray.html">kexthighscore::itemarray</option>,  <option value="classKExtHighscore_1_1Manager.html">kexthighscore::manager</option>,  <option value="classKExtHighscore_1_1MultiplayerScores.html">kexthighscore::multiplayerscores</option>,  <option value="classKExtHighscore_1_1Score.html">kexthighscore::score</option>,  <option value="classKGame.html">kgame</option>,  <option value="classKGameChat.html">kgamechat</option>,  <option value="classKGameComputerIO.html">kgamecomputerio</option>,  <option value="classKGameConnectDialog.html">kgameconnectdialog</option>,  <option value="classKGameDialog.html">kgamedialog</option>,  <option value="classKGameDialogChatConfig.html">kgamedialogchatconfig</option>,  <option value="classKGameDialogConfig.html">kgamedialogconfig</option>,  <option value="classKGameErrorDialog.html">kgameerrordialog</option>,  <option value="classKGameErrorMessageDialog.html">kgameerrormessagedialog</option>,  <option value="classKGameIO.html">kgameio</option>,  <option value="classKGameKeyIO.html">kgamekeyio</option>,  <option value="classKGameLCD.html">kgamelcd</option>,  <option value="classKGameLCDClock.html">kgamelcdclock</option>,  <option value="classKGameLCDList.html">kgamelcdlist</option>,  <option value="classKGameMisc.html">kgamemisc</option>,  <option value="classKGameMouseIO.html">kgamemouseio</option>,  <option value="classKGameNetwork.html">kgamenetwork</option>,  <option value="classKGameProcess.html">kgameprocess</option>,  <option value="classKGameProcessIO.html">kgameprocessio</option>,  <option value="classKGameProgress.html">kgameprogress</option>,  <option value="classKGameProperty.html">kgameproperty</option>,  <option value="classKGamePropertyBase.html">kgamepropertybase</option>,  <option value="classKGamePropertyHandler.html">kgamepropertyhandler</option>,  <option value="classKGameSequence.html">kgamesequence</option>,  <option value="classKGrid2D_1_1Generic.html">kgrid2d::generic</option>,  <option value="classKGrid2D_1_1Hexagonal.html">kgrid2d::hexagonal</option>,  <option value="classKGrid2D_1_1HexagonalBase.html">kgrid2d::hexagonalbase</option>,  <option value="classKGrid2D_1_1Square.html">kgrid2d::square</option>,  <option value="classKGrid2D_1_1SquareBase.html">kgrid2d::squarebase</option>,  <option value="classKHighscore.html">khighscore</option>,  <option value="classKMessageClient.html">kmessageclient</option>,  <option value="classKMessageDirect.html">kmessagedirect</option>,  <option value="classKMessageIO.html">kmessageio</option>,  <option value="classKMessageServer.html">kmessageserver</option>,  <option value="classKMessageServerSocket.html">kmessageserversocket</option>,  <option value="classKMessageSocket.html">kmessagesocket</option>,  <option value="classKPlayer.html">kplayer</option>,  <option value="classKScoreDialog.html">kscoredialog</option>,  <option value="classKStdGameAction.html">kstdgameaction</option>,
</select>
</form>
</div>
-->
</div></div>
<div class="menu_box"><h2>API Dox</h2>
<div class="nav_list">
<ul>
<li><a href="../../libkdegames/html/index.html">libkdegames</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="&#109;&#97;&#105;&#108;&#116;&#111;&#58;groo&#116;&#64;kde&#46;or&#x67;">Adriaan de Groot</a>
and
<a href="&#109;a&#105;&#108;&#116;&#111;&#58;w&#105;nter&#64;kde&#46;or&#x67">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>