author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Fri, 11 Jun 2010 13:38:32 +0300 | |
changeset 28 | 075425b8d9a4 |
parent 24 | 6df133bd92e1 |
child 32 | 189d20c34778 |
permissions | -rw-r--r-- |
24 | 1 |
/* |
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 |
* All rights reserved. |
|
4 |
* This component and the accompanying materials are made available |
|
5 |
* under the terms of "Eclipse Public License v1.0" |
|
6 |
* which accompanies this distribution, and is available |
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 |
* |
|
9 |
* Initial Contributors: |
|
10 |
* Nokia Corporation - initial contribution. |
|
11 |
* |
|
12 |
* Contributors: |
|
13 |
* |
|
14 |
* Description: |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
18 |
// System includes |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
19 |
#include <QTimer> |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
20 |
|
24 | 21 |
// User includes |
22 |
#include "radiomonitorservice.h" |
|
23 |
#include "radiouiengine.h" |
|
24 |
#include "radiouiengine_p.h" |
|
25 |
#include "radiostationmodel.h" |
|
26 |
#include "radioenginewrapper.h" |
|
27 |
#include "radioscannerengine.h" |
|
28 |
#include "radiostation.h" |
|
29 |
#include "radioservicedef.h" |
|
30 |
#include "radionotificationdata.h" |
|
31 |
#include "radiologger.h" |
|
32 |
||
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
33 |
// Constants |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
34 |
const int NOTIFICATION_DELAY = 200; |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
35 |
|
24 | 36 |
#define RUN_NOTIFY( type, data ) \ |
37 |
do { \ |
|
38 |
QVariant variant; \ |
|
39 |
variant.setValue( RadioNotificationData( RadioServiceNotification::type, data ) ); \ |
|
40 |
notify( variant ); \ |
|
41 |
} while ( 0 ) |
|
42 |
||
43 |
/*! |
|
44 |
* |
|
45 |
*/ |
|
46 |
RadioMonitorService::RadioMonitorService( RadioUiEnginePrivate& engine ) : |
|
47 |
XQServiceProvider( RADIO_MONITOR_SERVICE, &engine.api() ), |
|
48 |
mUiEngine( engine ), |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
49 |
mRadioStatus( RadioStatus::UnSpecified ), |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
50 |
mNotificationTimer( new QTimer( this ) ) |
24 | 51 |
{ |
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
52 |
mNotificationTimer->setSingleShot( true ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
53 |
mNotificationTimer->setInterval( NOTIFICATION_DELAY ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
54 |
Radio::connect( mNotificationTimer.data(), SIGNAL(timeout()), |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
55 |
this, SLOT(sendNotifications()) ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
56 |
|
24 | 57 |
publishAll(); |
58 |
} |
|
59 |
||
60 |
/*! |
|
61 |
* |
|
62 |
*/ |
|
63 |
RadioMonitorService::~RadioMonitorService() |
|
64 |
{ |
|
65 |
} |
|
66 |
||
67 |
/*! |
|
68 |
* |
|
69 |
*/ |
|
70 |
void RadioMonitorService::init() |
|
71 |
{ |
|
72 |
RadioStationModel* stationModel = &mUiEngine.api().stationModel(); |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
73 |
Radio::connect( stationModel, SIGNAL(rowsRemoved(QModelIndex,int,int)), |
24 | 74 |
this, SLOT(notifyFavoriteCount()) ); |
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
75 |
Radio::connect( stationModel, SIGNAL(favoriteChanged(RadioStation)), |
24 | 76 |
this, SLOT(notifyFavoriteCount()) ); |
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
77 |
Radio::connect( stationModel, SIGNAL(stationDataChanged(RadioStation)), |
24 | 78 |
this, SLOT(notifyStationChange(RadioStation)) ); |
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
79 |
Radio::connect( stationModel, SIGNAL(radioTextReceived(RadioStation)), |
24 | 80 |
this, SLOT(notifyStationChange(RadioStation)) ); |
81 |
||
82 |
RadioUiEngine* uiEngine = &mUiEngine.api(); |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
83 |
Radio::connect( uiEngine, SIGNAL(seekingStarted(int)), |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
84 |
this, SLOT(notifyRadioStatus()) ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
85 |
Radio::connect( uiEngine, SIGNAL(muteChanged(bool)), |
24 | 86 |
this, SLOT(notifyRadioStatus()) ); |
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
87 |
Radio::connect( uiEngine, SIGNAL(antennaStatusChanged(bool)), |
24 | 88 |
this, SLOT(notifyRadioStatus()) ); |
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
89 |
Radio::connect( uiEngine, SIGNAL(powerOffRequested()), |
24 | 90 |
this, SLOT(notifyRadioStatus()) ); |
91 |
||
92 |
mUiEngine.wrapper().addObserver( this ); |
|
93 |
||
94 |
notifyRadioStatus(); |
|
95 |
} |
|
96 |
||
97 |
/*! |
|
98 |
* Public slot |
|
99 |
* |
|
100 |
*/ |
|
101 |
void RadioMonitorService::requestNotifications() |
|
102 |
{ |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
103 |
//TODO: Uncomment when vendor id can be read from the client |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
104 |
// if ( requestInfo().clientVendorId() == NOKIA_VENDORID ) { |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
105 |
mRequestIndexes.append( setCurrentRequestAsync() ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
106 |
// } |
24 | 107 |
} |
108 |
||
109 |
/*! |
|
110 |
* Public slot |
|
111 |
* |
|
112 |
*/ |
|
113 |
void RadioMonitorService::requestAllData() |
|
114 |
{ |
|
115 |
RadioStationModel& stationModel = mUiEngine.api().stationModel(); |
|
116 |
const RadioStation station = stationModel.currentStation(); |
|
117 |
||
118 |
QVariantList notificationList; |
|
119 |
QVariant notification; |
|
120 |
||
121 |
RadioStatus::Status radioStatus = determineRadioStatus(); |
|
122 |
notification.setValue( RadioNotificationData( RadioServiceNotification::RadioStatus, radioStatus ) ); |
|
123 |
notificationList.append( notification ); |
|
124 |
||
125 |
notification.setValue( RadioNotificationData( RadioServiceNotification::FavoriteCount, stationModel.favoriteCount() ) ); |
|
126 |
notificationList.append( notification ); |
|
127 |
||
128 |
notification.setValue( RadioNotificationData( RadioServiceNotification::Frequency, station.frequency() ) ); |
|
129 |
notificationList.append( notification ); |
|
130 |
||
131 |
if ( !station.name().isEmpty() ) { |
|
132 |
notification.setValue( RadioNotificationData( RadioServiceNotification::Name, station.name() ) ); |
|
133 |
notificationList.append( notification ); |
|
134 |
} |
|
135 |
||
136 |
if ( station.genre() > 0 ) { |
|
137 |
notification.setValue( RadioNotificationData( RadioServiceNotification::Genre, |
|
138 |
mUiEngine.api().genreToString( station.genre(), GenreTarget::HomeScreen ) ) ); |
|
139 |
notificationList.append( notification ); |
|
140 |
} |
|
141 |
||
142 |
if ( !station.radioText().isEmpty() ) { |
|
143 |
notification.setValue( RadioNotificationData( RadioServiceNotification::RadioText, station.radioText() ) ); |
|
144 |
notificationList.append( notification ); |
|
145 |
} |
|
146 |
||
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
147 |
if ( !station.dynamicPsText().isEmpty() ) { |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
148 |
notification.setValue( RadioNotificationData( RadioServiceNotification::DynamicPS, station.dynamicPsText() ) ); |
24 | 149 |
notificationList.append( notification ); |
150 |
} |
|
151 |
||
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
152 |
checkIfCurrentStationIsFavorite(); |
24 | 153 |
|
154 |
completeRequest( setCurrentRequestAsync(), notificationList ); |
|
155 |
} |
|
156 |
||
157 |
/*! |
|
158 |
* Private slot |
|
159 |
*/ |
|
160 |
void RadioMonitorService::notifyRadioStatus() |
|
161 |
{ |
|
162 |
RadioStatus::Status radioStatus = determineRadioStatus(); |
|
163 |
||
164 |
if ( radioStatus != mRadioStatus ) { |
|
165 |
if ( radioStatus == RadioStatus::Seeking ) { |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
166 |
if ( RadioScannerEngine* scannerEngine = mUiEngine.api().scannerEngine() ) { |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
167 |
Radio::connect( scannerEngine, SIGNAL(destroyed()), |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
168 |
this, SLOT(notifyRadioStatus()) ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
169 |
} |
24 | 170 |
} |
171 |
||
172 |
mRadioStatus = radioStatus; |
|
173 |
RUN_NOTIFY( RadioStatus, radioStatus ); |
|
174 |
} |
|
175 |
} |
|
176 |
||
177 |
/*! |
|
178 |
* Private slot |
|
179 |
* |
|
180 |
*/ |
|
181 |
void RadioMonitorService::notifyFavoriteCount() |
|
182 |
{ |
|
183 |
const int favoriteCount = mUiEngine.api().stationModel().favoriteCount(); |
|
184 |
RUN_NOTIFY( FavoriteCount, favoriteCount ); |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
185 |
|
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
186 |
if ( favoriteCount == 1 ) { |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
187 |
checkIfCurrentStationIsFavorite(); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
188 |
} |
24 | 189 |
} |
190 |
||
191 |
/*! |
|
192 |
* Private slot |
|
193 |
* |
|
194 |
*/ |
|
195 |
void RadioMonitorService::notifyStationChange( const RadioStation& station ) |
|
196 |
{ |
|
197 |
RadioUiEngine& uiEngine = mUiEngine.api(); |
|
198 |
if ( uiEngine.isScanning() ) { |
|
199 |
return; |
|
200 |
} |
|
201 |
||
202 |
QVariantList list; |
|
203 |
QVariant notification; |
|
204 |
||
205 |
if ( station.hasDataChanged( RadioStation::GenreChanged ) ) { |
|
206 |
const QString genre = uiEngine.genreToString( station.genre(), GenreTarget::HomeScreen ); |
|
207 |
notification.setValue( RadioNotificationData( RadioServiceNotification::Genre, genre ) ); |
|
208 |
list.append( notification ); |
|
209 |
} |
|
210 |
||
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
211 |
if ( station.hasDataChanged( RadioStation::DynamicPsChanged ) ) { |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
212 |
notification.setValue( RadioNotificationData( RadioServiceNotification::DynamicPS, station.dynamicPsText() ) ); |
24 | 213 |
list.append( notification ); |
214 |
} |
|
215 |
||
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
216 |
if ( station.hasDataChanged( RadioStation::NameChanged ) ) { |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
217 |
notification.setValue( RadioNotificationData( RadioServiceNotification::Name, station.name() ) ); |
24 | 218 |
list.append( notification ); |
219 |
} |
|
220 |
||
221 |
if ( station.hasDataChanged( RadioStation::RadioTextChanged ) ) { |
|
222 |
notification.setValue( RadioNotificationData( RadioServiceNotification::RadioText, station.radioText() ) ); |
|
223 |
list.append( notification ); |
|
224 |
} |
|
225 |
||
226 |
notifyList( list ); |
|
227 |
} |
|
228 |
||
229 |
/*! |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
230 |
* Private slot |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
231 |
* |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
232 |
*/ |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
233 |
void RadioMonitorService::sendNotifications() |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
234 |
{ |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
235 |
notifyList( mNotificationList ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
236 |
mNotificationList.clear(); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
237 |
} |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
238 |
|
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
239 |
/*! |
24 | 240 |
* \reimp |
241 |
*/ |
|
242 |
void RadioMonitorService::tunedToFrequency( uint frequency, int reason ) |
|
243 |
{ |
|
244 |
Q_UNUSED( reason ); |
|
245 |
if ( !mUiEngine.api().isScanning() ) { |
|
246 |
RUN_NOTIFY( Frequency, frequency ); |
|
247 |
RadioStation station; |
|
248 |
if ( mUiEngine.api().stationModel().findFrequency( frequency, station ) && !station.name().isEmpty() ) { |
|
249 |
RUN_NOTIFY( Name, station.name() ); |
|
250 |
} |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
251 |
|
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
252 |
const int favoriteCount = mUiEngine.api().stationModel().favoriteCount(); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
253 |
if ( favoriteCount == 1 ) { |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
254 |
checkIfCurrentStationIsFavorite(); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
255 |
} |
24 | 256 |
} |
257 |
} |
|
258 |
||
259 |
/*! |
|
260 |
* |
|
261 |
*/ |
|
262 |
RadioStatus::Status RadioMonitorService::determineRadioStatus() const |
|
263 |
{ |
|
264 |
RadioUiEngine& uiEngine = mUiEngine.api(); |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
265 |
if ( uiEngine.isPoweringOff() ) { |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
266 |
return RadioStatus::PoweringOff; |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
267 |
} else if ( uiEngine.isScanning() ) { |
24 | 268 |
return RadioStatus::Seeking; |
269 |
} else if ( !uiEngine.isAntennaAttached() ) { |
|
270 |
return RadioStatus::NoAntenna; |
|
271 |
} else if ( uiEngine.isMuted() ) { |
|
272 |
return RadioStatus::Muted; |
|
273 |
} |
|
274 |
||
275 |
return RadioStatus::Playing; |
|
276 |
} |
|
277 |
||
278 |
/*! |
|
279 |
* |
|
280 |
*/ |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
281 |
void RadioMonitorService::checkIfCurrentStationIsFavorite() |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
282 |
{ |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
283 |
const bool currentIsFavorite = mUiEngine.api().stationModel().currentStation().isFavorite(); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
284 |
RUN_NOTIFY( CurrentIsFavorite, currentIsFavorite ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
285 |
} |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
286 |
|
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
287 |
/*! |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
288 |
* |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
289 |
*/ |
24 | 290 |
void RadioMonitorService::notify( const QVariant& notification ) |
291 |
{ |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
292 |
mNotificationTimer->stop(); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
293 |
mNotificationList.append( notification ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
294 |
mNotificationTimer->start(); |
24 | 295 |
} |
296 |
||
297 |
/*! |
|
298 |
* |
|
299 |
*/ |
|
300 |
void RadioMonitorService::notifyList( const QVariantList& list ) |
|
301 |
{ |
|
302 |
if ( mRequestIndexes.count() > 0 && list.count() > 0 ) { |
|
303 |
foreach ( int requestIndex, mRequestIndexes ) { |
|
304 |
completeRequest( requestIndex, list ); |
|
305 |
} |
|
306 |
mRequestIndexes.clear(); |
|
307 |
} |
|
308 |
} |