24 #include <hbstackedwidget.h> |
26 #include <hbstackedwidget.h> |
25 #include <hbmarqueeitem.h> |
27 #include <hbmarqueeitem.h> |
26 #include <hbpushbutton.h> |
28 #include <hbpushbutton.h> |
27 #include <hbaction.h> |
29 #include <hbaction.h> |
28 #include <qabstractitemmodel.h> |
30 #include <qabstractitemmodel.h> |
29 #include <qdebug.h> |
|
30 #include <hbmessagebox.h> |
31 #include <hbmessagebox.h> |
31 #include <hblistwidget.h> |
32 #include <hblistwidget.h> |
32 #include <hblistwidgetitem.h> |
33 #include <hblistwidgetitem.h> |
33 #include <hblistviewitem.h> |
34 #include <hblistviewitem.h> |
34 #include <cmath> |
35 #include <cmath> |
35 #include <thumbnailmanager_qt.h> |
36 #include <thumbnailmanager_qt.h> |
|
37 #include <shareui.h> |
|
38 |
36 #include "videocollectionclient.h" |
39 #include "videocollectionclient.h" |
37 #include "videofiledetailsviewplugin.h" |
40 #include "videofiledetailsviewplugin.h" |
38 #include "videocollectioncommon.h" |
41 #include "videocollectioncommon.h" |
39 #include "mpxhbvideocommondefs.h" |
42 #include "mpxhbvideocommondefs.h" |
40 #include "videocollectionwrapper.h" |
43 #include "videocollectionwrapper.h" |
41 #include "videosortfilterproxymodel.h" |
44 #include "videosortfilterproxymodel.h" |
42 #include "videoservices.h" |
45 #include "videoservices.h" |
43 #include "videodetailslabel.h" |
46 #include "videodetailslabel.h" |
44 |
47 #include "videocollectiontrace.h" |
45 const char* const VIDEO_DETAILS_DOCML = ":/xml/videofiledetails.docml"; |
48 |
46 const char* const VIDEO_DETAILS_PORTRAIT = "portrait"; |
49 const char* const VIDEO_DETAILS_DOCML = ":/xml/videofiledetails.docml"; |
47 const char* const VIDEO_DETAILS_LANDSCAPE = "landscape"; |
50 const char* const VIDEO_DETAILS_PORTRAIT = "portrait"; |
48 const char* const VIDEO_DETAILS_GFX_DEFAULT = ":/gfx/pri_large_video.svg"; |
51 const char* const VIDEO_DETAILS_LANDSCAPE = "landscape"; |
49 const char* const VIDEO_DETAILS_VIEW = "videofiledetailsview"; |
52 const char* const VIDEO_DETAILS_GFX_DEFAULT = ":/gfx/pri_large_video.svg"; |
50 const char* const VIDEO_DETAILS_TITLE = "mLblTitle"; |
53 const char* const VIDEO_DETAILS_VIEW = "videofiledetailsview"; |
51 const char* const VIDEO_DETAILS_THUMBNAIL = "mDetailsLabel"; |
54 const char* const VIDEO_DETAILS_TITLE = "mLblTitle"; |
52 const char* const VIDEO_DETAILS_BUTTON = "mButton"; |
55 const char* const VIDEO_DETAILS_THUMBNAIL = "mDetailsLabel"; |
|
56 const char* const VIDEO_DETAILS_BUTTON = "mButton"; |
53 const char* const VIDEO_DETAILS_MENUACTION_DELETE = "mOptionsDelete"; |
57 const char* const VIDEO_DETAILS_MENUACTION_DELETE = "mOptionsDelete"; |
54 const char* const VIDEO_DETAILS_LISTWIDGET ="mDetailsList"; |
58 const char* const VIDEO_DETAILS_LISTWIDGET = "mDetailsList"; |
55 |
|
56 // Just for testing, remove this |
|
57 void _DebugNotImplementedYet() |
|
58 { |
|
59 HbMessageBox::information(QObject::tr("Not implemented yet")); |
|
60 } |
|
61 |
59 |
62 // --------------------------------------------------------------------------- |
60 // --------------------------------------------------------------------------- |
63 // Constructor |
61 // Constructor |
64 // --------------------------------------------------------------------------- |
62 // --------------------------------------------------------------------------- |
65 // |
63 // |
66 VideoFileDetailsViewPlugin::VideoFileDetailsViewPlugin() |
64 VideoFileDetailsViewPlugin::VideoFileDetailsViewPlugin() |
67 : mModel(0), |
65 : mModel( 0 ) |
68 mVideoServices(0), |
66 , mVideoServices( 0 ) |
69 mActivated(false), |
67 , mActivated( false ) |
70 mIsService(false), |
68 , mIsService( false ) |
71 mVideoId(TMPXItemId::InvalidId()), |
69 , mVideoId( TMPXItemId::InvalidId() ) |
72 mDeletedIndex(-1), |
70 , mDeletedIndex( -1 ) |
73 mPreviousOrietation(Qt::Vertical), |
71 , mPreviousOrietation( Qt::Vertical ) |
74 mNavKeyBackAction(0), |
72 , mNavKeyBackAction( 0 ) |
75 mTitleAnim(0), |
73 , mTitleAnim( 0 ) |
76 mThumbLabel(0), |
74 , mThumbLabel( 0 ) |
77 mThumbnailManager(0), |
75 , mThumbnailManager( 0 ) |
78 mCollectionWrapper(VideoCollectionWrapper::instance()) |
76 , mCollectionWrapper( VideoCollectionWrapper::instance() ) |
79 { |
77 { |
80 |
78 FUNC_LOG; |
81 } |
79 } |
82 |
80 |
83 // --------------------------------------------------------------------------- |
81 // --------------------------------------------------------------------------- |
84 // Destructor |
82 // Destructor |
85 // --------------------------------------------------------------------------- |
83 // --------------------------------------------------------------------------- |
86 // |
84 // |
87 VideoFileDetailsViewPlugin::~VideoFileDetailsViewPlugin() |
85 VideoFileDetailsViewPlugin::~VideoFileDetailsViewPlugin() |
88 { |
86 { |
|
87 FUNC_LOG; |
89 destroyView(); |
88 destroyView(); |
90 } |
89 } |
91 |
90 |
92 // --------------------------------------------------------------------------- |
91 // --------------------------------------------------------------------------- |
93 // Create view |
92 // Create view |
94 // --------------------------------------------------------------------------- |
93 // --------------------------------------------------------------------------- |
95 // |
94 // |
96 void VideoFileDetailsViewPlugin::createView() |
95 void VideoFileDetailsViewPlugin::createView() |
97 { |
96 { |
|
97 FUNC_LOG; |
98 mLoader.reset(); |
98 mLoader.reset(); |
99 |
99 |
100 mActivated = false; |
100 mActivated = false; |
101 |
101 |
102 bool ok = false; |
102 bool ok = false; |
104 //Load the details view docml first |
104 //Load the details view docml first |
105 mLoader.load(VIDEO_DETAILS_DOCML, &ok); |
105 mLoader.load(VIDEO_DETAILS_DOCML, &ok); |
106 |
106 |
107 if(!ok) |
107 if(!ok) |
108 { |
108 { |
|
109 ERROR(-1, "VideoFileDetailsViewPlugin::createView() failed to load docml."); |
109 return; |
110 return; |
110 } |
111 } |
111 |
112 |
112 //Load portrait section by default as only vertical orientation is currently supported by videoplayer |
113 //Load portrait section by default as only vertical orientation is currently supported by videoplayer |
113 mLoader.load(VIDEO_DETAILS_DOCML, VIDEO_DETAILS_PORTRAIT, &ok); |
114 mLoader.load(VIDEO_DETAILS_DOCML, VIDEO_DETAILS_PORTRAIT, &ok); |
114 |
115 |
115 if(!ok) |
116 if(!ok) |
116 { |
117 { |
|
118 ERROR(-1, "VideoFileDetailsViewPlugin::createView() failed to load portrait view."); |
117 return; |
119 return; |
118 } |
120 } |
119 |
121 |
120 mModel = mCollectionWrapper.getModel(VideoCollectionWrapper::EAllVideos); |
122 mModel = mCollectionWrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos); |
121 |
123 |
122 if (!mModel) |
124 if (!mModel) |
123 { |
125 { |
124 qDebug() << "VideoFileDetailsViewPlugin::createView(): Unable to open collection wrapper. Cannot connect slots, aborting..."; |
126 ERROR(-1, "VideoFileDetailsViewPlugin::createView() get model failed."); |
125 // TODO need to throw exception instead? |
127 // TODO need to throw exception instead? |
126 return; |
128 return; |
127 } |
129 } |
128 |
130 |
129 mIsService = XQServiceUtil::isService(); |
131 mIsService = XQServiceUtil::isService(); |
139 connect(mModel->sourceModel(), |
141 connect(mModel->sourceModel(), |
140 SIGNAL(shortDetailsReady(TMPXItemId)), |
142 SIGNAL(shortDetailsReady(TMPXItemId)), |
141 this, SLOT(shortDetailsReadySlot(TMPXItemId))); |
143 this, SLOT(shortDetailsReadySlot(TMPXItemId))); |
142 |
144 |
143 connect(mModel->sourceModel(), |
145 connect(mModel->sourceModel(), |
144 SIGNAL(fullVideoDetailsReady(TMPXItemId)), |
146 SIGNAL(fullVideoDetailsReady(QVariant&)), |
145 this, SLOT(fullDetailsReadySlot(TMPXItemId))); |
147 this, SLOT(fullDetailsReadySlot(QVariant&))); |
146 |
148 |
147 connect(mModel, |
149 connect(mModel, |
148 SIGNAL(rowsRemoved(const QModelIndex&, int, int)), |
150 SIGNAL(rowsRemoved(const QModelIndex&, int, int)), |
149 this, SLOT(rowsRemovedSlot(const QModelIndex&, int, int))); |
151 this, SLOT(rowsRemovedSlot(const QModelIndex&, int, int))); |
150 |
152 |
|
153 // Setup thumbnail widget. |
151 HbStackedWidget* thumbWidget = findWidget<HbStackedWidget>(VIDEO_DETAILS_THUMBNAIL); |
154 HbStackedWidget* thumbWidget = findWidget<HbStackedWidget>(VIDEO_DETAILS_THUMBNAIL); |
|
155 if(!thumbWidget) |
|
156 { |
|
157 ERROR(-1, "VideoFileDetailsViewPlugin::createView() failed to load thumbnail widget."); |
|
158 return; |
|
159 } |
152 |
160 |
153 // no deallocation needed for this since |
161 // no deallocation needed for this since |
154 // stackedwidget takes ownership |
162 // stackedwidget takes ownership |
155 mThumbLabel = new VideoDetailsLabel; |
163 mThumbLabel = new VideoDetailsLabel; |
156 |
164 |
158 |
166 |
159 connect(mThumbLabel, SIGNAL(clicked(bool)), this, SLOT(startPlaybackSlot())); |
167 connect(mThumbLabel, SIGNAL(clicked(bool)), this, SLOT(startPlaybackSlot())); |
160 |
168 |
161 thumbWidget->addWidget(mThumbLabel); |
169 thumbWidget->addWidget(mThumbLabel); |
162 |
170 |
|
171 // Load details title. |
163 HbStackedWidget* title = findObject<HbStackedWidget>(VIDEO_DETAILS_TITLE); |
172 HbStackedWidget* title = findObject<HbStackedWidget>(VIDEO_DETAILS_TITLE); |
|
173 if(!title) |
|
174 { |
|
175 ERROR(-1, "VideoFileDetailsViewPlugin::createView() failed to load title."); |
|
176 return; |
|
177 } |
164 title->addWidget(mTitleAnim); |
178 title->addWidget(mTitleAnim); |
165 |
179 |
|
180 // Load delete action. |
166 HbAction* deleteAction = findObject<HbAction>(VIDEO_DETAILS_MENUACTION_DELETE); |
181 HbAction* deleteAction = findObject<HbAction>(VIDEO_DETAILS_MENUACTION_DELETE); |
|
182 if(!deleteAction) |
|
183 { |
|
184 ERROR(-1, "VideoFileDetailsViewPlugin::createView() failed to delete action."); |
|
185 return; |
|
186 } |
167 |
187 |
168 if (mIsService) |
188 if (mIsService) |
169 { |
189 { |
170 deleteAction->setVisible(false); |
190 deleteAction->setVisible(false); |
171 } |
191 } |
252 { |
279 { |
253 mVideoServices = VideoServices::instance(); |
280 mVideoServices = VideoServices::instance(); |
254 |
281 |
255 if (!mVideoServices) |
282 if (!mVideoServices) |
256 { |
283 { |
|
284 ERROR(-1, "VideoFileDetailsViewPlugin::activateView() failed to get video services instance."); |
257 return; |
285 return; |
258 } |
286 } |
259 } |
287 } |
260 |
288 |
261 HbPushButton* button = findWidget<HbPushButton>(VIDEO_DETAILS_BUTTON); |
289 VideoServices::TVideoService service = VideoServices::ENoService; |
262 |
|
263 if (mIsService && mVideoServices) |
290 if (mIsService && mVideoServices) |
264 { |
291 { |
265 button->setText(tr("Attach")); //localisation |
292 service = mVideoServices->currentService(); |
266 |
293 |
267 connect(button, SIGNAL(clicked(bool)), this, SLOT(getFileUri())); |
|
268 connect(this, SIGNAL(fileUri(const QString&)), mVideoServices, SLOT(itemSelected(const QString&))); |
|
269 |
|
270 HbMainWindow *mainWnd = hbInstance->allMainWindows().value(0); |
294 HbMainWindow *mainWnd = hbInstance->allMainWindows().value(0); |
271 |
|
272 mainWnd->currentView()->setTitle(mVideoServices->contextTitle()); |
295 mainWnd->currentView()->setTitle(mVideoServices->contextTitle()); |
273 } |
296 } |
274 else if(!mIsService) |
297 |
275 { |
298 HbPushButton* button = findWidget<HbPushButton>(VIDEO_DETAILS_BUTTON); |
|
299 if(!button) |
|
300 { |
|
301 ERROR(-1, "VideoFileDetailsViewPlugin::activateView() failed to load details button."); |
|
302 return; |
|
303 } |
|
304 |
|
305 if (service == VideoServices::EUriFetcher) |
|
306 { |
|
307 button->setText(hbTrId("txt_videos_button_attach")); |
|
308 |
|
309 connect(button, SIGNAL(clicked(bool)), this, SLOT(getFileUri())); |
|
310 connect(this, SIGNAL(fileUri(const QString&)), mVideoServices, SLOT(itemSelected(const QString&))); |
|
311 } |
|
312 else |
|
313 { |
276 connect(button, SIGNAL(clicked(bool)), this, SLOT(sendVideoSlot())); |
314 connect(button, SIGNAL(clicked(bool)), this, SLOT(sendVideoSlot())); |
277 button->setText(hbTrId("txt_videos_opt_share")); |
315 button->setText(hbTrId("txt_videos_opt_share")); |
278 } |
316 } |
279 |
317 |
280 connect(mainWnd, |
318 connect(mainWnd, |
340 } |
379 } |
341 else |
380 else |
342 { |
381 { |
343 disconnect(button, SIGNAL(clicked(bool)), this, SLOT(sendVideoSlot())); |
382 disconnect(button, SIGNAL(clicked(bool)), this, SLOT(sendVideoSlot())); |
344 } |
383 } |
345 |
|
346 } |
384 } |
347 } |
385 } |
348 |
386 |
349 // --------------------------------------------------------------------------- |
387 // --------------------------------------------------------------------------- |
350 // Get view |
388 // Get view |
351 // --------------------------------------------------------------------------- |
389 // --------------------------------------------------------------------------- |
352 // |
390 // |
353 QGraphicsWidget* VideoFileDetailsViewPlugin::getView() |
391 QGraphicsWidget* VideoFileDetailsViewPlugin::getView() |
354 { |
392 { |
|
393 FUNC_LOG; |
355 return mLoader.findWidget(VIDEO_DETAILS_VIEW); |
394 return mLoader.findWidget(VIDEO_DETAILS_VIEW); |
356 } |
395 } |
357 |
396 |
358 // --------------------------------------------------------------------------- |
397 // --------------------------------------------------------------------------- |
359 // Slot: Orientation change |
398 // Slot: Orientation change |
360 // --------------------------------------------------------------------------- |
399 // --------------------------------------------------------------------------- |
361 // |
400 // |
362 void VideoFileDetailsViewPlugin::orientationChange( Qt::Orientation orientation ) |
401 void VideoFileDetailsViewPlugin::orientationChange( Qt::Orientation orientation ) |
363 { |
402 { |
364 if ( orientation == Qt::Vertical ) |
403 FUNC_LOG; |
|
404 if (orientation == Qt::Vertical) |
365 { |
405 { |
366 mLoader.load(VIDEO_DETAILS_DOCML, VIDEO_DETAILS_PORTRAIT); |
406 mLoader.load(VIDEO_DETAILS_DOCML, VIDEO_DETAILS_PORTRAIT); |
367 } |
407 } |
368 |
408 |
369 else if ( orientation == Qt::Horizontal ) |
409 else if (orientation == Qt::Horizontal) |
370 { |
410 { |
371 mLoader.load(VIDEO_DETAILS_DOCML, VIDEO_DETAILS_LANDSCAPE); |
411 mLoader.load(VIDEO_DETAILS_DOCML, VIDEO_DETAILS_LANDSCAPE); |
372 } |
412 } |
373 mTitleAnim->adjustSize(); |
413 mTitleAnim->adjustSize(); |
374 mTitleAnim->startAnimation(); |
414 mTitleAnim->startAnimation(); |
390 // Slot: shortDetailsReadySlot |
431 // Slot: shortDetailsReadySlot |
391 // --------------------------------------------------------------------------- |
432 // --------------------------------------------------------------------------- |
392 // |
433 // |
393 void VideoFileDetailsViewPlugin::shortDetailsReadySlot(TMPXItemId id) |
434 void VideoFileDetailsViewPlugin::shortDetailsReadySlot(TMPXItemId id) |
394 { |
435 { |
|
436 FUNC_LOG; |
395 // first clear all details, so that the view doesn't display the old data. |
437 // first clear all details, so that the view doesn't display the old data. |
396 findWidget<HbListWidget>(VIDEO_DETAILS_LISTWIDGET)->clear(); |
438 findWidget<HbListWidget>(VIDEO_DETAILS_LISTWIDGET)->clear(); |
397 |
439 |
398 QModelIndex modelIndex = mModel->indexOfId(id); |
440 QModelIndex modelIndex = mModel->indexOfId(id); |
399 |
441 |
400 mVideoId = id; |
442 mVideoId = id; |
401 |
443 |
402 QVariant variant = mModel->data(modelIndex, Qt::DisplayRole); |
444 QVariant variant = mModel->data(modelIndex, VideoCollectionCommon::KeyTitle); |
403 |
445 |
404 if (variant.isValid() && mTitleAnim) |
446 if (variant.isValid() && mTitleAnim) |
405 { |
447 { |
406 mTitleAnim->setText(variant.toStringList().first()); |
448 mTitleAnim->setText(variant.toString()); |
407 } |
449 } |
408 startFetchingThumbnail(); |
450 startFetchingThumbnail(); |
409 } |
451 } |
410 |
452 |
411 // --------------------------------------------------------------------------- |
453 // --------------------------------------------------------------------------- |
412 // Slot: fullDetailsReadySlot |
454 // Slot: fullDetailsReadySlot |
413 // --------------------------------------------------------------------------- |
455 // --------------------------------------------------------------------------- |
414 // |
456 // |
415 void VideoFileDetailsViewPlugin::fullDetailsReadySlot(TMPXItemId id) |
457 void VideoFileDetailsViewPlugin::fullDetailsReadySlot(QVariant& variant) |
416 { |
458 { |
|
459 FUNC_LOG; |
417 using namespace VideoCollectionCommon; |
460 using namespace VideoCollectionCommon; |
418 |
461 |
419 int detailCount = sizeof(VideoDetailLabelKeys) / sizeof(int); |
462 int detailCount = sizeof(VideoDetailLabelKeys) / sizeof(int); |
420 |
463 |
421 QModelIndex modelIndex = mModel->indexOfId(id); |
|
422 |
|
423 QVariant variant = mModel->data(modelIndex, KeyMetaData); |
|
424 |
|
425 QMap<QString, QVariant> metadata = variant.toMap(); |
464 QMap<QString, QVariant> metadata = variant.toMap(); |
426 |
465 |
427 HbListWidget* list = findWidget<HbListWidget>(VIDEO_DETAILS_LISTWIDGET); |
466 HbListWidget* list = findWidget<HbListWidget>(VIDEO_DETAILS_LISTWIDGET); |
428 |
467 if(!list) |
|
468 { |
|
469 ERROR(-1, "VideoFileDetailsViewPlugin::activateView() failed to load details list widget."); |
|
470 return; |
|
471 } |
|
472 |
429 if(list->count()) |
473 if(list->count()) |
430 { |
474 { |
431 list->clear(); |
475 list->clear(); |
432 } |
476 } |
433 |
477 |
485 // Slot: sendVideo |
531 // Slot: sendVideo |
486 // --------------------------------------------------------------------------- |
532 // --------------------------------------------------------------------------- |
487 // |
533 // |
488 void VideoFileDetailsViewPlugin::sendVideoSlot() |
534 void VideoFileDetailsViewPlugin::sendVideoSlot() |
489 { |
535 { |
490 _DebugNotImplementedYet(); |
536 FUNC_LOG; |
|
537 HbMessageBox::information(tr("Not implemented yet")); |
|
538 |
|
539 /* if(mVideoId != TMPXItemId::InvalidId()) |
|
540 { |
|
541 ShareUi dialog; |
|
542 QModelIndex modelIndex = mModel->indexOfId(mVideoId); |
|
543 QVariant variant = mModel->data(modelIndex, VideoCollectionCommon::KeyFilePath); |
|
544 if(variant.isValid()) |
|
545 { |
|
546 QStringList fileList; |
|
547 fileList.append(variant.toString()); |
|
548 dialog.send(fileList, true); |
|
549 } |
|
550 }*/ |
491 } |
551 } |
492 |
552 |
493 // --------------------------------------------------------------------------- |
553 // --------------------------------------------------------------------------- |
494 // Slot: deleteVideo |
554 // Slot: deleteVideo |
495 // --------------------------------------------------------------------------- |
555 // --------------------------------------------------------------------------- |
496 // |
556 // |
497 void VideoFileDetailsViewPlugin::deleteVideoSlot() |
557 void VideoFileDetailsViewPlugin::deleteVideoSlot() |
498 { |
558 { |
|
559 FUNC_LOG; |
499 if (mVideoId != TMPXItemId::InvalidId()) |
560 if (mVideoId != TMPXItemId::InvalidId()) |
500 { |
561 { |
501 QModelIndex modelIndex = mModel->indexOfId(mVideoId); |
562 QModelIndex modelIndex = mModel->indexOfId(mVideoId); |
502 QVariant variant = mModel->data(modelIndex, Qt::DisplayRole); |
563 QVariant variant = mModel->data(modelIndex, VideoCollectionCommon::KeyTitle); |
503 |
564 |
504 if (variant.isValid()) |
565 if (variant.isValid()) |
505 { |
566 { |
506 QString text = hbTrId("txt_videos_info_do_you_want_to_delete_1").arg( |
567 QString text = hbTrId("txt_videos_info_do_you_want_to_delete_1").arg( |
507 variant.toStringList().first()); |
568 variant.toString()); |
508 |
569 |
509 if (HbMessageBox::question(text)) |
570 if (HbMessageBox::question(text)) |
510 { |
571 { |
511 deleteItem(modelIndex); |
572 deleteItem(modelIndex); |
512 } |
573 } |
629 HbIcon compsedIcon(QPixmap::fromImage(resultImage)); |
694 HbIcon compsedIcon(QPixmap::fromImage(resultImage)); |
630 mThumbLabel->setIcon(compsedIcon); |
695 mThumbLabel->setIcon(compsedIcon); |
631 } |
696 } |
632 else |
697 else |
633 { |
698 { |
|
699 ERROR(errorCode, "VideoFileDetailsViewPlugin::thumbnailReadySlot() tbn fetch failed."); |
634 mThumbLabel->setIcon(HbIcon(VIDEO_DETAILS_GFX_DEFAULT)); |
700 mThumbLabel->setIcon(HbIcon(VIDEO_DETAILS_GFX_DEFAULT)); |
635 } |
701 } |
636 } |
702 } |
637 |
703 |
638 // --------------------------------------------------------------------------- |
704 // --------------------------------------------------------------------------- |
639 // startFetchingThumbnail |
705 // startFetchingThumbnail |
640 // --------------------------------------------------------------------------- |
706 // --------------------------------------------------------------------------- |
641 // |
707 // |
642 void VideoFileDetailsViewPlugin::startFetchingThumbnail() |
708 void VideoFileDetailsViewPlugin::startFetchingThumbnail() |
643 { |
709 { |
|
710 FUNC_LOG; |
644 int tnId = -1; |
711 int tnId = -1; |
645 |
712 |
646 if(mModel && mThumbnailManager) |
713 if(mModel && mThumbnailManager) |
647 { |
714 { |
648 QModelIndex modelIndex = mModel->indexOfId(mVideoId); |
715 QModelIndex modelIndex = mModel->indexOfId(mVideoId); |
651 { |
718 { |
652 mThumbnailManager->setThumbnailSize(ThumbnailManager::ThumbnailLarge); |
719 mThumbnailManager->setThumbnailSize(ThumbnailManager::ThumbnailLarge); |
653 tnId = mThumbnailManager->getThumbnail(variant.toString(), 0, 5000); |
720 tnId = mThumbnailManager->getThumbnail(variant.toString(), 0, 5000); |
654 } |
721 } |
655 } |
722 } |
656 else |
|
657 { |
|
658 qWarning() << "Tried to start fetching thumbnail when either mModel or mThumbnailManager is NULL!"; |
|
659 } |
|
660 |
723 |
661 if(tnId == -1) |
724 if(tnId == -1) |
662 { |
725 { |
|
726 ERROR(-1, "VideoFileDetailsViewPlugin::startFetchingThumbnail() starting the fetch failed."); |
663 mThumbLabel->setIcon(HbIcon(VIDEO_DETAILS_GFX_DEFAULT)); |
727 mThumbLabel->setIcon(HbIcon(VIDEO_DETAILS_GFX_DEFAULT)); |
664 } |
728 } |
665 } |
729 } |
666 |
730 |
667 // --------------------------------------------------------------------------- |
731 // --------------------------------------------------------------------------- |
668 // playIcon |
732 // playIcon |
669 // --------------------------------------------------------------------------- |
733 // --------------------------------------------------------------------------- |
670 // |
734 // |
671 const QPixmap &VideoFileDetailsViewPlugin::playIcon() |
735 const QPixmap &VideoFileDetailsViewPlugin::playIcon() |
672 { |
736 { |
|
737 FUNC_LOG; |
673 // Check if we have already the icon. |
738 // Check if we have already the icon. |
674 if(!mPlayIcon.isNull()) |
739 if(!mPlayIcon.isNull()) |
675 { |
740 { |
676 return mPlayIcon; |
741 return mPlayIcon; |
677 } |
742 } |