aboutsummaryrefslogtreecommitdiff
path: root/libcontextsubscriber/doc/html/migratingfromduivaluespace.html
blob: b4811c5de1ef1e0337edf107e410847af45a4cd6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>libcontextsubscriber: </title>
<link href="tabs.css" rel="stylesheet" type="text/css">
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.8 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li class="current"><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
</div>
<div class="contents">
libcontextsubscriber is a replacement library for DuiValueSpace which is deprecated.<p>
DuiValueSpace, the old subscription library providing the keys, is deprecated. This library is a replacement for it, providing better API and better implementation while maintaining the same core ideas and structure.<h2><a class="anchor" name="quicklook">
A quick look</a></h2>
The following code for creating a handle for a context property:<p>
<div class="fragment"><pre class="fragment">    DuiValueSpaceItem topEdge(<span class="stringliteral">"Context.Screen.TopEdge"</span>);
    QObject::connect(&amp;topEdge, SIGNAL(valueChanged()),
                     <span class="keyword">this</span>, SLOT(topEdgeChanged()));
</pre></div><p>
becomes:<p>
<div class="fragment"><pre class="fragment">    <a class="code" href="class_context_property.html" title="The ContextProperty class allows access to keys and their values.">ContextProperty</a> topEdge(<span class="stringliteral">"Screen.TopEdge"</span>);
    QObject::connect(&amp;topEdge, SIGNAL(valueChanged()),
                     <span class="keyword">this</span>, SLOT(topEdgeChanged()));
</pre></div><p>
The following code for listing the available context keys:<p>
<div class="fragment"><pre class="fragment">    DuiValueSpaceItem::listKeys();
</pre></div><p>
becomes:<p>
<div class="fragment"><pre class="fragment">    <a class="code" href="class_context_registry_info.html#93a34519ddb495338876ba0e1d1a4247" title="Returns the singleton instance of the ContextRegistryInfo.">ContextRegistryInfo::instance</a>()-&gt;<a class="code" href="class_context_registry_info.html#963309761292d39921da3fb06cb31060" title="Returns the list of all the keys currently availible in the registry.">listKeys</a>();
</pre></div><h2><a class="anchor" name="prefix">
The Context. prefix</a></h2>
In <b>DuiValueSpace</b> and accompanying packages, the properties used to have a "Context." prefix. For example:<p>
<div class="fragment"><pre class="fragment">    Context.Screen.TopEdge
    Context.Screen.IsCovered
</pre></div><p>
This 'Context.' has been dropped now from <b>libcontextsubscriber</b> and all the provider packages. Providers now explicitly provide properties with keys like:<p>
<div class="fragment"><pre class="fragment">    Screen.TopEdge
    Screen.IsCovered
</pre></div><p>
For compatibility reasons the 'Context.' prefix is still supported in newer releases of <b>DuiValueSpace</b>. The <b>DuiValueSpace</b> library transparently adds the 'Context.' prefix to all access functions.<p>
A call to:<p>
<div class="fragment"><pre class="fragment">    DuiValueSpaceItem topEdge(<span class="stringliteral">"Context.Screen.TopEdge"</span>);
</pre></div><p>
...is internally in <b>DuiValueSpace</b> converted to actual <code>Screen.TopEdge</code> wire access. This mechanism has been introduced to make the <b>DuiValueSpace</b> and <b>libcontextsubscriber</b> libraries parallel-installable.<p>
It's expected that all <b>DuiValueSpace</b> clients migrate to <b>libcontextsubscriber</b> eventually and <b>DuiValueSpace</b> library will be removed.<p>
<dl class="warning" compact><dt><b>Warning:</b></dt><dd>When migrating to <b>libcontextsubscriber</b> make sure to remove the 'Context.' from you key access paths. </dd></dl>
</div>
<hr size="1"><address style="text-align: right;"><small>Generated on Fri Oct 23 08:59:23 2009 for libcontextsubscriber by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address>
</body>
</html>