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 #ifdef USER_DEFINED_ISDSURL |
|
18 #include <QFile> |
|
19 #include <QTextStream> |
|
20 #include <QStringList> |
|
21 #endif // USER_DEFINED_ISDSURL |
|
22 #include "irqisdsclientimpl.h" |
|
23 #include "irqenums.h" |
|
24 #include "irqfavoritesdb.h" |
|
25 #include "irlogodownloadengine.h" |
|
26 #include "irdataprovider.h" |
|
27 #include "irhttpdataprovider.h" |
|
28 #include "irqutility.h" |
|
29 #include "irbrowsecatagoryitems.h" |
|
30 #include "irbrowsechannelitems.h" |
|
31 #include "isdsclientdll.h" |
|
32 #include "irqisdsdatastructure.h" |
|
33 |
|
34 #ifdef USER_DEFINED_ISDSURL |
|
35 static const char* KDefaultIsdsUrl = "http://88.114.146.238/isds"; |
|
36 void getIsdsUrlFromConfiguration(QString & aUrl); |
|
37 #endif // USER_DEFINED_ISDSURL |
|
38 |
|
39 IRQIsdsClientImpl::IRQIsdsClientImpl() : iISDSClient(NULL), iFavPresets(NULL), |
|
40 iLogoDownloadEngine(NULL) |
|
41 { |
|
42 #ifdef USER_DEFINED_ISDSURL |
|
43 QString userDefinedIsdsUrl(KDefaultIsdsUrl); |
|
44 getIsdsUrlFromConfiguration(userDefinedIsdsUrl); |
|
45 TPtrC irqissbaseurl(reinterpret_cast<const TUint16*>(userDefinedIsdsUrl.utf16())); |
|
46 #else |
|
47 _LIT( irqissbaseurl, "http://idirectory.xgns.net/isds" ); |
|
48 #endif |
|
49 TRAPD(error, iISDSClient = CIRIsdsClient::NewL(*this, irqissbaseurl)); |
|
50 if(KErrNone != error) |
|
51 { |
|
52 return; |
|
53 } |
|
54 |
|
55 iLogoDownloadEngine |
|
56 = iISDSClient->GetDataProvider()->GetHttpDataProvider()->GetLogoDownloadEngine(); |
|
57 } |
|
58 |
|
59 IRQIsdsClientImpl::~IRQIsdsClientImpl() |
|
60 { |
|
61 delete iISDSClient; |
|
62 } |
|
63 |
|
64 //used to indicate errors in retrieving data from isds server |
|
65 //@param int, the error code sent by the http receiver |
|
66 // |
|
67 void IRQIsdsClientImpl::IsdsErrorL(int aErrCode) |
|
68 { |
|
69 if (KNotFound == aErrCode) |
|
70 { |
|
71 emit operationExceptionImpl(EIRQErrorNotFound); |
|
72 } |
|
73 else if (KErrCouldNotConnect == aErrCode) |
|
74 { |
|
75 emit operationExceptionImpl(EIRQErrorCouldNotConnect); |
|
76 } |
|
77 else if (KDndTimedOut == aErrCode) |
|
78 { |
|
79 emit operationExceptionImpl(EIRQErrorTimeOut); |
|
80 } |
|
81 else if (KServiceUnavailable == aErrCode) |
|
82 { |
|
83 emit operationExceptionImpl(EIRQErrorServiceUnavailable); |
|
84 } |
|
85 else if (KErrCorrupt == aErrCode) |
|
86 { |
|
87 emit operationExceptionImpl(EIRQErrorCorrupt); |
|
88 } |
|
89 else if (KDataProviderTimeout == aErrCode) |
|
90 { |
|
91 emit operationExceptionImpl(EIRQErrorTimeOut); |
|
92 } |
|
93 else |
|
94 emit operationExceptionImpl(EIRQErrorGeneral); |
|
95 } |
|
96 |
|
97 void IRQIsdsClientImpl::isdsSearchRequestImpl(const QString& aIsdsSearchString) |
|
98 { |
|
99 |
|
100 TPtrC16 searchDes( |
|
101 reinterpret_cast<const TUint16*> (aIsdsSearchString.utf16())); |
|
102 |
|
103 TRAPD( err, iISDSClient->IRISDSSearchL(searchDes)); |
|
104 if (KErrNone != err) |
|
105 { |
|
106 emit operationExceptionImpl(EIRQErrorGeneral); |
|
107 } |
|
108 } |
|
109 |
|
110 |
|
111 |
|
112 //Send the category request by the category type |
|
113 // |
|
114 void IRQIsdsClientImpl::isdsCategoryRequestImpl( |
|
115 IRQIsdsClient::IRQIsdsClientInterfaceIDs aIDType, bool& aCache) |
|
116 { |
|
117 iCatBannerTag = false; |
|
118 TRAPD( err, aCache = !(iISDSClient->IRIsdsClientIntefaceL((CIRIsdsClient::TIRIsdsclientInterfaceIDs)aIDType))); |
|
119 if (err != KErrNone) |
|
120 { |
|
121 emit operationExceptionImpl(EIRQErrorGeneral); |
|
122 } |
|
123 } |
|
124 |
|
125 bool IRQIsdsClientImpl::isdsIsCategoryCachedImpl(IRQIsdsClient::IRQIsdsClientInterfaceIDs aIDType) |
|
126 { |
|
127 bool cache = false; |
|
128 TRAP_IGNORE(cache = iISDSClient->IRIsdsIsCategoryCachedL((CIRIsdsClient::TIRIsdsclientInterfaceIDs)aIDType)); |
|
129 return cache; |
|
130 } |
|
131 |
|
132 bool IRQIsdsClientImpl::isdsIsChannelCachedImpl(int aIndex) |
|
133 { |
|
134 bool cache = false; |
|
135 TRAP_IGNORE(cache = iISDSClient->IRIsdsIsChannelCachedL(aIndex)); |
|
136 return cache; |
|
137 } |
|
138 |
|
139 //Send the channels request by the channel index in the specify category |
|
140 // |
|
141 void IRQIsdsClientImpl::isdsChannelRequestImpl(int aIndex, bool& aCache) |
|
142 { |
|
143 iChannelBannerTag = false; |
|
144 TRAPD( err, aCache = !(iISDSClient->IRIsdsClientIntefaceL(aIndex, CIRIsdsClient::ECatagory))); |
|
145 if (err != KErrNone) |
|
146 { |
|
147 emit operationExceptionImpl(EIRQErrorGeneral); |
|
148 } |
|
149 } |
|
150 |
|
151 //issue a listen request to the isds client |
|
152 //@param int,bool, the current index of channel, the history tag |
|
153 // |
|
154 void IRQIsdsClientImpl::isdsListenRequestImpl(int aCurrentIndex, |
|
155 bool aHistoryBool) |
|
156 { |
|
157 if (aHistoryBool) |
|
158 { |
|
159 TRAPD( err, iISDSClient->IRIsdsClientIntefaceL(aCurrentIndex, CIRIsdsClient::EChannels, ETrue)); |
|
160 if (err != KErrNone) |
|
161 { |
|
162 emit operationExceptionImpl(EIRQErrorGeneral); |
|
163 } |
|
164 } |
|
165 else |
|
166 { |
|
167 |
|
168 TRAPD( err, iISDSClient->IRIsdsClientIntefaceL(aCurrentIndex, CIRIsdsClient::EChannels)); |
|
169 if (err != KErrNone) |
|
170 { |
|
171 emit operationExceptionImpl(EIRQErrorGeneral); |
|
172 } |
|
173 } |
|
174 } |
|
175 |
|
176 //to syncronize presets |
|
177 //@param int,QString, the preset id and the last modified tag for the preset |
|
178 // |
|
179 int IRQIsdsClientImpl::isdsSyncPresetImpl(int aPresetId, |
|
180 const QString& aIfModifySince, IRQFavoritesDB *aFavPresets) |
|
181 { |
|
182 iFavPresets = aFavPresets; |
|
183 TPtrC16 modifySinceDes( |
|
184 reinterpret_cast<const TUint16*> (aIfModifySince.utf16())); |
|
185 TInt result = 0; |
|
186 TRAP_IGNORE(result = iISDSClient->SyncPresetL(aPresetId,modifySinceDes)); |
|
187 return result; |
|
188 } |
|
189 |
|
190 //Cacel the request sent by the UI. |
|
191 //@param None |
|
192 // |
|
193 void IRQIsdsClientImpl::isdsCancelRequestImpl() |
|
194 { |
|
195 TRAPD( err, iISDSClient->IRISDSCancelRequest()); |
|
196 if (err != KErrNone) |
|
197 { |
|
198 emit operationExceptionImpl(EIRQErrorGeneral); |
|
199 } |
|
200 } |
|
201 |
|
202 //to see wether category view has a banner. |
|
203 //@param None |
|
204 // |
|
205 bool IRQIsdsClientImpl::isdsIsCategoryBannerImpl() |
|
206 { |
|
207 return iCatBannerTag; |
|
208 } |
|
209 |
|
210 // |
|
211 //to see wether channel view has a banner. |
|
212 //@param None |
|
213 bool IRQIsdsClientImpl::isdsIsChannelBannerImpl() |
|
214 { |
|
215 return iChannelBannerTag; |
|
216 } |
|
217 |
|
218 |
|
219 //the api is called from the UI(nowplaying view) to download logo. |
|
220 //@param None |
|
221 // |
|
222 void IRQIsdsClientImpl::isdsLogoDownSendRequestImpl(IRQPreset* aPreset, |
|
223 int aNPVReq, int aXValue, int aYValue) |
|
224 { |
|
225 if (NULL == aPreset) |
|
226 return; |
|
227 |
|
228 CIRIsdsPreset *cirPreset = NULL; |
|
229 TRAP_IGNORE(cirPreset = CIRIsdsPreset::NewL()); |
|
230 IRQUtility::convertIRQPreset2CIRIsdsPreset(*aPreset, *cirPreset); |
|
231 |
|
232 aXValue = aXValue % 1000; |
|
233 aYValue = aYValue % 1000; |
|
234 |
|
235 TRAPD( err, iLogoDownloadEngine->SendRequestL(cirPreset,this, aNPVReq, aXValue, aYValue));//0 0 |
|
236 delete cirPreset; |
|
237 if (err != KErrNone) |
|
238 { |
|
239 emit operationExceptionImpl(EIRQErrorGeneral); |
|
240 } |
|
241 } |
|
242 |
|
243 bool IRQIsdsClientImpl::isdsIsLogoCachedImpl(IRQPreset* aPreset, int aXValue, int aYValue) |
|
244 { |
|
245 if( NULL == aPreset ) |
|
246 return false; |
|
247 |
|
248 bool cached = false; |
|
249 CIRIsdsPreset *cirPreset = NULL; |
|
250 TRAP_IGNORE(cirPreset = CIRIsdsPreset::NewL()); |
|
251 IRQUtility::convertIRQPreset2CIRIsdsPreset(*aPreset, *cirPreset); |
|
252 aXValue = aXValue % 1000; |
|
253 aYValue = aYValue % 1000; |
|
254 |
|
255 TRAP_IGNORE(cached = iLogoDownloadEngine->isLogoCachedL(cirPreset,aXValue, aYValue)); |
|
256 delete cirPreset; |
|
257 cirPreset = NULL; |
|
258 |
|
259 return cached; |
|
260 } |
|
261 |
|
262 // |
|
263 //the api is called to cancel the current transaction |
|
264 //@param None |
|
265 // |
|
266 void IRQIsdsClientImpl::isdsLogoDownCancelTransactionImpl() |
|
267 { |
|
268 iLogoDownloadEngine->CancelTransaction(); |
|
269 } |
|
270 |
|
271 // |
|
272 //To know the status of downloading logo |
|
273 bool IRQIsdsClientImpl::isdsLogoDownIsRunningImpl() const |
|
274 { |
|
275 return iLogoDownloadEngine->IsRunning(); |
|
276 } |
|
277 |
|
278 //takes the url as a parameter and returns the logo data which is in cache |
|
279 //this API is called form the search results for to display logo on the view |
|
280 //@param QString: the url of the img, int: the status for getting |
|
281 // |
|
282 void IRQIsdsClientImpl::isdsLogoDownCheckCacheLogoImpl( |
|
283 const QString& aURL, int& aStatus) |
|
284 { |
|
285 TInt status = 0; |
|
286 TPtrC16 url(reinterpret_cast<const TUint16*> (aURL.utf16())); |
|
287 TRAP_IGNORE(iLogoDownloadEngine->GetCacheLogoL(url, status)); |
|
288 aStatus = status; |
|
289 |
|
290 } |
|
291 |
|
292 //get the cache logo from the logodown engine. The "send" is the point from a logodown engine |
|
293 //@param None |
|
294 // |
|
295 TDesC8& IRQIsdsClientImpl::isdsLogoDownSendCacheLogoImpl() |
|
296 { |
|
297 return iLogoDownloadEngine->SendCacheLogo(); |
|
298 } |
|
299 |
|
300 void IRQIsdsClientImpl::isdsPostLogImpl(const QString &aFileName) |
|
301 { |
|
302 TPtrC16 fileName( |
|
303 reinterpret_cast<const TUint16*> (aFileName.utf16())); |
|
304 TBuf<256> fileBuf = fileName; |
|
305 TRAP_IGNORE(iISDSClient->IRISDSPostL(fileBuf)); |
|
306 } |
|
307 |
|
308 void IRQIsdsClientImpl::isdsGetIRIDImpl() |
|
309 { |
|
310 TRAP_IGNORE(iISDSClient->IRGetIRIDL()); |
|
311 } |
|
312 |
|
313 void IRQIsdsClientImpl::isdsGetBrowseBannerImpl(QString& aBannerUrl, QString& aClickThroughUrl) |
|
314 { |
|
315 aBannerUrl = iCatBannerUrl; |
|
316 aClickThroughUrl = iCatClickThroughUrl; |
|
317 } |
|
318 |
|
319 void IRQIsdsClientImpl::isdsMultSearchImpl(QString aGenreID, QString aCountryID, QString aLanguageID, QString aSearchText) |
|
320 { |
|
321 TPtrC16 genreID(reinterpret_cast<const TUint16*> (aGenreID.utf16())); |
|
322 TPtrC16 countryID(reinterpret_cast<const TUint16*> (aCountryID.utf16())); |
|
323 TPtrC16 languageID(reinterpret_cast<const TUint16*> (aLanguageID.utf16())); |
|
324 TPtrC16 searchText(reinterpret_cast<const TUint16*> (aSearchText.utf16())); |
|
325 TRAP_IGNORE(iISDSClient->IRISDSMultiSearchL(genreID, countryID, languageID, searchText)); |
|
326 } |
|
327 //when we get the category data from low layer, the function is called and |
|
328 //we will generate the data pushed to UI, the IRQIsdsClientImpl will not free the |
|
329 //memory. |
|
330 // |
|
331 void IRQIsdsClientImpl::IsdsCatogoryDataReceivedL(CArrayPtrFlat< |
|
332 CIRBrowseCatagoryItems> & aParsedStructure) |
|
333 { |
|
334 iCatBannerTag = false; |
|
335 iCatBannerUrl.clear(); |
|
336 iCatClickThroughUrl.clear(); |
|
337 |
|
338 /* the data is pushed to the UI and irqisds is not care when it's deleted */ |
|
339 QList<IRQBrowseCategoryItem *> * pushBrowseCategoryItemList = new QList< |
|
340 IRQBrowseCategoryItem *> ; |
|
341 for (TInt i = 0; i < aParsedStructure.Count(); i++) |
|
342 { |
|
343 if (NULL != aParsedStructure[i]->iCatBannerUrl) |
|
344 { |
|
345 iCatBannerTag = true; |
|
346 if (0 != aParsedStructure[i]->iCatBannerUrl->Length()) |
|
347 { |
|
348 iCatBannerUrl = QString::fromUtf16( |
|
349 aParsedStructure[i]->iCatBannerUrl->Des().Ptr(), |
|
350 aParsedStructure[i]->iCatBannerUrl->Des().Length()); |
|
351 } |
|
352 |
|
353 if (NULL != aParsedStructure[i]->iCatClickThroughUrl) |
|
354 { |
|
355 if (0 != aParsedStructure[i]->iCatClickThroughUrl->Length()) |
|
356 { |
|
357 iCatClickThroughUrl |
|
358 = QString::fromUtf16( |
|
359 aParsedStructure[i]->iCatClickThroughUrl->Des().Ptr(), |
|
360 aParsedStructure[i]->iCatClickThroughUrl->Des().Length()); |
|
361 } |
|
362 } |
|
363 }// end if ( NULL != ) |
|
364 |
|
365 if (NULL != aParsedStructure[i]->iCatName) |
|
366 { |
|
367 IRQBrowseCategoryItem * oneItem = new IRQBrowseCategoryItem(); |
|
368 oneItem->catName = QString::fromUtf16( |
|
369 aParsedStructure[i]->iCatName->Des().Ptr(), |
|
370 aParsedStructure[i]->iCatName->Des().Length()); |
|
371 oneItem->size = aParsedStructure[i]->iSize; |
|
372 pushBrowseCategoryItemList->append(oneItem); |
|
373 } |
|
374 }// end for |
|
375 |
|
376 /* now we get the data and we need to signal the ui to stop the |
|
377 dialog and emit and call the setdata of model*/ |
|
378 emit |
|
379 categoryItemsChangedImpl(pushBrowseCategoryItemList); |
|
380 |
|
381 } |
|
382 |
|
383 //when we get the channels data from low layer, the function is called and |
|
384 //we will generate the data pushed to UI |
|
385 // |
|
386 void IRQIsdsClientImpl::IsdsChannelDataReceivedL(CArrayPtrFlat< |
|
387 CIRBrowseChannelItems> & aParsedStructure) |
|
388 { |
|
389 iChannelBannerTag = false; |
|
390 iChannelBannerUrl.clear(); |
|
391 iChannelClickThroughUrl.clear(); |
|
392 |
|
393 QList<IRQChannelItem *> *pushBrowseChannelItemList = new QList< |
|
394 IRQChannelItem *> ; |
|
395 |
|
396 for (int i = 0; i < aParsedStructure.Count(); i++) |
|
397 { |
|
398 if (NULL != aParsedStructure[i]->iBannerUrl) |
|
399 { |
|
400 iChannelBannerTag = true; |
|
401 |
|
402 if (0 != aParsedStructure[i]->iBannerUrl->Length()) |
|
403 { |
|
404 iChannelBannerUrl = QString::fromUtf16( |
|
405 aParsedStructure[i]->iBannerUrl->Des().Ptr(), |
|
406 aParsedStructure[i]->iBannerUrl->Des().Length()); |
|
407 } |
|
408 |
|
409 if (NULL != aParsedStructure[i]->iClickThroughUrl) |
|
410 { |
|
411 if (0 != aParsedStructure[i]->iClickThroughUrl->Length()) |
|
412 { |
|
413 iChannelClickThroughUrl |
|
414 = QString::fromUtf16( |
|
415 aParsedStructure[i]->iClickThroughUrl->Des().Ptr(), |
|
416 aParsedStructure[i]->iClickThroughUrl->Des().Length()); |
|
417 } |
|
418 } |
|
419 } //end if aParsedStructure[i]-> |
|
420 |
|
421 if (NULL != aParsedStructure[i]->iChannelName) |
|
422 { |
|
423 IRQChannelItem * oneChannelItem = new IRQChannelItem(); |
|
424 oneChannelItem->channelName = QString::fromUtf16( |
|
425 aParsedStructure[i]->iChannelName->Des().Ptr(), |
|
426 aParsedStructure[i]->iChannelName->Des().Length()); |
|
427 oneChannelItem->shortDescription = QString::fromUtf16( |
|
428 aParsedStructure[i]->iShortDescription->Des().Ptr(), |
|
429 aParsedStructure[i]->iShortDescription->Des().Length()); |
|
430 |
|
431 if (0 != aParsedStructure[i]->iImgUrl.Length()) |
|
432 { |
|
433 |
|
434 oneChannelItem->imageURL = QString::fromUtf16( |
|
435 aParsedStructure[i]->iImgUrl.Ptr(), |
|
436 aParsedStructure[i]->iImgUrl.Length());; |
|
437 } |
|
438 else |
|
439 oneChannelItem->imageURL = ""; |
|
440 |
|
441 pushBrowseChannelItemList->append(oneChannelItem); |
|
442 } |
|
443 } |
|
444 |
|
445 /* after we get data, we push it to the UI to show*/ |
|
446 emit |
|
447 channelItemsChangedImpl(pushBrowseChannelItemList); |
|
448 |
|
449 } |
|
450 |
|
451 //when we get the presets data from low layer, the function is called and |
|
452 //we will generate the data pushed to UI. |
|
453 // |
|
454 void IRQIsdsClientImpl::IsdsPresetDataReceivedL( |
|
455 CArrayPtrFlat<CIRIsdsPreset> & aParsedStructure) |
|
456 { |
|
457 CIRIsdsPreset* preset = aParsedStructure[0]; |
|
458 IRQPreset* qPreset = new IRQPreset(); |
|
459 /* we need convert the CIR to QT */ |
|
460 IRQUtility::convertCIRIsdsPreset2IRQPrest(*preset, *qPreset); |
|
461 qPreset->type = IRQPreset::EIsds; |
|
462 emit |
|
463 presetResponseImpl(qPreset); |
|
464 |
|
465 } |
|
466 |
|
467 //when we find that the preset to be syc is deleted from isds server, the function |
|
468 //will be called to notify the UI. DISCUSSED FURTHER |
|
469 // |
|
470 void IRQIsdsClientImpl::IsdsPresetRemovedL(TInt aId) |
|
471 { |
|
472 if(iFavPresets) |
|
473 { |
|
474 iFavPresets->makePresetUserDefined(aId, 0); |
|
475 } |
|
476 emit |
|
477 syncPresetResultImpl(EIRQIsdsSycPresetRemoved, NULL); |
|
478 } |
|
479 |
|
480 //when we find that the preset to be syc is changed from isds server, the function |
|
481 //will be called to notify the UI. |
|
482 // |
|
483 void IRQIsdsClientImpl::IsdsPresetChangedL(CIRIsdsPreset& aPreset) |
|
484 { |
|
485 IRQPreset* qPreset = new IRQPreset(); |
|
486 IRQUtility::convertCIRIsdsPreset2IRQPrest(aPreset, *qPreset); |
|
487 qPreset->type = IRQPreset::EIsds; |
|
488 if(iFavPresets) |
|
489 { |
|
490 iFavPresets->replacePreset(*qPreset); |
|
491 } |
|
492 emit syncPresetResultImpl(EIRQIsdsSycPresetChanged, qPreset); |
|
493 } |
|
494 |
|
495 //when we find that the preset to be syc is changed from isds server, the function |
|
496 //will be called to notify the UI. |
|
497 // |
|
498 void IRQIsdsClientImpl::IsdsPresetNoChangeL() |
|
499 { |
|
500 emit syncPresetResultImpl(EIRQIsdsSycPresetNoChange, NULL); |
|
501 |
|
502 } |
|
503 |
|
504 //called back when a preset's logo has downloaded |
|
505 //@param CIRIsdsPreset*, preset with downloaded logo |
|
506 // |
|
507 void IRQIsdsClientImpl::PresetLogoDownloadedL(CIRIsdsPreset* aPreset) |
|
508 { |
|
509 if (NULL == aPreset) |
|
510 return; |
|
511 |
|
512 IRQPreset * irqPreset = new IRQPreset(); |
|
513 IRQUtility::convertCIRIsdsPreset2IRQPrest(*aPreset, *irqPreset); |
|
514 |
|
515 emit presetLogoDownloadedImpl(irqPreset); |
|
516 } |
|
517 |
|
518 //called back when a preset's logo has not downloaded |
|
519 //@param CIRIsdsPreset*, preset with no logo data |
|
520 // |
|
521 void IRQIsdsClientImpl::PresetLogoDownloadError(CIRIsdsPreset* aPreset) |
|
522 { |
|
523 if (NULL == aPreset) |
|
524 return; |
|
525 |
|
526 emit presetLogoDownloadErrorImpl(); |
|
527 } |
|
528 |
|
529 //receive the irid from isds server, not implementated |
|
530 // |
|
531 void IRQIsdsClientImpl::IsdsIRIDRecieved(const TDesC& aIRID) |
|
532 { |
|
533 //nothing now |
|
534 QString irid = QString::fromUtf16(aIRID.Ptr(),aIRID.Length()); |
|
535 emit iridReceivedImpl(irid); |
|
536 } |
|
537 |
|
538 |
|
539 |
|
540 |
|
541 // |
|
542 //receive the ota info from isds server, not implementated |
|
543 // |
|
544 void IRQIsdsClientImpl::IsdsOtaInfoRecieved(CIROTAUpdate &aOtaData) |
|
545 { |
|
546 //nothing now |
|
547 Q_UNUSED(aOtaData); |
|
548 } |
|
549 |
|
550 bool IRQIsdsClientImpl::isdsIsConstructSucceed() const |
|
551 { |
|
552 return iISDSClient != NULL; |
|
553 } |
|
554 |
|
555 |
|
556 #ifdef USER_DEFINED_ISDSURL |
|
557 void getIsdsUrlFromConfiguration(QString & aUrl) |
|
558 { |
|
559 QFile file("C:\\data\\QTIRConfigure.txt"); |
|
560 if (file.open(QIODevice::ReadOnly)) |
|
561 { |
|
562 QTextStream stream( &file ); |
|
563 QString line; |
|
564 QStringList parameter; |
|
565 while (!stream.atEnd()) |
|
566 { |
|
567 line = stream.readLine(); |
|
568 parameter = line.split("="); |
|
569 if (parameter.count() == 2) |
|
570 { |
|
571 if (parameter.first() == "userDefinedIsdsUrl") |
|
572 { |
|
573 aUrl = parameter.last(); |
|
574 break; |
|
575 } |
|
576 } |
|
577 } |
|
578 file.close(); |
|
579 } |
|
580 } |
|
581 #endif // USER_DEFINED_ISDSURL |
|
582 |
|