13 * |
13 * |
14 * Description: VideoCollectionClient class implementation |
14 * Description: VideoCollectionClient class implementation |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
|
18 // Version : %version: 39 % |
|
19 |
18 // INCLUDE FILES |
20 // INCLUDE FILES |
19 #include <QObject> |
21 #include <qobject.h> |
20 #include <centralrepository.h> |
22 #include <centralrepository.h> |
21 #include <mpxcollectionutility.h> |
23 #include <mpxcollectionutility.h> |
22 #include <mpxcollectionpath.h> |
24 #include <mpxcollectionpath.h> |
23 #include <mpxmediageneraldefs.h> |
25 #include <mpxmediageneraldefs.h> |
24 #include <mpxmessagegeneraldefs.h> |
26 #include <mpxmessagegeneraldefs.h> |
32 #include <vcxmyvideosuids.h> |
34 #include <vcxmyvideosuids.h> |
33 |
35 |
34 #include "videodatasignalreceiver.h" |
36 #include "videodatasignalreceiver.h" |
35 #include "videocollectionclient.h" |
37 #include "videocollectionclient.h" |
36 #include "videocollectionlistener.h" |
38 #include "videocollectionlistener.h" |
|
39 #include "videocollectiontrace.h" |
37 |
40 |
38 // ----------------------------------------------------------------------------- |
41 // ----------------------------------------------------------------------------- |
39 // VideoCollectionClient() |
42 // VideoCollectionClient() |
40 // ----------------------------------------------------------------------------- |
43 // ----------------------------------------------------------------------------- |
41 // |
44 // |
42 VideoCollectionClient::VideoCollectionClient() : |
45 VideoCollectionClient::VideoCollectionClient() |
43 mCollectionUtility(0), |
46 : mCollectionUtility( 0 ) |
44 mCollectionOpenStatus(ECollectionNotOpen), |
47 , mCollectionOpenStatus( ECollectionNotOpen ) |
45 mCollectionListener(0), |
48 , mCollectionListener( 0 ) |
46 mOpenCategoryAlbum(TMPXItemId::InvalidId()), |
49 , mOpenCategoryAlbum( TMPXItemId::InvalidId() ) |
47 mCollectionPathLevel(VideoCollectionCommon::ELevelInvalid) |
50 , mCollectionPathLevel( VideoCollectionCommon::ELevelInvalid ) |
48 { |
51 { |
49 |
52 FUNC_LOG; |
50 } |
53 } |
51 |
54 |
52 // ----------------------------------------------------------------------------- |
55 // ----------------------------------------------------------------------------- |
53 // initialize() |
56 // initialize() |
54 // ----------------------------------------------------------------------------- |
57 // ----------------------------------------------------------------------------- |
55 // |
58 // |
56 int VideoCollectionClient::initialize(VideoDataSignalReceiver *signalReceiver) |
59 int VideoCollectionClient::initialize(VideoDataSignalReceiver *signalReceiver) |
57 { |
60 { |
|
61 FUNC_LOG; |
58 if(!signalReceiver) |
62 if(!signalReceiver) |
59 { |
63 { |
60 return -1; |
64 return -1; |
61 } |
65 } |
62 if(mCollectionUtility && mCollectionListener) |
66 if(mCollectionUtility && mCollectionListener) |
63 { |
67 { |
64 // already initialized |
68 INFO("VideoCollectionClient::initialize() already initialized."); |
65 return 0; |
69 return 0; |
66 } |
70 } |
67 if(!mCollectionListener) |
71 if(!mCollectionListener) |
68 { |
72 { |
69 mCollectionListener = new VideoCollectionListener(*this, *signalReceiver); |
73 mCollectionListener = new VideoCollectionListener(*this, *signalReceiver); |
75 if(!mCollectionUtility) |
79 if(!mCollectionUtility) |
76 { |
80 { |
77 TRAPD( error, mCollectionUtility = MMPXCollectionUtility::NewL( mCollectionListener, KMcModeDefault ) ); |
81 TRAPD( error, mCollectionUtility = MMPXCollectionUtility::NewL( mCollectionListener, KMcModeDefault ) ); |
78 if(error) |
82 if(error) |
79 { |
83 { |
|
84 ERROR(error, "VideoCollectionClient::initialize() construction of collection utility failed."); |
80 delete mCollectionListener; |
85 delete mCollectionListener; |
81 mCollectionListener = 0; |
86 mCollectionListener = 0; |
82 return error; |
87 return error; |
83 } |
88 } |
84 } |
89 } |
89 // ~VideoCollectionClient() |
94 // ~VideoCollectionClient() |
90 // ----------------------------------------------------------------------------- |
95 // ----------------------------------------------------------------------------- |
91 // |
96 // |
92 VideoCollectionClient::~VideoCollectionClient() |
97 VideoCollectionClient::~VideoCollectionClient() |
93 { |
98 { |
|
99 FUNC_LOG; |
94 if (mCollectionUtility) |
100 if (mCollectionUtility) |
95 { |
101 { |
96 // closing deallocates collection utility pointer |
102 // closing deallocates collection utility pointer |
97 mCollectionUtility->Close(); |
103 mCollectionUtility->Close(); |
98 } |
104 } |
104 // --------------------------------------------------------------------------- |
110 // --------------------------------------------------------------------------- |
105 // |
111 // |
106 |
112 |
107 void VideoCollectionClient::getCategoryId(TMPXItemId &id) |
113 void VideoCollectionClient::getCategoryId(TMPXItemId &id) |
108 { |
114 { |
|
115 FUNC_LOG; |
109 id = mOpenCategoryAlbum; |
116 id = mOpenCategoryAlbum; |
110 } |
117 } |
111 |
118 |
112 // --------------------------------------------------------------------------- |
119 // --------------------------------------------------------------------------- |
113 // getCollectionLevel |
120 // getCollectionLevel |
114 // --------------------------------------------------------------------------- |
121 // --------------------------------------------------------------------------- |
115 // |
122 // |
116 int VideoCollectionClient::getCollectionLevel() |
123 int VideoCollectionClient::getCollectionLevel() |
117 { |
124 { |
|
125 FUNC_LOG; |
118 return mCollectionPathLevel; |
126 return mCollectionPathLevel; |
119 } |
127 } |
120 |
128 |
121 // --------------------------------------------------------------------------- |
129 // --------------------------------------------------------------------------- |
122 // getOpenStatus |
130 // getOpenStatus |
123 // --------------------------------------------------------------------------- |
131 // --------------------------------------------------------------------------- |
124 // |
132 // |
125 int VideoCollectionClient::getOpenStatus() |
133 int VideoCollectionClient::getOpenStatus() |
126 { |
134 { |
|
135 FUNC_LOG; |
127 return mCollectionOpenStatus; |
136 return mCollectionOpenStatus; |
128 } |
137 } |
129 |
138 |
130 // --------------------------------------------------------------------------- |
139 // --------------------------------------------------------------------------- |
131 // setOpenStatus |
140 // setOpenStatus |
132 // --------------------------------------------------------------------------- |
141 // --------------------------------------------------------------------------- |
133 // |
142 // |
134 void VideoCollectionClient::setOpenStatus(int status) |
143 void VideoCollectionClient::setOpenStatus(int status, bool startOpening) |
135 { |
144 { |
|
145 FUNC_LOG; |
|
146 INFO_2("VideoCollectionClient::setOpenStatus() status: %d start opening %d", status, startOpening); |
136 mCollectionOpenStatus = status; |
147 mCollectionOpenStatus = status; |
137 if(mCollectionOpenStatus == ECollectionOpened) |
148 if(mCollectionOpenStatus == ECollectionOpened && startOpening) |
138 { |
149 { |
139 startOpenCurrentState(); |
150 startOpenCurrentState(); |
140 } |
151 } |
141 } |
152 } |
142 |
153 |
165 // startOpenCurrentState |
179 // startOpenCurrentState |
166 // ----------------------------------------------------------------------------- |
180 // ----------------------------------------------------------------------------- |
167 // |
181 // |
168 int VideoCollectionClient::startOpenCurrentState() |
182 int VideoCollectionClient::startOpenCurrentState() |
169 { |
183 { |
|
184 FUNC_LOG; |
170 int error = -1; |
185 int error = -1; |
171 if(mCollectionUtility && mCollectionOpenStatus == ECollectionOpened) |
186 if(mCollectionUtility && mCollectionOpenStatus == ECollectionOpened) |
172 { |
187 { |
173 TRAP(error, mCollectionUtility->Collection().OpenL()); |
188 TRAP(error, mCollectionUtility->Collection().OpenL()); |
174 } |
189 } |
178 // ----------------------------------------------------------------------------- |
193 // ----------------------------------------------------------------------------- |
179 // deleteFile |
194 // deleteFile |
180 // ----------------------------------------------------------------------------- |
195 // ----------------------------------------------------------------------------- |
181 int VideoCollectionClient::deleteVideos(QList<TMPXItemId> *mediaIds) |
196 int VideoCollectionClient::deleteVideos(QList<TMPXItemId> *mediaIds) |
182 { |
197 { |
|
198 FUNC_LOG; |
183 if(!mCollectionUtility || !mediaIds) |
199 if(!mCollectionUtility || !mediaIds) |
184 { |
200 { |
185 return -1; |
201 return -1; |
186 } |
202 } |
187 TRAPD(error, deleteVideosL(*mediaIds)); |
203 TRAPD(error, deleteVideosL(*mediaIds)); |
260 // addNewAlbum |
280 // addNewAlbum |
261 // ----------------------------------------------------------------------------- |
281 // ----------------------------------------------------------------------------- |
262 // |
282 // |
263 TMPXItemId VideoCollectionClient::addNewAlbum(const QString &title) |
283 TMPXItemId VideoCollectionClient::addNewAlbum(const QString &title) |
264 { |
284 { |
|
285 FUNC_LOG; |
|
286 |
265 TMPXItemId id = TMPXItemId::InvalidId(); |
287 TMPXItemId id = TMPXItemId::InvalidId(); |
266 |
288 |
267 if (mCollectionUtility && title.length()) |
289 if (mCollectionUtility && title.length()) |
268 { |
290 { |
269 TRAPD(err, id = createAlbumL(title)); |
291 TRAPD(err, id = createAlbumL(title)); |
295 // ----------------------------------------------------------------------------- |
318 // ----------------------------------------------------------------------------- |
296 // addItemsInAlbum |
319 // addItemsInAlbum |
297 // ----------------------------------------------------------------------------- |
320 // ----------------------------------------------------------------------------- |
298 // |
321 // |
299 int VideoCollectionClient::addItemsInAlbum(TMPXItemId &albumId, |
322 int VideoCollectionClient::addItemsInAlbum(TMPXItemId &albumId, |
300 const QList<TMPXItemId> &mediaIds) |
323 const QList<TMPXItemId> &mediaIds) |
301 { |
324 { |
|
325 FUNC_LOG; |
302 int err(-1); |
326 int err(-1); |
303 |
327 |
304 if (mCollectionUtility && albumId != TMPXItemId::InvalidId() && |
328 if (mCollectionUtility && albumId != TMPXItemId::InvalidId() && |
305 albumId.iId2 == KVcxMvcMediaTypeAlbum && mediaIds.count()) |
329 albumId.iId2 == KVcxMvcMediaTypeAlbum && mediaIds.count()) |
306 { |
330 { |
313 // ----------------------------------------------------------------------------- |
337 // ----------------------------------------------------------------------------- |
314 // removeItemsFromAlbum |
338 // removeItemsFromAlbum |
315 // ----------------------------------------------------------------------------- |
339 // ----------------------------------------------------------------------------- |
316 // |
340 // |
317 int VideoCollectionClient::removeItemsFromAlbum(TMPXItemId &albumId, |
341 int VideoCollectionClient::removeItemsFromAlbum(TMPXItemId &albumId, |
318 const QList<TMPXItemId> &mediaIds) |
342 const QList<TMPXItemId> &mediaIds) |
319 { |
343 { |
|
344 FUNC_LOG; |
320 int err(-1); |
345 int err(-1); |
321 |
346 |
322 if (mCollectionUtility && albumId != TMPXItemId::InvalidId() && |
347 if (mCollectionUtility && albumId != TMPXItemId::InvalidId() && |
323 albumId.iId2 == KVcxMvcMediaTypeAlbum && mediaIds.count()) |
348 albumId.iId2 == KVcxMvcMediaTypeAlbum && mediaIds.count()) |
324 { |
349 { |
327 |
352 |
328 return err; |
353 return err; |
329 } |
354 } |
330 |
355 |
331 // ----------------------------------------------------------------------------- |
356 // ----------------------------------------------------------------------------- |
|
357 // renameAlbum |
|
358 // ----------------------------------------------------------------------------- |
|
359 // |
|
360 int VideoCollectionClient::renameAlbum(const TMPXItemId &albumId, |
|
361 const QString &newTitle) |
|
362 { |
|
363 FUNC_LOG; |
|
364 int err(-1); |
|
365 |
|
366 if(mCollectionUtility && albumId.iId2 == KVcxMvcMediaTypeAlbum && |
|
367 !newTitle.isEmpty()) |
|
368 { |
|
369 TRAP(err, renameAlbumL(albumId, newTitle)); |
|
370 } |
|
371 |
|
372 return err; |
|
373 } |
|
374 |
|
375 // ----------------------------------------------------------------------------- |
332 // startOpenCollectionL |
376 // startOpenCollectionL |
333 // ----------------------------------------------------------------------------- |
377 // ----------------------------------------------------------------------------- |
334 // |
378 // |
335 void VideoCollectionClient::startOpenCollectionL(int level) |
379 void VideoCollectionClient::startOpenCollectionL(int level) |
336 { |
380 { |
|
381 FUNC_LOG; |
|
382 INFO_1("VideoCollectionClient::startOpenCollectionL() level: %d", level); |
|
383 |
337 if(!mCollectionUtility) |
384 if(!mCollectionUtility) |
338 { |
385 { |
339 User::Leave(KErrGeneral); |
386 User::Leave(KErrGeneral); |
340 } |
387 } |
341 CMPXCollectionPath* collectionPath = CMPXCollectionPath::NewL(); |
388 CMPXCollectionPath* collectionPath = CMPXCollectionPath::NewL(); |
344 collectionPath->AppendL( KVcxUidMyVideosMpxCollection ); |
391 collectionPath->AppendL( KVcxUidMyVideosMpxCollection ); |
345 if (level == VideoCollectionCommon::ELevelVideos) |
392 if (level == VideoCollectionCommon::ELevelVideos) |
346 { |
393 { |
347 collectionPath->AppendL( KVcxMvcCategoryIdAll ); |
394 collectionPath->AppendL( KVcxMvcCategoryIdAll ); |
348 |
395 |
349 mOpenCategoryAlbum.iId1 = KVcxMvcCategoryIdAll; |
396 mOpenCategoryAlbum = TMPXItemId(KVcxMvcCategoryIdAll, KVcxMvcMediaTypeCategory); |
350 mOpenCategoryAlbum.iId2 = 1; |
|
351 |
|
352 mCollectionPathLevel = VideoCollectionCommon::ELevelVideos; |
397 mCollectionPathLevel = VideoCollectionCommon::ELevelVideos; |
353 } |
398 } |
354 else |
399 else |
355 { |
400 { |
356 mOpenCategoryAlbum = TMPXItemId::InvalidId(); |
401 mOpenCategoryAlbum = TMPXItemId::InvalidId(); |
357 |
|
358 mCollectionPathLevel = VideoCollectionCommon::ELevelCategory; |
402 mCollectionPathLevel = VideoCollectionCommon::ELevelCategory; |
359 } |
403 } |
360 mCollectionUtility->Collection().OpenL( *collectionPath ); |
404 mCollectionUtility->Collection().OpenL( *collectionPath ); |
361 CleanupStack::PopAndDestroy( collectionPath ); |
405 CleanupStack::PopAndDestroy( collectionPath ); |
362 |
406 |
363 mCollectionOpenStatus = ECollectionOpening; |
407 mCollectionOpenStatus = ECollectionOpening; |
364 } |
408 } |
365 |
409 |
366 |
|
367 // ----------------------------------------------------------------------------- |
410 // ----------------------------------------------------------------------------- |
368 // deleteVideosL |
411 // deleteVideosL |
369 // ----------------------------------------------------------------------------- |
412 // ----------------------------------------------------------------------------- |
370 // |
413 // |
371 void VideoCollectionClient::deleteVideosL(QList<TMPXItemId> &mediaIds) |
414 void VideoCollectionClient::deleteVideosL(QList<TMPXItemId> &mediaIds) |
372 { |
415 { |
|
416 FUNC_LOG; |
373 if(!mCollectionUtility || mediaIds.count() == 0) |
417 if(!mCollectionUtility || mediaIds.count() == 0) |
374 { |
418 { |
375 User::Leave(KErrGeneral); |
419 User::Leave(KErrGeneral); |
376 } |
420 } |
377 CMPXMediaArray* mediasToDelete = CMPXMediaArray::NewL(); |
421 CMPXMediaArray* mediasToDelete = CMPXMediaArray::NewL(); |
409 // openVideoL |
453 // openVideoL |
410 // ----------------------------------------------------------------------------- |
454 // ----------------------------------------------------------------------------- |
411 // |
455 // |
412 void VideoCollectionClient::openVideoL(TMPXItemId &videoId) |
456 void VideoCollectionClient::openVideoL(TMPXItemId &videoId) |
413 { |
457 { |
|
458 FUNC_LOG; |
414 if(!mCollectionUtility) |
459 if(!mCollectionUtility) |
415 { |
460 { |
416 User::Leave(KErrGeneral); |
461 User::Leave(KErrGeneral); |
417 } |
462 } |
418 CMPXCollectionPath* path = CMPXCollectionPath::NewL(); |
463 CMPXCollectionPath* path = CMPXCollectionPath::NewL(); |
430 // openCategoryL |
475 // openCategoryL |
431 // ----------------------------------------------------------------------------- |
476 // ----------------------------------------------------------------------------- |
432 // |
477 // |
433 void VideoCollectionClient::openCategoryL(TMPXItemId &id) |
478 void VideoCollectionClient::openCategoryL(TMPXItemId &id) |
434 { |
479 { |
|
480 FUNC_LOG; |
435 if(!mCollectionUtility) |
481 if(!mCollectionUtility) |
436 { |
482 { |
437 User::Leave(KErrGeneral); |
483 User::Leave(KErrGeneral); |
438 } |
484 } |
439 CMPXCollectionPath* collectionPath = CMPXCollectionPath::NewL(); |
485 CMPXCollectionPath* collectionPath = CMPXCollectionPath::NewL(); |
453 // backL |
499 // backL |
454 // ----------------------------------------------------------------------------- |
500 // ----------------------------------------------------------------------------- |
455 // |
501 // |
456 void VideoCollectionClient::backL() |
502 void VideoCollectionClient::backL() |
457 { |
503 { |
|
504 FUNC_LOG; |
458 if(!mCollectionUtility) |
505 if(!mCollectionUtility) |
459 { |
506 { |
460 User::Leave(KErrGeneral); |
507 User::Leave(KErrGeneral); |
461 } |
508 } |
462 |
509 |
463 if (getCollectionLevel() > 2 ) |
510 if (getCollectionLevel() > 2 ) |
464 { |
511 { |
465 mCollectionUtility->Collection().BackL(); |
512 mCollectionUtility->Collection().BackL(); |
466 mCollectionOpenStatus = ECollectionOpening; |
513 mCollectionOpenStatus = ECollectionOpening; |
475 // getVideoDetailsL |
522 // getVideoDetailsL |
476 // ----------------------------------------------------------------------------- |
523 // ----------------------------------------------------------------------------- |
477 // |
524 // |
478 void VideoCollectionClient::getVideoDetailsL(TMPXItemId &videoId) |
525 void VideoCollectionClient::getVideoDetailsL(TMPXItemId &videoId) |
479 { |
526 { |
|
527 FUNC_LOG; |
480 if(!mCollectionUtility) |
528 if(!mCollectionUtility) |
481 { |
529 { |
482 User::Leave(KErrGeneral); |
530 User::Leave(KErrGeneral); |
483 } |
531 } |
484 CMPXCommand* cmd = CMPXCommand::NewL(); |
532 CMPXCommand* cmd = CMPXCommand::NewL(); |
531 mCollectionUtility->Collection().CommandL(*cmd); |
580 mCollectionUtility->Collection().CommandL(*cmd); |
532 } |
581 } |
533 else |
582 else |
534 { |
583 { |
535 // invalid data provided |
584 // invalid data provided |
|
585 ERROR(KErrGeneral, "VideoCollectionClient::removeItemsFromAlbumL() no albums found"); |
536 User::Leave(KErrGeneral); |
586 User::Leave(KErrGeneral); |
537 } |
587 } |
538 |
588 |
539 CleanupStack::PopAndDestroy( array ); |
589 CleanupStack::PopAndDestroy( array ); |
540 CleanupStack::PopAndDestroy( cmd ); |
590 CleanupStack::PopAndDestroy( cmd ); |
544 // createAlbumL |
594 // createAlbumL |
545 // ----------------------------------------------------------------------------- |
595 // ----------------------------------------------------------------------------- |
546 // |
596 // |
547 TMPXItemId VideoCollectionClient::createAlbumL(const QString &title) |
597 TMPXItemId VideoCollectionClient::createAlbumL(const QString &title) |
548 { |
598 { |
|
599 FUNC_LOG; |
549 TMPXItemId albumId = TMPXItemId::InvalidId(); |
600 TMPXItemId albumId = TMPXItemId::InvalidId(); |
550 |
601 |
551 CMPXCommand* cmd = CMPXCommand::NewL(); |
602 CMPXCommand* cmd = CMPXCommand::NewL(); |
552 CleanupStack::PushL( cmd ); |
603 CleanupStack::PushL( cmd ); |
553 |
604 |
578 // ----------------------------------------------------------------------------- |
629 // ----------------------------------------------------------------------------- |
579 // |
630 // |
580 void VideoCollectionClient::addItemsInAlbumL(TMPXItemId &albumId, |
631 void VideoCollectionClient::addItemsInAlbumL(TMPXItemId &albumId, |
581 const QList<TMPXItemId> &mediaIds) |
632 const QList<TMPXItemId> &mediaIds) |
582 { |
633 { |
|
634 FUNC_LOG; |
583 CMPXCommand* cmd = CMPXCommand::NewL(); |
635 CMPXCommand* cmd = CMPXCommand::NewL(); |
584 CleanupStack::PushL(cmd); |
636 CleanupStack::PushL(cmd); |
585 cmd->SetTObjectValueL(KMPXCommandGeneralId, KVcxCommandIdMyVideos); |
637 cmd->SetTObjectValueL(KMPXCommandGeneralId, KVcxCommandIdMyVideos); |
586 cmd->SetTObjectValueL(KVcxMediaMyVideosCommandId, KVcxCommandMyVideosAddToAlbum); |
638 cmd->SetTObjectValueL(KVcxMediaMyVideosCommandId, KVcxCommandMyVideosAddToAlbum); |
587 cmd->SetTObjectValueL(KVcxMediaMyVideosUint32Value, albumId.iId1); |
639 cmd->SetTObjectValueL(KVcxMediaMyVideosUint32Value, albumId.iId1); |
608 mCollectionUtility->Collection().CommandL(*cmd); |
660 mCollectionUtility->Collection().CommandL(*cmd); |
609 } |
661 } |
610 else |
662 else |
611 { |
663 { |
612 // invalid data provided |
664 // invalid data provided |
|
665 ERROR(KErrGeneral, "VideoCollectionClient::removeItemsFromAlbumL() no videos found"); |
613 User::Leave(KErrGeneral); |
666 User::Leave(KErrGeneral); |
614 } |
667 } |
615 |
668 |
616 CleanupStack::PopAndDestroy(array); |
669 CleanupStack::PopAndDestroy(array); |
617 CleanupStack::PopAndDestroy(cmd); |
670 CleanupStack::PopAndDestroy(cmd); |
622 // ----------------------------------------------------------------------------- |
675 // ----------------------------------------------------------------------------- |
623 // |
676 // |
624 void VideoCollectionClient::removeItemsFromAlbumL(TMPXItemId &albumId, |
677 void VideoCollectionClient::removeItemsFromAlbumL(TMPXItemId &albumId, |
625 const QList<TMPXItemId> &mediaIds) |
678 const QList<TMPXItemId> &mediaIds) |
626 { |
679 { |
|
680 FUNC_LOG; |
627 CMPXCommand* cmd = CMPXCommand::NewL(); |
681 CMPXCommand* cmd = CMPXCommand::NewL(); |
628 CleanupStack::PushL(cmd); |
682 CleanupStack::PushL(cmd); |
629 cmd->SetTObjectValueL(KMPXCommandGeneralId, KVcxCommandIdMyVideos); |
683 cmd->SetTObjectValueL(KMPXCommandGeneralId, KVcxCommandIdMyVideos); |
630 cmd->SetTObjectValueL(KVcxMediaMyVideosCommandId, KVcxCommandMyVideosRemoveFromAlbum); |
684 cmd->SetTObjectValueL(KVcxMediaMyVideosCommandId, KVcxCommandMyVideosRemoveFromAlbum); |
631 cmd->SetTObjectValueL(KVcxMediaMyVideosUint32Value, albumId.iId1); |
685 cmd->SetTObjectValueL(KVcxMediaMyVideosUint32Value, albumId.iId1); |
652 mCollectionUtility->Collection().CommandL(*cmd); |
706 mCollectionUtility->Collection().CommandL(*cmd); |
653 } |
707 } |
654 else |
708 else |
655 { |
709 { |
656 // invalid data provided |
710 // invalid data provided |
|
711 ERROR(KErrGeneral, "VideoCollectionClient::removeItemsFromAlbumL() no videos found"); |
657 User::Leave(KErrGeneral); |
712 User::Leave(KErrGeneral); |
658 } |
713 } |
659 CleanupStack::PopAndDestroy(array); |
714 CleanupStack::PopAndDestroy(array); |
660 CleanupStack::PopAndDestroy(cmd); |
715 CleanupStack::PopAndDestroy(cmd); |
661 } |
716 } |
662 |
717 |
663 // ----------------------------------------------------------------------------- |
718 // ----------------------------------------------------------------------------- |
|
719 // renameAlbumL |
|
720 // ----------------------------------------------------------------------------- |
|
721 // |
|
722 void VideoCollectionClient::renameAlbumL(const TMPXItemId &albumId, const QString newTitle) |
|
723 { |
|
724 FUNC_LOG; |
|
725 CMPXMedia *media = CMPXMedia::NewL(); |
|
726 CleanupStack::PushL(media); |
|
727 TPtrC titlePtrC(newTitle.utf16()); |
|
728 media->SetTObjectValueL<TMPXItemId>(KMPXMediaGeneralId, albumId); |
|
729 media->SetTextValueL(KMPXMediaGeneralTitle, titlePtrC); |
|
730 |
|
731 CMPXCommand* cmd = CMPXMedia::NewL(); |
|
732 CleanupStack::PushL( cmd ); |
|
733 |
|
734 cmd->SetTObjectValueL(KMPXCommandGeneralId, KMPXCommandIdCollectionSet); |
|
735 cmd->SetCObjectValueL<CMPXMedia>(KMPXCommandColSetMedia, media); |
|
736 cmd->SetTObjectValueL(KMPXCommandGeneralDoSync, ETrue); |
|
737 cmd->SetTObjectValueL(KMPXCommandGeneralCollectionId, |
|
738 TUid::Uid(KVcxUidMyVideosMpxCollection)); |
|
739 |
|
740 mCollectionUtility->Collection().CommandL(*cmd); |
|
741 |
|
742 CleanupStack::PopAndDestroy(cmd); |
|
743 CleanupStack::PopAndDestroy(media); |
|
744 } |
|
745 |
|
746 // ----------------------------------------------------------------------------- |
664 // fetchMpxMediaByMpxIdL |
747 // fetchMpxMediaByMpxIdL |
665 // ----------------------------------------------------------------------------- |
748 // ----------------------------------------------------------------------------- |
666 // |
749 // |
667 void VideoCollectionClient::fetchMpxMediaByMpxIdL(TMPXItemId &aMpxId) |
750 void VideoCollectionClient::fetchMpxMediaByMpxIdL(TMPXItemId &aMpxId) |
668 { |
751 { |
|
752 FUNC_LOG; |
669 if(!mCollectionUtility) |
753 if(!mCollectionUtility) |
670 { |
754 { |
671 User::Leave(KErrGeneral); |
755 User::Leave(KErrGeneral); |
672 } |
756 } |
673 |
757 |