This file is indexed.

/usr/share/qt5/doc/qtpositioning/qtpositioning-satelliteinfo-satellitemodel-cpp.html is in qtpositioning5-doc-html 5.3.2-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
<?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" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>satellitemodel.cpp Example File | QtPositioning 5.3</title>
  <link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
    <div class="main">
    <div class="main-rounded">
        <div class="navigationbar">
        <ul>
<li>Qt 5.3</li>
<li><a href="qtpositioning-index.html">Qt Positioning</a></li>
<li><a href="qtpositioning-satelliteinfo-example.html">SatelliteInfo (C++/QML)</a></li>
<li>satellitemodel.cpp Example File</li>
<li id="buildversion">
Qt 5.3.2 Reference Documentation</li>
    </ul>
    </div>
</div>
<div class="content">
<div class="line">
<div class="content mainContent">
<h1 class="title">satellitemodel.cpp Example File</h1>
<span class="subtitle">satelliteinfo/satellitemodel.cpp</span>
<!-- $$$satelliteinfo/satellitemodel.cpp-description -->
<div class="descr"> <a name="details"></a>
<pre class="cpp"><span class="comment">/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the examples of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** &quot;Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
**   * Redistributions of source code must retain the above copyright
**     notice, this list of conditions and the following disclaimer.
**   * Redistributions in binary form must reproduce the above copyright
**     notice, this list of conditions and the following disclaimer in
**     the documentation and/or other materials provided with the
**     distribution.
**   * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
**     of its contributors may be used to endorse or promote products derived
**     from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.&quot;
**
** $QT_END_LICENSE$
**
****************************************************************************/</span>

<span class="preprocessor">#include &quot;satellitemodel.h&quot;</span>
<span class="preprocessor">#include &lt;QTimer&gt;</span>
<span class="preprocessor">#include &lt;QDebug&gt;</span>

SatelliteModel<span class="operator">::</span>SatelliteModel(<span class="type">QObject</span> <span class="operator">*</span>parent) :
    <span class="type">QAbstractListModel</span>(parent)<span class="operator">,</span> source(<span class="number">0</span>)<span class="operator">,</span> m_componentCompleted(<span class="keyword">false</span>)<span class="operator">,</span> m_running(<span class="keyword">false</span>)<span class="operator">,</span>
    m_runningRequested(<span class="keyword">false</span>)<span class="operator">,</span> demo(<span class="keyword">false</span>)<span class="operator">,</span> isSingle(<span class="keyword">false</span>)<span class="operator">,</span> singleRequestServed(<span class="keyword">false</span>)
{
    source <span class="operator">=</span> <span class="type"><a href="qgeosatelliteinfosource.html">QGeoSatelliteInfoSource</a></span><span class="operator">::</span>createDefaultSource(<span class="keyword">this</span>);
    <span class="keyword">if</span> (<span class="operator">!</span>demo <span class="operator">&amp;</span><span class="operator">&amp;</span> <span class="operator">!</span>source) {
        qWarning() <span class="operator">&lt;</span><span class="operator">&lt;</span> <span class="string">&quot;No satellite data source found. Changing to demo mode.&quot;</span>;
        demo <span class="operator">=</span> <span class="keyword">true</span>;
    }
    <span class="keyword">if</span> (<span class="operator">!</span>demo) {
        source<span class="operator">-</span><span class="operator">&gt;</span>setUpdateInterval(<span class="number">3000</span>);
        connect(source<span class="operator">,</span> SIGNAL(satellitesInViewUpdated(<span class="type">QList</span><span class="operator">&lt;</span><span class="type"><a href="qgeosatelliteinfo.html">QGeoSatelliteInfo</a></span><span class="operator">&gt;</span>))<span class="operator">,</span>
                <span class="keyword">this</span><span class="operator">,</span> SLOT(satellitesInViewUpdated(<span class="type">QList</span><span class="operator">&lt;</span><span class="type"><a href="qgeosatelliteinfo.html">QGeoSatelliteInfo</a></span><span class="operator">&gt;</span>)));
        connect(source<span class="operator">,</span> SIGNAL(satellitesInUseUpdated(<span class="type">QList</span><span class="operator">&lt;</span><span class="type"><a href="qgeosatelliteinfo.html">QGeoSatelliteInfo</a></span><span class="operator">&gt;</span>))<span class="operator">,</span>
                <span class="keyword">this</span><span class="operator">,</span> SLOT(satellitesInUseUpdated(<span class="type">QList</span><span class="operator">&lt;</span><span class="type"><a href="qgeosatelliteinfo.html">QGeoSatelliteInfo</a></span><span class="operator">&gt;</span>)));
        connect(source<span class="operator">,</span> SIGNAL(error(<span class="type"><a href="qgeosatelliteinfosource.html">QGeoSatelliteInfoSource</a></span><span class="operator">::</span>Error))<span class="operator">,</span>
                <span class="keyword">this</span><span class="operator">,</span> SLOT(error(<span class="type"><a href="qgeosatelliteinfosource.html">QGeoSatelliteInfoSource</a></span><span class="operator">::</span>Error)));
    }

    <span class="keyword">if</span> (demo) {
        timer <span class="operator">=</span> <span class="keyword">new</span> <span class="type">QTimer</span>(<span class="keyword">this</span>);
        connect(timer<span class="operator">,</span> SIGNAL(timeout())<span class="operator">,</span> <span class="keyword">this</span><span class="operator">,</span> SLOT(updateDemoData()));
        timer<span class="operator">-</span><span class="operator">&gt;</span>start(<span class="number">3000</span>);
    }
}

<span class="type">int</span> SatelliteModel<span class="operator">::</span>rowCount(<span class="keyword">const</span> <span class="type">QModelIndex</span> <span class="operator">&amp;</span>parent) <span class="keyword">const</span>
{
    Q_UNUSED(parent);
    <span class="keyword">if</span> (<span class="operator">!</span>source <span class="operator">&amp;</span><span class="operator">&amp;</span> <span class="operator">!</span>demo)
        <span class="keyword">return</span> <span class="number">0</span>;

    <span class="keyword">return</span> knownSatellites<span class="operator">.</span>count();
}

<span class="type">QVariant</span> SatelliteModel<span class="operator">::</span>data(<span class="keyword">const</span> <span class="type">QModelIndex</span> <span class="operator">&amp;</span>index<span class="operator">,</span> <span class="type">int</span> role) <span class="keyword">const</span>
{
    <span class="keyword">if</span> (<span class="operator">!</span>demo <span class="operator">&amp;</span><span class="operator">&amp;</span> <span class="operator">!</span>source)
        <span class="keyword">return</span> <span class="type">QVariant</span>();

    <span class="keyword">if</span> (<span class="operator">!</span>index<span class="operator">.</span>isValid() <span class="operator">|</span><span class="operator">|</span> index<span class="operator">.</span>row() <span class="operator">&lt;</span> <span class="number">0</span>)
        <span class="keyword">return</span> <span class="type">QVariant</span>();

    <span class="keyword">if</span> (index<span class="operator">.</span>row() <span class="operator">&gt;</span><span class="operator">=</span> knownSatellites<span class="operator">.</span>count()) {
        qWarning() <span class="operator">&lt;</span><span class="operator">&lt;</span> <span class="string">&quot;SatelliteModel: Index out of bound&quot;</span>;
        <span class="keyword">return</span> <span class="type">QVariant</span>();
    }

    <span class="keyword">const</span> <span class="type"><a href="qgeosatelliteinfo.html">QGeoSatelliteInfo</a></span> <span class="operator">&amp;</span>info <span class="operator">=</span> knownSatellites<span class="operator">.</span>at(index<span class="operator">.</span>row());
    <span class="keyword">switch</span> (role) {
    <span class="keyword">case</span> IdentifierRole:
        <span class="keyword">return</span> info<span class="operator">.</span>satelliteIdentifier();
    <span class="keyword">case</span> InUseRole:
        <span class="keyword">return</span> satellitesInUse<span class="operator">.</span>contains(info<span class="operator">.</span>satelliteIdentifier());
    <span class="keyword">case</span> SignalStrengthRole:
        <span class="keyword">return</span> info<span class="operator">.</span>signalStrength();
    <span class="keyword">case</span> ElevationRole:
        <span class="keyword">if</span> (<span class="operator">!</span>info<span class="operator">.</span>hasAttribute(<span class="type"><a href="qgeosatelliteinfo.html">QGeoSatelliteInfo</a></span><span class="operator">::</span>Elevation))
            <span class="keyword">return</span> <span class="type">QVariant</span>();
        <span class="keyword">return</span> info<span class="operator">.</span>attribute(<span class="type"><a href="qgeosatelliteinfo.html">QGeoSatelliteInfo</a></span><span class="operator">::</span>Elevation);
    <span class="keyword">case</span> AzimuthRole:
        <span class="keyword">if</span> (<span class="operator">!</span>info<span class="operator">.</span>hasAttribute(<span class="type"><a href="qgeosatelliteinfo.html">QGeoSatelliteInfo</a></span><span class="operator">::</span>Azimuth))
            <span class="keyword">return</span> <span class="type">QVariant</span>();
        <span class="keyword">return</span> info<span class="operator">.</span>attribute(<span class="type"><a href="qgeosatelliteinfo.html">QGeoSatelliteInfo</a></span><span class="operator">::</span>Azimuth);
    <span class="keyword">default</span>:
        <span class="keyword">break</span>;

    }

    <span class="keyword">return</span> <span class="type">QVariant</span>();
}

<span class="type">QHash</span><span class="operator">&lt;</span><span class="type">int</span><span class="operator">,</span> <span class="type">QByteArray</span><span class="operator">&gt;</span> SatelliteModel<span class="operator">::</span>roleNames() <span class="keyword">const</span>
{
    <span class="type">QHash</span><span class="operator">&lt;</span><span class="type">int</span><span class="operator">,</span> <span class="type">QByteArray</span><span class="operator">&gt;</span> roleNames;
    roleNames<span class="operator">.</span>insert(IdentifierRole<span class="operator">,</span> <span class="string">&quot;satelliteIdentifier&quot;</span>);
    roleNames<span class="operator">.</span>insert(InUseRole<span class="operator">,</span> <span class="string">&quot;isInUse&quot;</span>);
    roleNames<span class="operator">.</span>insert(SignalStrengthRole<span class="operator">,</span> <span class="string">&quot;signalStrength&quot;</span>);
    roleNames<span class="operator">.</span>insert(ElevationRole<span class="operator">,</span> <span class="string">&quot;elevation&quot;</span>);
    roleNames<span class="operator">.</span>insert(AzimuthRole<span class="operator">,</span> <span class="string">&quot;azimuth&quot;</span>);
    <span class="keyword">return</span> roleNames;
}

<span class="type">void</span> SatelliteModel<span class="operator">::</span>componentComplete()
{
    m_componentCompleted <span class="operator">=</span> <span class="keyword">true</span>;
    <span class="keyword">if</span> (m_runningRequested)
        setRunning(<span class="keyword">true</span>);
}

bool SatelliteModel<span class="operator">::</span>running() <span class="keyword">const</span>
{
    <span class="keyword">return</span> m_running;
}

bool SatelliteModel<span class="operator">::</span>isSingleRequest() <span class="keyword">const</span>
{
    <span class="keyword">return</span> isSingle;
}

<span class="type">void</span> SatelliteModel<span class="operator">::</span>setSingleRequest(bool single)
{
    <span class="keyword">if</span> (running()) {
        qWarning() <span class="operator">&lt;</span><span class="operator">&lt;</span> <span class="string">&quot;Cannot change single request mode while running&quot;</span>;
        <span class="keyword">return</span>;
    }

    <span class="keyword">if</span> (single <span class="operator">!</span><span class="operator">=</span> isSingle) { <span class="comment">//flag changed</span>
        isSingle <span class="operator">=</span> single;
        <span class="keyword">emit</span> singleRequestChanged();
    }
}

<span class="type">void</span> SatelliteModel<span class="operator">::</span>setRunning(bool isActive)
{
    <span class="keyword">if</span> (<span class="operator">!</span>source <span class="operator">&amp;</span><span class="operator">&amp;</span> <span class="operator">!</span>demo)
        <span class="keyword">return</span>;

    <span class="keyword">if</span> (<span class="operator">!</span>m_componentCompleted) {
        m_runningRequested <span class="operator">=</span> isActive;
        <span class="keyword">return</span>;
    }

    <span class="keyword">if</span> (m_running <span class="operator">=</span><span class="operator">=</span> isActive)
        <span class="keyword">return</span>;

    m_running <span class="operator">=</span> isActive;

    <span class="keyword">if</span> (m_running) {
        clearModel();
        <span class="keyword">if</span> (demo)
            timer<span class="operator">-</span><span class="operator">&gt;</span>start(<span class="number">2000</span>);
        <span class="keyword">else</span> <span class="keyword">if</span> (isSingleRequest())
            source<span class="operator">-</span><span class="operator">&gt;</span>requestUpdate(<span class="number">10000</span>);
        <span class="keyword">else</span>
            source<span class="operator">-</span><span class="operator">&gt;</span>startUpdates();

        <span class="keyword">if</span> (demo)
            singleRequestServed <span class="operator">=</span> <span class="keyword">false</span>;
    } <span class="keyword">else</span> {
        <span class="keyword">if</span> (demo)
            timer<span class="operator">-</span><span class="operator">&gt;</span>stop();
        <span class="keyword">else</span> <span class="keyword">if</span> (<span class="operator">!</span>isSingleRequest())
            source<span class="operator">-</span><span class="operator">&gt;</span>stopUpdates();
    }

    Q_EMIT runningChanged();
}

<span class="type">int</span> SatelliteModel<span class="operator">::</span>entryCount() <span class="keyword">const</span>
{
    <span class="keyword">return</span> knownSatellites<span class="operator">.</span>count();
}

bool SatelliteModel<span class="operator">::</span>canProvideSatelliteInfo() <span class="keyword">const</span>
{
    <span class="keyword">return</span> <span class="operator">!</span>demo;
}

<span class="type">void</span> SatelliteModel<span class="operator">::</span>clearModel()
{
    beginResetModel();
    knownSatelliteIds<span class="operator">.</span>clear();
    knownSatellites<span class="operator">.</span>clear();
    satellitesInUse<span class="operator">.</span>clear();
    endResetModel();
}

<span class="type">void</span> SatelliteModel<span class="operator">::</span>updateDemoData()
{
    <span class="keyword">static</span> bool flag <span class="operator">=</span> <span class="keyword">true</span>;
    <span class="type">QList</span><span class="operator">&lt;</span><span class="type"><a href="qgeosatelliteinfo.html">QGeoSatelliteInfo</a></span><span class="operator">&gt;</span> satellites;
    <span class="keyword">if</span> (flag) {
        <span class="keyword">for</span> (<span class="type">int</span> i <span class="operator">=</span> <span class="number">0</span>; i<span class="operator">&lt;</span><span class="number">5</span>; i<span class="operator">+</span><span class="operator">+</span>) {
            <span class="type"><a href="qgeosatelliteinfo.html">QGeoSatelliteInfo</a></span> info;
            info<span class="operator">.</span>setSatelliteIdentifier(i);
            info<span class="operator">.</span>setSignalStrength(<span class="number">20</span> <span class="operator">+</span> <span class="number">20</span><span class="operator">*</span>i);
            satellites<span class="operator">.</span>append(info);
        }
    } <span class="keyword">else</span> {
        <span class="keyword">for</span> (<span class="type">int</span> i <span class="operator">=</span> <span class="number">0</span>; i<span class="operator">&lt;</span><span class="number">9</span>; i<span class="operator">+</span><span class="operator">+</span>) {
            <span class="type"><a href="qgeosatelliteinfo.html">QGeoSatelliteInfo</a></span> info;
            info<span class="operator">.</span>setSatelliteIdentifier(i<span class="operator">*</span><span class="number">2</span>);
            info<span class="operator">.</span>setSignalStrength(<span class="number">20</span> <span class="operator">+</span> <span class="number">10</span><span class="operator">*</span>i);
            satellites<span class="operator">.</span>append(info);
        }
    }

    satellitesInViewUpdated(satellites);
    flag <span class="operator">?</span> satellitesInUseUpdated(<span class="type">QList</span><span class="operator">&lt;</span><span class="type"><a href="qgeosatelliteinfo.html">QGeoSatelliteInfo</a></span><span class="operator">&gt;</span>() <span class="operator">&lt;</span><span class="operator">&lt;</span> satellites<span class="operator">.</span>at(<span class="number">2</span>))
         : satellitesInUseUpdated(<span class="type">QList</span><span class="operator">&lt;</span><span class="type"><a href="qgeosatelliteinfo.html">QGeoSatelliteInfo</a></span><span class="operator">&gt;</span>() <span class="operator">&lt;</span><span class="operator">&lt;</span> satellites<span class="operator">.</span>at(<span class="number">3</span>));
    flag <span class="operator">=</span> <span class="operator">!</span>flag;

    <span class="keyword">emit</span> errorFound(flag);

    <span class="keyword">if</span> (isSingleRequest() <span class="operator">&amp;</span><span class="operator">&amp;</span> <span class="operator">!</span>singleRequestServed) {
        singleRequestServed <span class="operator">=</span> <span class="keyword">true</span>;
        setRunning(<span class="keyword">false</span>);
    }
}

<span class="type">void</span> SatelliteModel<span class="operator">::</span>error(<span class="type"><a href="qgeosatelliteinfosource.html">QGeoSatelliteInfoSource</a></span><span class="operator">::</span>Error error)
{
    <span class="keyword">emit</span> errorFound((<span class="type">int</span>)error);
}

<span class="keyword">inline</span> bool <span class="keyword">operator</span><span class="operator">&lt;</span>(<span class="keyword">const</span> <span class="type"><a href="qgeosatelliteinfo.html">QGeoSatelliteInfo</a></span><span class="operator">&amp;</span> a<span class="operator">,</span> <span class="keyword">const</span> <span class="type"><a href="qgeosatelliteinfo.html">QGeoSatelliteInfo</a></span><span class="operator">&amp;</span> b)
{
    <span class="keyword">return</span> a<span class="operator">.</span>satelliteIdentifier() <span class="operator">&lt;</span> b<span class="operator">.</span>satelliteIdentifier();
}

<span class="type">void</span> SatelliteModel<span class="operator">::</span>satellitesInViewUpdated(<span class="keyword">const</span> <span class="type">QList</span><span class="operator">&lt;</span><span class="type"><a href="qgeosatelliteinfo.html">QGeoSatelliteInfo</a></span><span class="operator">&gt;</span> <span class="operator">&amp;</span>infos)
{
    <span class="keyword">if</span> (<span class="operator">!</span>running())
        <span class="keyword">return</span>;

    <span class="type">int</span> oldEntryCount <span class="operator">=</span> knownSatellites<span class="operator">.</span>count();

    <span class="type">QSet</span><span class="operator">&lt;</span><span class="type">int</span><span class="operator">&gt;</span> satelliteIdsInUpdate;
    foreach (<span class="keyword">const</span> <span class="type"><a href="qgeosatelliteinfo.html">QGeoSatelliteInfo</a></span> <span class="operator">&amp;</span>info<span class="operator">,</span> infos)
        satelliteIdsInUpdate<span class="operator">.</span>insert(info<span class="operator">.</span>satelliteIdentifier());

    <span class="type">QSet</span><span class="operator">&lt;</span><span class="type">int</span><span class="operator">&gt;</span> toBeRemoved <span class="operator">=</span> knownSatelliteIds <span class="operator">-</span> satelliteIdsInUpdate;

    <span class="comment">//We reset the model as in reality just about all entry values change</span>
    <span class="comment">//and there are generally a lot of inserts and removals each time</span>
    <span class="comment">//Hence we don't bother with complex model update logic beyond resetModel()</span>
    beginResetModel();

    knownSatellites <span class="operator">=</span> infos;

    <span class="comment">//sort them for presentation purposes</span>
    std<span class="operator">::</span>sort(knownSatellites<span class="operator">.</span>begin()<span class="operator">,</span> knownSatellites<span class="operator">.</span>end());

    <span class="comment">//remove old &quot;InUse&quot; data</span>
    <span class="comment">//new satellites are by default not in &quot;InUse&quot;</span>
    <span class="comment">//existing satellites keep their &quot;inUse&quot; state</span>
    satellitesInUse <span class="operator">-</span><span class="operator">=</span> toBeRemoved;

    knownSatelliteIds <span class="operator">=</span> satelliteIdsInUpdate;
    endResetModel();

    <span class="keyword">if</span> (oldEntryCount <span class="operator">!</span><span class="operator">=</span> knownSatellites<span class="operator">.</span>count())
        <span class="keyword">emit</span> entryCountChanged();
}

<span class="type">void</span> SatelliteModel<span class="operator">::</span>satellitesInUseUpdated(<span class="keyword">const</span> <span class="type">QList</span><span class="operator">&lt;</span><span class="type"><a href="qgeosatelliteinfo.html">QGeoSatelliteInfo</a></span><span class="operator">&gt;</span> <span class="operator">&amp;</span>infos)
{
    <span class="keyword">if</span> (<span class="operator">!</span>running())
        <span class="keyword">return</span>;

    beginResetModel();

    satellitesInUse<span class="operator">.</span>clear();
    foreach (<span class="keyword">const</span> <span class="type"><a href="qgeosatelliteinfo.html">QGeoSatelliteInfo</a></span> <span class="operator">&amp;</span>info<span class="operator">,</span> infos)
        satellitesInUse<span class="operator">.</span>insert(info<span class="operator">.</span>satelliteIdentifier());

    endResetModel();
}</pre>
</div>
<!-- @@@satelliteinfo/satellitemodel.cpp -->
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2014 Digia Plc and/or its
   subsidiaries. Documentation contributions included herein are the copyrights of
   their respective owners.<br>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br>    Digia, Qt and their respective logos are trademarks of Digia Plc     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>