--- a/inc/videoservices.h Fri Jul 23 11:10:06 2010 +0300
+++ b/inc/videoservices.h Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 6 %
+// Version : %version: 7 %
#ifndef __VIDEOSERVICES_H__
#define __VIDEOSERVICES_H__
@@ -29,6 +29,7 @@
class VideoServiceView;
class VideoServiceBrowse;
class VideoPlayerEngine;
+class VideoServiceUri;
class VIDEOPLAYERAPP_DLL_EXPORT VideoServices : public QObject
{
@@ -70,6 +71,7 @@
EUriFetcher,
EPlayback,
EView,
+ EUriView,
EBrowse
};
@@ -209,6 +211,11 @@
* Deprecated VideoServiceBrowse service instance.
*/
VideoServiceBrowse *mServiceBrowseDeprecatedOldService;
+
+ /**
+ * VideoServiceUri service instance.
+ */
+ VideoServiceUri *mServiceUriView;
/**
* Pointer of VideoPlayerEngine.
@@ -223,8 +230,9 @@
friend class VideoServiceUriFetch;
friend class VideoServicePlay;
friend class VideoServiceView;
- friend class VideoServiceBrowse;
-
+ friend class VideoServiceBrowse;
+ friend class VideoServiceUri;
+
public:
/*
--- a/videocollection/bwins/videocollectionwrapperu.def Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/bwins/videocollectionwrapperu.def Fri Aug 06 09:43:48 2010 +0300
@@ -1,78 +1,78 @@
EXPORTS
- ?getThumbnail@VideoThumbnailData@@QAEPBVQIcon@@VTMPXItemId@@@Z @ 1 NONAME ; class QIcon const * VideoThumbnailData::getThumbnail(class TMPXItemId)
- ?sendAsyncStatus@VideoCollectionWrapper@@QAEXHAAVQVariant@@@Z @ 2 NONAME ; void VideoCollectionWrapper::sendAsyncStatus(int, class QVariant &)
- ??1VideoSortFilterProxyModel@@UAE@XZ @ 3 NONAME ; VideoSortFilterProxyModel::~VideoSortFilterProxyModel(void)
- ?removeThumbnail@VideoThumbnailData@@QAE_NVTMPXItemId@@@Z @ 4 NONAME ; bool VideoThumbnailData::removeThumbnail(class TMPXItemId)
- ?open@VideoSortFilterProxyModel@@QAEHW4TCollectionLevels@VideoCollectionCommon@@@Z @ 5 NONAME ; int VideoSortFilterProxyModel::open(enum VideoCollectionCommon::TCollectionLevels)
- ?deleteItems@VideoSortFilterProxyModel@@QAEHABV?$QList@VQModelIndex@@@@@Z @ 6 NONAME ; int VideoSortFilterProxyModel::deleteItems(class QList<class QModelIndex> const &)
- ?trUtf8@VideoThumbnailData@@SA?AVQString@@PBD0@Z @ 7 NONAME ; class QString VideoThumbnailData::trUtf8(char const *, char const *)
- ?removeItemsFromAlbum@VideoSortFilterProxyModel@@QAEHAAVTMPXItemId@@ABV?$QList@VTMPXItemId@@@@@Z @ 8 NONAME ; int VideoSortFilterProxyModel::removeItemsFromAlbum(class TMPXItemId &, class QList<class TMPXItemId> const &)
- ?instance@VideoCollectionWrapper@@SAAAV1@XZ @ 9 NONAME ; class VideoCollectionWrapper & VideoCollectionWrapper::instance(void)
- ?back@VideoSortFilterProxyModel@@QAEHXZ @ 10 NONAME ; int VideoSortFilterProxyModel::back(void)
- ?modelReady@VideoSortFilterProxyModel@@IAEXXZ @ 11 NONAME ; void VideoSortFilterProxyModel::modelReady(void)
- ?albumChangedSlot@VideoSortFilterProxyModel@@AAEXXZ @ 12 NONAME ; void VideoSortFilterProxyModel::albumChangedSlot(void)
- ?qt_metacall@VideoThumbnailData@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 13 NONAME ; int VideoThumbnailData::qt_metacall(enum QMetaObject::Call, int, void * *)
- ??1VideoThumbnailData@@EAE@XZ @ 14 NONAME ; VideoThumbnailData::~VideoThumbnailData(void)
- ??_EVideoThumbnailData@@UAE@I@Z @ 15 NONAME ; VideoThumbnailData::~VideoThumbnailData(unsigned int)
- ?getMediaFilePathForId@VideoSortFilterProxyModel@@QAE?AVQString@@VTMPXItemId@@@Z @ 16 NONAME ; class QString VideoSortFilterProxyModel::getMediaFilePathForId(class TMPXItemId)
- ?setAlbumInUse@VideoSortFilterProxyModel@@QAEXVTMPXItemId@@@Z @ 17 NONAME ; void VideoSortFilterProxyModel::setAlbumInUse(class TMPXItemId)
- ?qt_metacast@VideoCollectionWrapper@@UAEPAXPBD@Z @ 18 NONAME ; void * VideoCollectionWrapper::qt_metacast(char const *)
- ?addItemsInAlbum@VideoSortFilterProxyModel@@QAEHAAVTMPXItemId@@ABV?$QList@VTMPXItemId@@@@@Z @ 19 NONAME ; int VideoSortFilterProxyModel::addItemsInAlbum(class TMPXItemId &, class QList<class TMPXItemId> const &)
- ?tr@VideoSortFilterProxyModel@@SA?AVQString@@PBD0H@Z @ 20 NONAME ; class QString VideoSortFilterProxyModel::tr(char const *, char const *, int)
- ?removeAlbums@VideoSortFilterProxyModel@@QAEHABV?$QList@VQModelIndex@@@@@Z @ 21 NONAME ; int VideoSortFilterProxyModel::removeAlbums(class QList<class QModelIndex> const &)
- ?instance@VideoThumbnailData@@SAAAV1@XZ @ 22 NONAME ; class VideoThumbnailData & VideoThumbnailData::instance(void)
- ?getType@VideoSortFilterProxyModel@@QAE?AW4TModelType@VideoCollectionCommon@@XZ @ 23 NONAME ; enum VideoCollectionCommon::TModelType VideoSortFilterProxyModel::getType(void)
- ?fetchItemDetails@VideoSortFilterProxyModel@@QAEHABVQModelIndex@@@Z @ 24 NONAME ; int VideoSortFilterProxyModel::fetchItemDetails(class QModelIndex const &)
- ??0VideoCollectionWrapper@@AAE@XZ @ 25 NONAME ; VideoCollectionWrapper::VideoCollectionWrapper(void)
- ?metaObject@VideoSortFilterProxyModel@@UBEPBUQMetaObject@@XZ @ 26 NONAME ; struct QMetaObject const * VideoSortFilterProxyModel::metaObject(void) const
- ?metaObject@VideoCollectionWrapper@@UBEPBUQMetaObject@@XZ @ 27 NONAME ; struct QMetaObject const * VideoCollectionWrapper::metaObject(void) const
- ?lessThan@VideoSortFilterProxyModel@@MBE_NABVQModelIndex@@0@Z @ 28 NONAME ; bool VideoSortFilterProxyModel::lessThan(class QModelIndex const &, class QModelIndex const &) const
- ?getStaticMetaObject@VideoCollectionWrapper@@SAABUQMetaObject@@XZ @ 29 NONAME ; struct QMetaObject const & VideoCollectionWrapper::getStaticMetaObject(void)
- ?indexOfId@VideoSortFilterProxyModel@@QAE?AVQModelIndex@@VTMPXItemId@@@Z @ 30 NONAME ; class QModelIndex VideoSortFilterProxyModel::indexOfId(class TMPXItemId)
- ?getStaticMetaObject@VideoSortFilterProxyModel@@SAABUQMetaObject@@XZ @ 31 NONAME ; struct QMetaObject const & VideoSortFilterProxyModel::getStaticMetaObject(void)
- ?trUtf8@VideoSortFilterProxyModel@@SA?AVQString@@PBD0@Z @ 32 NONAME ; class QString VideoSortFilterProxyModel::trUtf8(char const *, char const *)
- ?doSorting@VideoSortFilterProxyModel@@QAEXHW4SortOrder@Qt@@_N@Z @ 33 NONAME ; void VideoSortFilterProxyModel::doSorting(int, enum Qt::SortOrder, bool)
- ?getOpenItem@VideoSortFilterProxyModel@@QBE?AVTMPXItemId@@XZ @ 34 NONAME ; class TMPXItemId VideoSortFilterProxyModel::getOpenItem(void) const
- ?startBackgroundFetching@VideoThumbnailData@@QAEXPAVVideoSortFilterProxyModel@@H@Z @ 35 NONAME ; void VideoThumbnailData::startBackgroundFetching(class VideoSortFilterProxyModel *, int)
- ??_EVideoCollectionWrapper@@UAE@I@Z @ 36 NONAME ; VideoCollectionWrapper::~VideoCollectionWrapper(unsigned int)
- ?resolveAlbumName@VideoSortFilterProxyModel@@QBE?AVQString@@ABV2@@Z @ 37 NONAME ; class QString VideoSortFilterProxyModel::resolveAlbumName(class QString const &) const
- ?setGenericIdFilter@VideoSortFilterProxyModel@@QAEXVTMPXItemId@@_N@Z @ 38 NONAME ; void VideoSortFilterProxyModel::setGenericIdFilter(class TMPXItemId, bool)
- ?getStaticMetaObject@VideoThumbnailData@@SAABUQMetaObject@@XZ @ 39 NONAME ; struct QMetaObject const & VideoThumbnailData::getStaticMetaObject(void)
- ?qt_metacall@VideoCollectionWrapper@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 40 NONAME ; int VideoCollectionWrapper::qt_metacall(enum QMetaObject::Call, int, void * *)
- ?trUtf8@VideoThumbnailData@@SA?AVQString@@PBD0H@Z @ 41 NONAME ; class QString VideoThumbnailData::trUtf8(char const *, char const *, int)
- ?enableBackgroundFetching@VideoThumbnailData@@QAEX_N@Z @ 42 NONAME ; void VideoThumbnailData::enableBackgroundFetching(bool)
- ?getMediaIdAtIndex@VideoSortFilterProxyModel@@QBE?AVTMPXItemId@@ABVQModelIndex@@@Z @ 43 NONAME ; class TMPXItemId VideoSortFilterProxyModel::getMediaIdAtIndex(class QModelIndex const &) const
- ?renameAlbum@VideoSortFilterProxyModel@@QAEHABVTMPXItemId@@ABVQString@@@Z @ 44 NONAME ; int VideoSortFilterProxyModel::renameAlbum(class TMPXItemId const &, class QString const &)
- ?connectSignals@VideoSortFilterProxyModel@@AAE_NXZ @ 45 NONAME ; bool VideoSortFilterProxyModel::connectSignals(void)
- ?getModel@VideoCollectionWrapper@@QAEPAVVideoSortFilterProxyModel@@W4TModelType@VideoCollectionCommon@@@Z @ 46 NONAME ; class VideoSortFilterProxyModel * VideoCollectionWrapper::getModel(enum VideoCollectionCommon::TModelType)
- ?tr@VideoCollectionWrapper@@SA?AVQString@@PBD0H@Z @ 47 NONAME ; class QString VideoCollectionWrapper::tr(char const *, char const *, int)
- ?staticMetaObject@VideoSortFilterProxyModel@@2UQMetaObject@@B @ 48 NONAME ; struct QMetaObject const VideoSortFilterProxyModel::staticMetaObject
- ?tr@VideoSortFilterProxyModel@@SA?AVQString@@PBD0@Z @ 49 NONAME ; class QString VideoSortFilterProxyModel::tr(char const *, char const *)
- ?asyncStatus@VideoCollectionWrapper@@IAEXHAAVQVariant@@@Z @ 50 NONAME ; void VideoCollectionWrapper::asyncStatus(int, class QVariant &)
- ?initialize@VideoSortFilterProxyModel@@QAEHPAVVideoListDataModel@@@Z @ 51 NONAME ; int VideoSortFilterProxyModel::initialize(class VideoListDataModel *)
- ?modelChanged@VideoSortFilterProxyModel@@IAEXXZ @ 52 NONAME ; void VideoSortFilterProxyModel::modelChanged(void)
- ?itemModifiedSlot@VideoSortFilterProxyModel@@AAEXABVTMPXItemId@@@Z @ 53 NONAME ; void VideoSortFilterProxyModel::itemModifiedSlot(class TMPXItemId const &)
- ?thumbnailsFetched@VideoThumbnailData@@IAEXV?$QList@VTMPXItemId@@@@@Z @ 54 NONAME ; void VideoThumbnailData::thumbnailsFetched(class QList<class TMPXItemId>)
- ?trUtf8@VideoCollectionWrapper@@SA?AVQString@@PBD0@Z @ 55 NONAME ; class QString VideoCollectionWrapper::trUtf8(char const *, char const *)
- ?processSorting@VideoSortFilterProxyModel@@AAEXXZ @ 56 NONAME ; void VideoSortFilterProxyModel::processSorting(void)
- ?getSorting@VideoSortFilterProxyModel@@QAEXAAHAAW4SortOrder@Qt@@@Z @ 57 NONAME ; void VideoSortFilterProxyModel::getSorting(int &, enum Qt::SortOrder &)
- ?filterAcceptsRow@VideoSortFilterProxyModel@@MBE_NHABVQModelIndex@@@Z @ 58 NONAME ; bool VideoSortFilterProxyModel::filterAcceptsRow(int, class QModelIndex const &) const
- ?metaObject@VideoThumbnailData@@UBEPBUQMetaObject@@XZ @ 59 NONAME ; struct QMetaObject const * VideoThumbnailData::metaObject(void) const
- ?tr@VideoThumbnailData@@SA?AVQString@@PBD0H@Z @ 60 NONAME ; class QString VideoThumbnailData::tr(char const *, char const *, int)
- ?disconnectSignals@VideoSortFilterProxyModel@@AAEXXZ @ 61 NONAME ; void VideoSortFilterProxyModel::disconnectSignals(void)
- ?trUtf8@VideoSortFilterProxyModel@@SA?AVQString@@PBD0H@Z @ 62 NONAME ; class QString VideoSortFilterProxyModel::trUtf8(char const *, char const *, int)
- ?openItem@VideoSortFilterProxyModel@@QAEHVTMPXItemId@@@Z @ 63 NONAME ; int VideoSortFilterProxyModel::openItem(class TMPXItemId)
- ?qt_metacast@VideoThumbnailData@@UAEPAXPBD@Z @ 64 NONAME ; void * VideoThumbnailData::qt_metacast(char const *)
- ?tr@VideoCollectionWrapper@@SA?AVQString@@PBD0@Z @ 65 NONAME ; class QString VideoCollectionWrapper::tr(char const *, char const *)
- ??_EVideoSortFilterProxyModel@@UAE@I@Z @ 66 NONAME ; VideoSortFilterProxyModel::~VideoSortFilterProxyModel(unsigned int)
- ??0VideoSortFilterProxyModel@@QAE@W4TModelType@VideoCollectionCommon@@PAVQObject@@@Z @ 67 NONAME ; VideoSortFilterProxyModel::VideoSortFilterProxyModel(enum VideoCollectionCommon::TModelType, class QObject *)
- ?addNewAlbum@VideoSortFilterProxyModel@@QAE?AVTMPXItemId@@ABVQString@@@Z @ 68 NONAME ; class TMPXItemId VideoSortFilterProxyModel::addNewAlbum(class QString const &)
- ?enableThumbnailCreation@VideoThumbnailData@@QAEX_N@Z @ 69 NONAME ; void VideoThumbnailData::enableThumbnailCreation(bool)
- ?qt_metacall@VideoSortFilterProxyModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 70 NONAME ; int VideoSortFilterProxyModel::qt_metacall(enum QMetaObject::Call, int, void * *)
- ?freeThumbnailData@VideoThumbnailData@@QAEXXZ @ 71 NONAME ; void VideoThumbnailData::freeThumbnailData(void)
- ?shortDetailsReady@VideoSortFilterProxyModel@@IAEXVTMPXItemId@@@Z @ 72 NONAME ; void VideoSortFilterProxyModel::shortDetailsReady(class TMPXItemId)
- ?qt_metacast@VideoSortFilterProxyModel@@UAEPAXPBD@Z @ 73 NONAME ; void * VideoSortFilterProxyModel::qt_metacast(char const *)
- ?staticMetaObject@VideoCollectionWrapper@@2UQMetaObject@@B @ 74 NONAME ; struct QMetaObject const VideoCollectionWrapper::staticMetaObject
+ ?sendAsyncStatus@VideoCollectionWrapper@@QAEXHAAVQVariant@@@Z @ 1 NONAME ; void VideoCollectionWrapper::sendAsyncStatus(int, class QVariant &)
+ ??1VideoSortFilterProxyModel@@UAE@XZ @ 2 NONAME ; VideoSortFilterProxyModel::~VideoSortFilterProxyModel(void)
+ ?open@VideoSortFilterProxyModel@@QAEHW4TCollectionLevels@VideoCollectionCommon@@@Z @ 3 NONAME ; int VideoSortFilterProxyModel::open(enum VideoCollectionCommon::TCollectionLevels)
+ ?deleteItems@VideoSortFilterProxyModel@@QAEHABV?$QList@VQModelIndex@@@@@Z @ 4 NONAME ; int VideoSortFilterProxyModel::deleteItems(class QList<class QModelIndex> const &)
+ ?trUtf8@VideoThumbnailData@@SA?AVQString@@PBD0@Z @ 5 NONAME ; class QString VideoThumbnailData::trUtf8(char const *, char const *)
+ ?removeItemsFromAlbum@VideoSortFilterProxyModel@@QAEHAAVTMPXItemId@@ABV?$QList@VTMPXItemId@@@@@Z @ 6 NONAME ; int VideoSortFilterProxyModel::removeItemsFromAlbum(class TMPXItemId &, class QList<class TMPXItemId> const &)
+ ?instance@VideoCollectionWrapper@@SAAAV1@XZ @ 7 NONAME ; class VideoCollectionWrapper & VideoCollectionWrapper::instance(void)
+ ?back@VideoSortFilterProxyModel@@QAEHXZ @ 8 NONAME ; int VideoSortFilterProxyModel::back(void)
+ ?modelReady@VideoSortFilterProxyModel@@IAEXXZ @ 9 NONAME ; void VideoSortFilterProxyModel::modelReady(void)
+ ?albumChangedSlot@VideoSortFilterProxyModel@@AAEXXZ @ 10 NONAME ; void VideoSortFilterProxyModel::albumChangedSlot(void)
+ ?qt_metacall@VideoThumbnailData@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 11 NONAME ; int VideoThumbnailData::qt_metacall(enum QMetaObject::Call, int, void * *)
+ ?backgroundFetchingEnabled@VideoThumbnailData@@QAE_NXZ @ 12 NONAME ; bool VideoThumbnailData::backgroundFetchingEnabled(void)
+ ??1VideoThumbnailData@@EAE@XZ @ 13 NONAME ; VideoThumbnailData::~VideoThumbnailData(void)
+ ??_EVideoThumbnailData@@UAE@I@Z @ 14 NONAME ; VideoThumbnailData::~VideoThumbnailData(unsigned int)
+ ?qt_metacast@VideoCollectionWrapper@@UAEPAXPBD@Z @ 15 NONAME ; void * VideoCollectionWrapper::qt_metacast(char const *)
+ ?addItemsInAlbum@VideoSortFilterProxyModel@@QAEHAAVTMPXItemId@@ABV?$QList@VTMPXItemId@@@@@Z @ 16 NONAME ; int VideoSortFilterProxyModel::addItemsInAlbum(class TMPXItemId &, class QList<class TMPXItemId> const &)
+ ?tr@VideoSortFilterProxyModel@@SA?AVQString@@PBD0H@Z @ 17 NONAME ; class QString VideoSortFilterProxyModel::tr(char const *, char const *, int)
+ ?getMediaIdAtIndex@VideoSortFilterProxyModel@@QBEABVTMPXItemId@@ABVQModelIndex@@@Z @ 18 NONAME ; class TMPXItemId const & VideoSortFilterProxyModel::getMediaIdAtIndex(class QModelIndex const &) const
+ ?removeAlbums@VideoSortFilterProxyModel@@QAEHABV?$QList@VQModelIndex@@@@@Z @ 19 NONAME ; int VideoSortFilterProxyModel::removeAlbums(class QList<class QModelIndex> const &)
+ ?instance@VideoThumbnailData@@SAAAV1@XZ @ 20 NONAME ; class VideoThumbnailData & VideoThumbnailData::instance(void)
+ ?getType@VideoSortFilterProxyModel@@QAE?AW4TModelType@VideoCollectionCommon@@XZ @ 21 NONAME ; enum VideoCollectionCommon::TModelType VideoSortFilterProxyModel::getType(void)
+ ?fetchItemDetails@VideoSortFilterProxyModel@@QAEHABVQModelIndex@@@Z @ 22 NONAME ; int VideoSortFilterProxyModel::fetchItemDetails(class QModelIndex const &)
+ ??0VideoCollectionWrapper@@AAE@XZ @ 23 NONAME ; VideoCollectionWrapper::VideoCollectionWrapper(void)
+ ?metaObject@VideoSortFilterProxyModel@@UBEPBUQMetaObject@@XZ @ 24 NONAME ; struct QMetaObject const * VideoSortFilterProxyModel::metaObject(void) const
+ ?metaObject@VideoCollectionWrapper@@UBEPBUQMetaObject@@XZ @ 25 NONAME ; struct QMetaObject const * VideoCollectionWrapper::metaObject(void) const
+ ?lessThan@VideoSortFilterProxyModel@@MBE_NABVQModelIndex@@0@Z @ 26 NONAME ; bool VideoSortFilterProxyModel::lessThan(class QModelIndex const &, class QModelIndex const &) const
+ ?getStaticMetaObject@VideoCollectionWrapper@@SAABUQMetaObject@@XZ @ 27 NONAME ; struct QMetaObject const & VideoCollectionWrapper::getStaticMetaObject(void)
+ ?getStaticMetaObject@VideoSortFilterProxyModel@@SAABUQMetaObject@@XZ @ 28 NONAME ; struct QMetaObject const & VideoSortFilterProxyModel::getStaticMetaObject(void)
+ ?trUtf8@VideoSortFilterProxyModel@@SA?AVQString@@PBD0@Z @ 29 NONAME ; class QString VideoSortFilterProxyModel::trUtf8(char const *, char const *)
+ ?doSorting@VideoSortFilterProxyModel@@QAEXHW4SortOrder@Qt@@_N@Z @ 30 NONAME ; void VideoSortFilterProxyModel::doSorting(int, enum Qt::SortOrder, bool)
+ ?getOpenItem@VideoSortFilterProxyModel@@QBE?AVTMPXItemId@@XZ @ 31 NONAME ; class TMPXItemId VideoSortFilterProxyModel::getOpenItem(void) const
+ ?startBackgroundFetching@VideoThumbnailData@@QAEXPAVVideoSortFilterProxyModel@@H@Z @ 32 NONAME ; void VideoThumbnailData::startBackgroundFetching(class VideoSortFilterProxyModel *, int)
+ ??_EVideoCollectionWrapper@@UAE@I@Z @ 33 NONAME ; VideoCollectionWrapper::~VideoCollectionWrapper(unsigned int)
+ ?resolveAlbumName@VideoSortFilterProxyModel@@QBE?AVQString@@ABV2@@Z @ 34 NONAME ; class QString VideoSortFilterProxyModel::resolveAlbumName(class QString const &) const
+ ?getThumbnail@VideoThumbnailData@@QAEPBVQIcon@@ABVTMPXItemId@@@Z @ 35 NONAME ; class QIcon const * VideoThumbnailData::getThumbnail(class TMPXItemId const &)
+ ?getStaticMetaObject@VideoThumbnailData@@SAABUQMetaObject@@XZ @ 36 NONAME ; struct QMetaObject const & VideoThumbnailData::getStaticMetaObject(void)
+ ?qt_metacall@VideoCollectionWrapper@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 37 NONAME ; int VideoCollectionWrapper::qt_metacall(enum QMetaObject::Call, int, void * *)
+ ?trUtf8@VideoThumbnailData@@SA?AVQString@@PBD0H@Z @ 38 NONAME ; class QString VideoThumbnailData::trUtf8(char const *, char const *, int)
+ ?enableBackgroundFetching@VideoThumbnailData@@QAEX_N@Z @ 39 NONAME ; void VideoThumbnailData::enableBackgroundFetching(bool)
+ ?getMediaFilePathForId@VideoSortFilterProxyModel@@QAE?AVQString@@ABVTMPXItemId@@@Z @ 40 NONAME ; class QString VideoSortFilterProxyModel::getMediaFilePathForId(class TMPXItemId const &)
+ ?connectSignals@VideoSortFilterProxyModel@@AAE_NXZ @ 41 NONAME ; bool VideoSortFilterProxyModel::connectSignals(void)
+ ?getModel@VideoCollectionWrapper@@QAEPAVVideoSortFilterProxyModel@@W4TModelType@VideoCollectionCommon@@@Z @ 42 NONAME ; class VideoSortFilterProxyModel * VideoCollectionWrapper::getModel(enum VideoCollectionCommon::TModelType)
+ ?tr@VideoCollectionWrapper@@SA?AVQString@@PBD0H@Z @ 43 NONAME ; class QString VideoCollectionWrapper::tr(char const *, char const *, int)
+ ?staticMetaObject@VideoSortFilterProxyModel@@2UQMetaObject@@B @ 44 NONAME ; struct QMetaObject const VideoSortFilterProxyModel::staticMetaObject
+ ?tr@VideoSortFilterProxyModel@@SA?AVQString@@PBD0@Z @ 45 NONAME ; class QString VideoSortFilterProxyModel::tr(char const *, char const *)
+ ?asyncStatus@VideoCollectionWrapper@@IAEXHAAVQVariant@@@Z @ 46 NONAME ; void VideoCollectionWrapper::asyncStatus(int, class QVariant &)
+ ?initialize@VideoSortFilterProxyModel@@QAEHPAVVideoListDataModel@@@Z @ 47 NONAME ; int VideoSortFilterProxyModel::initialize(class VideoListDataModel *)
+ ?modelChanged@VideoSortFilterProxyModel@@IAEXXZ @ 48 NONAME ; void VideoSortFilterProxyModel::modelChanged(void)
+ ?removeThumbnail@VideoThumbnailData@@QAE_NABVTMPXItemId@@@Z @ 49 NONAME ; bool VideoThumbnailData::removeThumbnail(class TMPXItemId const &)
+ ?indexOfId@VideoSortFilterProxyModel@@QAE?AVQModelIndex@@ABVTMPXItemId@@@Z @ 50 NONAME ; class QModelIndex VideoSortFilterProxyModel::indexOfId(class TMPXItemId const &)
+ ?setGenericIdFilter@VideoSortFilterProxyModel@@QAEXABVTMPXItemId@@_N@Z @ 51 NONAME ; void VideoSortFilterProxyModel::setGenericIdFilter(class TMPXItemId const &, bool)
+ ?trUtf8@VideoCollectionWrapper@@SA?AVQString@@PBD0@Z @ 52 NONAME ; class QString VideoCollectionWrapper::trUtf8(char const *, char const *)
+ ?thumbnailsFetched@VideoThumbnailData@@IAEXAAV?$QList@VTMPXItemId@@@@@Z @ 53 NONAME ; void VideoThumbnailData::thumbnailsFetched(class QList<class TMPXItemId> &)
+ ?processSorting@VideoSortFilterProxyModel@@AAEXXZ @ 54 NONAME ; void VideoSortFilterProxyModel::processSorting(void)
+ ?getSorting@VideoSortFilterProxyModel@@QAEXAAHAAW4SortOrder@Qt@@@Z @ 55 NONAME ; void VideoSortFilterProxyModel::getSorting(int &, enum Qt::SortOrder &)
+ ?filterAcceptsRow@VideoSortFilterProxyModel@@MBE_NHABVQModelIndex@@@Z @ 56 NONAME ; bool VideoSortFilterProxyModel::filterAcceptsRow(int, class QModelIndex const &) const
+ ?metaObject@VideoThumbnailData@@UBEPBUQMetaObject@@XZ @ 57 NONAME ; struct QMetaObject const * VideoThumbnailData::metaObject(void) const
+ ?tr@VideoThumbnailData@@SA?AVQString@@PBD0H@Z @ 58 NONAME ; class QString VideoThumbnailData::tr(char const *, char const *, int)
+ ?disconnectSignals@VideoSortFilterProxyModel@@AAEXXZ @ 59 NONAME ; void VideoSortFilterProxyModel::disconnectSignals(void)
+ ?trUtf8@VideoSortFilterProxyModel@@SA?AVQString@@PBD0H@Z @ 60 NONAME ; class QString VideoSortFilterProxyModel::trUtf8(char const *, char const *, int)
+ ?openItem@VideoSortFilterProxyModel@@QAEHVTMPXItemId@@@Z @ 61 NONAME ; int VideoSortFilterProxyModel::openItem(class TMPXItemId)
+ ?qt_metacast@VideoThumbnailData@@UAEPAXPBD@Z @ 62 NONAME ; void * VideoThumbnailData::qt_metacast(char const *)
+ ?tr@VideoCollectionWrapper@@SA?AVQString@@PBD0@Z @ 63 NONAME ; class QString VideoCollectionWrapper::tr(char const *, char const *)
+ ??_EVideoSortFilterProxyModel@@UAE@I@Z @ 64 NONAME ; VideoSortFilterProxyModel::~VideoSortFilterProxyModel(unsigned int)
+ ??0VideoSortFilterProxyModel@@QAE@W4TModelType@VideoCollectionCommon@@PAVQObject@@@Z @ 65 NONAME ; VideoSortFilterProxyModel::VideoSortFilterProxyModel(enum VideoCollectionCommon::TModelType, class QObject *)
+ ?addNewAlbum@VideoSortFilterProxyModel@@QAE?AVTMPXItemId@@ABVQString@@@Z @ 66 NONAME ; class TMPXItemId VideoSortFilterProxyModel::addNewAlbum(class QString const &)
+ ?renameItem@VideoSortFilterProxyModel@@QAEHABVTMPXItemId@@ABVQString@@@Z @ 67 NONAME ; int VideoSortFilterProxyModel::renameItem(class TMPXItemId const &, class QString const &)
+ ?enableThumbnailCreation@VideoThumbnailData@@QAEX_N@Z @ 68 NONAME ; void VideoThumbnailData::enableThumbnailCreation(bool)
+ ?qt_metacall@VideoSortFilterProxyModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 69 NONAME ; int VideoSortFilterProxyModel::qt_metacall(enum QMetaObject::Call, int, void * *)
+ ?freeThumbnailData@VideoThumbnailData@@QAEXXZ @ 70 NONAME ; void VideoThumbnailData::freeThumbnailData(void)
+ ?shortDetailsReady@VideoSortFilterProxyModel@@IAEXVTMPXItemId@@@Z @ 71 NONAME ; void VideoSortFilterProxyModel::shortDetailsReady(class TMPXItemId)
+ ?qt_metacast@VideoSortFilterProxyModel@@UAEPAXPBD@Z @ 72 NONAME ; void * VideoSortFilterProxyModel::qt_metacast(char const *)
+ ?staticMetaObject@VideoCollectionWrapper@@2UQMetaObject@@B @ 73 NONAME ; struct QMetaObject const VideoCollectionWrapper::staticMetaObject
+ ?setAlbumInUse@VideoSortFilterProxyModel@@QAEXABVTMPXItemId@@@Z @ 74 NONAME ; void VideoSortFilterProxyModel::setAlbumInUse(class TMPXItemId const &)
?tr@VideoThumbnailData@@SA?AVQString@@PBD0@Z @ 75 NONAME ; class QString VideoThumbnailData::tr(char const *, char const *)
??1VideoCollectionWrapper@@EAE@XZ @ 76 NONAME ; VideoCollectionWrapper::~VideoCollectionWrapper(void)
?trUtf8@VideoCollectionWrapper@@SA?AVQString@@PBD0H@Z @ 77 NONAME ; class QString VideoCollectionWrapper::trUtf8(char const *, char const *, int)
--- a/videocollection/eabi/videocollectionwrapperu.def Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/eabi/videocollectionwrapperu.def Fri Aug 06 09:43:48 2010 +0300
@@ -1,64 +1,64 @@
EXPORTS
_ZN18VideoThumbnailData11qt_metacallEN11QMetaObject4CallEiPPv @ 1 NONAME
_ZN18VideoThumbnailData11qt_metacastEPKc @ 2 NONAME
- _ZN18VideoThumbnailData12getThumbnailE10TMPXItemId @ 3 NONAME
- _ZN18VideoThumbnailData15removeThumbnailE10TMPXItemId @ 4 NONAME
+ _ZN18VideoThumbnailData12getThumbnailERK10TMPXItemId @ 3 NONAME
+ _ZN18VideoThumbnailData15removeThumbnailERK10TMPXItemId @ 4 NONAME
_ZN18VideoThumbnailData16staticMetaObjectE @ 5 NONAME DATA 16
_ZN18VideoThumbnailData17freeThumbnailDataEv @ 6 NONAME
- _ZN18VideoThumbnailData17thumbnailsFetchedE5QListI10TMPXItemIdE @ 7 NONAME
+ _ZN18VideoThumbnailData17thumbnailsFetchedER5QListI10TMPXItemIdE @ 7 NONAME
_ZN18VideoThumbnailData19getStaticMetaObjectEv @ 8 NONAME
_ZN18VideoThumbnailData23enableThumbnailCreationEb @ 9 NONAME
_ZN18VideoThumbnailData23startBackgroundFetchingEP25VideoSortFilterProxyModeli @ 10 NONAME
_ZN18VideoThumbnailData24enableBackgroundFetchingEb @ 11 NONAME
- _ZN18VideoThumbnailData8instanceEv @ 12 NONAME
- _ZN18VideoThumbnailDataC1Ev @ 13 NONAME
- _ZN18VideoThumbnailDataC2Ev @ 14 NONAME
- _ZN18VideoThumbnailDataD0Ev @ 15 NONAME
- _ZN18VideoThumbnailDataD1Ev @ 16 NONAME
- _ZN18VideoThumbnailDataD2Ev @ 17 NONAME
- _ZN22VideoCollectionWrapper11asyncStatusEiR8QVariant @ 18 NONAME
- _ZN22VideoCollectionWrapper11qt_metacallEN11QMetaObject4CallEiPPv @ 19 NONAME
- _ZN22VideoCollectionWrapper11qt_metacastEPKc @ 20 NONAME
- _ZN22VideoCollectionWrapper15sendAsyncStatusEiR8QVariant @ 21 NONAME
- _ZN22VideoCollectionWrapper16staticMetaObjectE @ 22 NONAME DATA 16
- _ZN22VideoCollectionWrapper19getStaticMetaObjectEv @ 23 NONAME
- _ZN22VideoCollectionWrapper8getModelEN21VideoCollectionCommon10TModelTypeE @ 24 NONAME
- _ZN22VideoCollectionWrapper8instanceEv @ 25 NONAME
- _ZN22VideoCollectionWrapperC1Ev @ 26 NONAME
- _ZN22VideoCollectionWrapperC2Ev @ 27 NONAME
- _ZN22VideoCollectionWrapperD0Ev @ 28 NONAME
- _ZN22VideoCollectionWrapperD1Ev @ 29 NONAME
- _ZN22VideoCollectionWrapperD2Ev @ 30 NONAME
- _ZN25VideoSortFilterProxyModel10getSortingERiRN2Qt9SortOrderE @ 31 NONAME
- _ZN25VideoSortFilterProxyModel10initializeEP18VideoListDataModel @ 32 NONAME
- _ZN25VideoSortFilterProxyModel10modelReadyEv @ 33 NONAME
- _ZN25VideoSortFilterProxyModel11addNewAlbumERK7QString @ 34 NONAME
- _ZN25VideoSortFilterProxyModel11deleteItemsERK5QListI11QModelIndexE @ 35 NONAME
- _ZN25VideoSortFilterProxyModel11qt_metacallEN11QMetaObject4CallEiPPv @ 36 NONAME
- _ZN25VideoSortFilterProxyModel11qt_metacastEPKc @ 37 NONAME
- _ZN25VideoSortFilterProxyModel11renameAlbumERK10TMPXItemIdRK7QString @ 38 NONAME
- _ZN25VideoSortFilterProxyModel12modelChangedEv @ 39 NONAME
- _ZN25VideoSortFilterProxyModel12removeAlbumsERK5QListI11QModelIndexE @ 40 NONAME
- _ZN25VideoSortFilterProxyModel13setAlbumInUseE10TMPXItemId @ 41 NONAME
- _ZN25VideoSortFilterProxyModel14connectSignalsEv @ 42 NONAME
- _ZN25VideoSortFilterProxyModel14processSortingEv @ 43 NONAME
- _ZN25VideoSortFilterProxyModel15addItemsInAlbumER10TMPXItemIdRK5QListIS0_E @ 44 NONAME
- _ZN25VideoSortFilterProxyModel16albumChangedSlotEv @ 45 NONAME
- _ZN25VideoSortFilterProxyModel16fetchItemDetailsERK11QModelIndex @ 46 NONAME
- _ZN25VideoSortFilterProxyModel16itemModifiedSlotERK10TMPXItemId @ 47 NONAME
+ _ZN18VideoThumbnailData25backgroundFetchingEnabledEv @ 12 NONAME
+ _ZN18VideoThumbnailData8instanceEv @ 13 NONAME
+ _ZN18VideoThumbnailDataC1Ev @ 14 NONAME
+ _ZN18VideoThumbnailDataC2Ev @ 15 NONAME
+ _ZN18VideoThumbnailDataD0Ev @ 16 NONAME
+ _ZN18VideoThumbnailDataD1Ev @ 17 NONAME
+ _ZN18VideoThumbnailDataD2Ev @ 18 NONAME
+ _ZN22VideoCollectionWrapper11asyncStatusEiR8QVariant @ 19 NONAME
+ _ZN22VideoCollectionWrapper11qt_metacallEN11QMetaObject4CallEiPPv @ 20 NONAME
+ _ZN22VideoCollectionWrapper11qt_metacastEPKc @ 21 NONAME
+ _ZN22VideoCollectionWrapper15sendAsyncStatusEiR8QVariant @ 22 NONAME
+ _ZN22VideoCollectionWrapper16staticMetaObjectE @ 23 NONAME DATA 16
+ _ZN22VideoCollectionWrapper19getStaticMetaObjectEv @ 24 NONAME
+ _ZN22VideoCollectionWrapper8getModelEN21VideoCollectionCommon10TModelTypeE @ 25 NONAME
+ _ZN22VideoCollectionWrapper8instanceEv @ 26 NONAME
+ _ZN22VideoCollectionWrapperC1Ev @ 27 NONAME
+ _ZN22VideoCollectionWrapperC2Ev @ 28 NONAME
+ _ZN22VideoCollectionWrapperD0Ev @ 29 NONAME
+ _ZN22VideoCollectionWrapperD1Ev @ 30 NONAME
+ _ZN22VideoCollectionWrapperD2Ev @ 31 NONAME
+ _ZN25VideoSortFilterProxyModel10getSortingERiRN2Qt9SortOrderE @ 32 NONAME
+ _ZN25VideoSortFilterProxyModel10initializeEP18VideoListDataModel @ 33 NONAME
+ _ZN25VideoSortFilterProxyModel10modelReadyEv @ 34 NONAME
+ _ZN25VideoSortFilterProxyModel10renameItemERK10TMPXItemIdRK7QString @ 35 NONAME
+ _ZN25VideoSortFilterProxyModel11addNewAlbumERK7QString @ 36 NONAME
+ _ZN25VideoSortFilterProxyModel11deleteItemsERK5QListI11QModelIndexE @ 37 NONAME
+ _ZN25VideoSortFilterProxyModel11qt_metacallEN11QMetaObject4CallEiPPv @ 38 NONAME
+ _ZN25VideoSortFilterProxyModel11qt_metacastEPKc @ 39 NONAME
+ _ZN25VideoSortFilterProxyModel12modelChangedEv @ 40 NONAME
+ _ZN25VideoSortFilterProxyModel12removeAlbumsERK5QListI11QModelIndexE @ 41 NONAME
+ _ZN25VideoSortFilterProxyModel13setAlbumInUseERK10TMPXItemId @ 42 NONAME
+ _ZN25VideoSortFilterProxyModel14connectSignalsEv @ 43 NONAME
+ _ZN25VideoSortFilterProxyModel14processSortingEv @ 44 NONAME
+ _ZN25VideoSortFilterProxyModel15addItemsInAlbumER10TMPXItemIdRK5QListIS0_E @ 45 NONAME
+ _ZN25VideoSortFilterProxyModel16albumChangedSlotEv @ 46 NONAME
+ _ZN25VideoSortFilterProxyModel16fetchItemDetailsERK11QModelIndex @ 47 NONAME
_ZN25VideoSortFilterProxyModel16staticMetaObjectE @ 48 NONAME DATA 16
_ZN25VideoSortFilterProxyModel17disconnectSignalsEv @ 49 NONAME
_ZN25VideoSortFilterProxyModel17shortDetailsReadyE10TMPXItemId @ 50 NONAME
- _ZN25VideoSortFilterProxyModel18setGenericIdFilterE10TMPXItemIdb @ 51 NONAME
+ _ZN25VideoSortFilterProxyModel18setGenericIdFilterERK10TMPXItemIdb @ 51 NONAME
_ZN25VideoSortFilterProxyModel19getStaticMetaObjectEv @ 52 NONAME
_ZN25VideoSortFilterProxyModel20removeItemsFromAlbumER10TMPXItemIdRK5QListIS0_E @ 53 NONAME
- _ZN25VideoSortFilterProxyModel21getMediaFilePathForIdE10TMPXItemId @ 54 NONAME
+ _ZN25VideoSortFilterProxyModel21getMediaFilePathForIdERK10TMPXItemId @ 54 NONAME
_ZN25VideoSortFilterProxyModel4backEv @ 55 NONAME
_ZN25VideoSortFilterProxyModel4openEN21VideoCollectionCommon17TCollectionLevelsE @ 56 NONAME
_ZN25VideoSortFilterProxyModel7getTypeEv @ 57 NONAME
_ZN25VideoSortFilterProxyModel8openItemE10TMPXItemId @ 58 NONAME
_ZN25VideoSortFilterProxyModel9doSortingEiN2Qt9SortOrderEb @ 59 NONAME
- _ZN25VideoSortFilterProxyModel9indexOfIdE10TMPXItemId @ 60 NONAME
+ _ZN25VideoSortFilterProxyModel9indexOfIdERK10TMPXItemId @ 60 NONAME
_ZN25VideoSortFilterProxyModelC1EN21VideoCollectionCommon10TModelTypeEP7QObject @ 61 NONAME
_ZN25VideoSortFilterProxyModelC2EN21VideoCollectionCommon10TModelTypeEP7QObject @ 62 NONAME
_ZN25VideoSortFilterProxyModelD0Ev @ 63 NONAME
--- a/videocollection/inc/videocollectioncommon.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/inc/videocollectioncommon.h Fri Aug 06 09:43:48 2010 +0300
@@ -62,6 +62,9 @@
const char* const MetaKeyVideoResolutionString = "MetaKeyVideoResolutionString";
const char* const MetaKeyBitRate = "MetaKeyBitRate";
const char* const MetaKeyFormat = "MetaKeyFormat";
+ const char* const MetaKeyFileName = "MetaKeyFileName";
+ const char* const MetaKeyFilePath = "MetaKeyFilePath";
+ const char* const MetaKeyVideoTitle = "MetaKeyVideoTitle";
enum VideoItemStatus
{
@@ -74,6 +77,9 @@
* order than the VideoDetailLabelKeys.
*/
const char * const VideoDetailLabels[] = {
+ QT_TR_NOOP("txt_videos_list_title"),
+ QT_TR_NOOP("txt_videos_list_filename"),
+ QT_TR_NOOP("txt_videos_list_file_path"),
QT_TR_NOOP("txt_videos_list_drm"),
QT_TR_NOOP("txt_videos_list_service"),
QT_TR_NOOP("txt_videos_list_description"),
@@ -89,13 +95,16 @@
QT_TR_NOOP("txt_videos_list_file_size"),
QT_TR_NOOP("txt_videos_list_resolution"),
QT_TR_NOOP("txt_videos_list_format"),
- QT_TR_NOOP("txt_videos_list_bitrate")
+ QT_TR_NOOP("txt_videos_list_bitrate")
};
/**
* Order of keys in the labels const array.
*/
const char * const VideoDetailLabelKeys[] = {
+ MetaKeyVideoTitle,
+ MetaKeyFileName,
+ MetaKeyFilePath,
MetaKeyDRMInfo,
MetaKeyServiceURL,
MetaKeyDescription,
@@ -111,7 +120,7 @@
MetaKeySizeString,
MetaKeyVideoResolutionString,
MetaKeyFormat,
- MetaKeyBitRate
+ MetaKeyBitRate
};
/**
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/simplevideoplayback/inc/svpbdocumentloader.h Fri Aug 06 09:43:48 2010 +0300
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Document loader of the SimpleVideoPlayback MPX view plugin.
+*
+*/
+
+#ifndef SVPBDOCUMENTLOADER_H_
+#define SVPBDOCUMENTLOADER_H_
+
+#include <hbdocumentloader.h>
+
+class SvpbDocumentLoader : public HbDocumentLoader
+{
+public:
+ SvpbDocumentLoader();
+
+private: // from HbDocumentLoader
+ QObject *createObject(const QString& type, const QString &name);
+
+};
+
+#endif /* SVPBDOCUMENTLOADER_H_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/simplevideoplayback/inc/svpbengine.h Fri Aug 06 09:43:48 2010 +0300
@@ -0,0 +1,65 @@
+#ifndef SVPBENGINE_H
+#define SVPBENGINE_H
+
+#include <qobject>
+#include <mpxplaybackobserver.h>
+#include "svpbsurfacecontainer.h"
+
+class MMPXPlaybackUtility;
+
+enum SvpbEngineState
+{
+ Disconnected = 0,
+ Connected, // == Stopped
+ Initializing,
+ MediaRequested,
+ PlayRequested,
+ Playing,
+ PauseRequested,
+ Paused,
+ StopRequested
+};
+
+class SvpbEngine : public QObject,
+ public MMPXPlaybackObserver,
+ public MMPXPlaybackCallback
+{
+ Q_OBJECT
+
+public:
+ SvpbEngine(QObject *parent=0);
+ virtual ~SvpbEngine();
+
+ void connectMPX();
+ void disconnectMPX();
+
+ void setSurfaceContainer(SvpbSurfaceContainer *surfaceContainer);
+
+signals:
+ void finished();
+
+public slots:
+ void togglePause();
+ void stop();
+
+private: // From MMPXPlaybackObserver
+ void HandlePlaybackMessage(CMPXMessage* aMessage, TInt aErr);
+
+private: // from MMPXPlaybackCallback
+ void HandlePropertyL(TMPXPlaybackProperty aProperty, TInt aValue, TInt aError);
+ void HandleSubPlayerNamesL(TUid aPlayer, const MDesCArray* aSubPlayers,
+ TBool aComplete, TInt aError);
+ void HandleMediaL(const CMPXMedia& aProperties, TInt aError);
+
+private:
+ void mpxPbStateChanged(TMPXPlaybackState type, int err);
+ void requestMedia();
+
+private: // data
+ SvpbSurfaceContainer *mSurfaceContainer;
+ SvpbEngineState mState;
+ MMPXPlaybackUtility *mPlaybackUtility;
+ TMPXPlaybackState mMpxPbState;
+};
+
+#endif // SVPBENGINE_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/simplevideoplayback/inc/svpbnativewindow.h Fri Aug 06 09:43:48 2010 +0300
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: CCoeControl to provide RWindow for videoplayback.
+* QGraphicsView derived class can not be used for this purpose,
+* because the Qt OpenVG context may interfere with the one being
+* used by the renderer.
+*
+*/
+
+#ifndef SVPBNATIVEWINDOW_H
+#define SVPBNATIVEWINDOW_H
+
+#include <coecntrl.h>
+#include "svpbsurfacecontainer.h"
+
+class CMediaClientVideoDisplay;
+
+class CSvpbNativeWindow : public CCoeControl, public SvpbSurfaceContainer
+{
+public:
+ static CSvpbNativeWindow* NewL(const TRect& displayRect);
+ virtual ~CSvpbNativeWindow();
+
+public: // From SvpbSurfaceContainer
+ int attachSurface(const TSurfaceId &surfaceId, const TRect &cropRect, const TVideoAspectRatio &aspectRatio);
+ void detachSurface();
+
+private:
+ CSvpbNativeWindow();
+ void ConstructL(const TRect& displayRect);
+ int setupSurface(const TRect &cropRect, const TVideoAspectRatio &aspectRatio);
+
+private:
+ TSurfaceId mSurfaceId;
+ CMediaClientVideoDisplay *mDisplay;
+};
+
+#endif // SVPBNATIVEWINDOW_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/simplevideoplayback/inc/svpbplugin.h Fri Aug 06 09:43:48 2010 +0300
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Simple Video Playback MXP view plugin
+*
+*/
+
+#ifndef SVPBPLUGIN_H
+#define SVPBPLUGIN_H
+
+#include <mpxviewpluginqt.h>
+
+class SvpbEngine;
+class SvpbView;
+
+class SvpbPlugin : public MpxViewPlugin
+{
+Q_OBJECT
+
+public:
+ SvpbPlugin();
+ virtual ~SvpbPlugin();
+
+public: // from MpxViewPlugin
+ void createView();
+ void destroyView();
+ void activateView();
+ void deactivateView();
+ QGraphicsWidget* getView();
+
+public slots: // from MpxViewPlugin
+ void orientationChange(Qt::Orientation orientation);
+ void back();
+
+private:
+ SvpbView *mView;
+ SvpbEngine *mEngine;
+};
+
+#endif //SVPBPLUGIN_H
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/simplevideoplayback/inc/svpbsurfacecontainer.h Fri Aug 06 09:43:48 2010 +0300
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Surface container interface for the SimpleVideoPlayback MPX
+* view plugin.
+*
+*/
+
+#ifndef SVPBSURFACECONTAINER_H_
+#define SVPBSURFACECONTAINER_H_
+
+#include <mmf/common/mmfvideo.h>
+#include <graphics/surface.h>
+
+class SvpbSurfaceContainer
+{
+public:
+ virtual int attachSurface(
+ const TSurfaceId &surfaceId,
+ const TRect &cropRect,
+ const TVideoAspectRatio &aspectRatio) = 0;
+ virtual void detachSurface() = 0;
+};
+
+#endif /* SVPBSURFACECONTAINER_H_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/simplevideoplayback/inc/svpbview.h Fri Aug 06 09:43:48 2010 +0300
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Main view of the SimpleVideoPlayback MPX view plugin.
+*
+*/
+
+#ifndef SVPBVIEW_H_
+#define SVPBVIEW_H_
+
+#include <hbview.h>
+
+class CSvpbNativeWindow;
+class SvpbSurfaceContainer;
+
+class SvpbView : public HbView
+{
+ Q_OBJECT
+
+public:
+ SvpbView(QGraphicsItem *parent=0);
+ virtual ~SvpbView();
+
+public:
+ void activate();
+ void deactivate();
+
+ SvpbSurfaceContainer *surfaceContainer() const;
+
+signals:
+ void finished();
+ void tapped();
+ void longTapped();
+
+private:
+ void mousePressEvent(QGraphicsSceneMouseEvent *event);
+ void gestureEvent(QGestureEvent *event);
+ bool handleTap(Qt::GestureState state);
+ bool handleLongTap(Qt::GestureState state);
+
+private:
+ CSvpbNativeWindow *mNativeWindow;
+};
+
+#endif /* SVPBVIEW_H_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/simplevideoplayback/inc/trace.h Fri Aug 06 09:43:48 2010 +0300
@@ -0,0 +1,146 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Tracing macros, 2nd generation
+*
+*/
+
+#ifndef TRACE_H
+#define TRACE_H
+
+#include <QDebug>
+
+//-----------------------------------------------------------------------------
+// Trace definitions
+//-----------------------------------------------------------------------------
+//
+
+/**
+* Error trace enabled
+*/
+#ifdef _DEBUG
+ #define ERROR_TRACE
+ #define INFO_TRACE
+ #define TIMESTAMP_TRACE
+ #define FUNC_TRACE
+#else
+ #define ERROR_TRACE
+ #define INFO_TRACE
+ #define TIMESTAMP_TRACE
+ #define FUNC_TRACE
+#endif
+
+//-----------------------------------------------------------------------------
+// Constants
+//-----------------------------------------------------------------------------
+//
+
+/**
+* Trace prefixes for macros with component name.
+*/
+#define _TRACE_PREFIX "[SVPB]:"
+
+/**
+* Prefix error trace
+*/
+#define _ERROR_PREFIX _TRACE_PREFIX " [ERROR]:"
+
+/**
+* Prefix info trace.
+*/
+#define _INFO_PREFIX _TRACE_PREFIX " [INFO]:"
+
+/**
+* Prefix timestamp trace.
+*/
+#define _TIMESTAMP_PREFIX _TRACE_PREFIX " [TIMESTAMP]:"
+
+//-----------------------------------------------------------------------------
+// Error trace macros
+// Usage: wrap traces in ERROR() macro to allow disabling them in release builds.
+// Use normal stream object operations.
+// Examples:
+// ERROR( "xxx failed" );
+// ERROR( "Test trace arg =" << 999 << "arg2 =" << title() );
+//-----------------------------------------------------------------------------
+//
+#ifdef ERROR_TRACE
+ #define ERROR(trace) {qDebug() << _ERROR_PREFIX << trace;}
+ #define ERROR_PARAM(param) param
+ #define HANDLE_ERROR(trace) {ERROR(trace); __BREAKPOINT();}
+ #define HANDLE_ERROR_BOOL(x) {if (!x) {ERROR(#x << "is false"); __BREAKPOINT();}}
+ #define HANDLE_ERROR_NULL(x) {if (!x) {ERROR(#x << "is NULL"); __BREAKPOINT();}}
+ #define HANDLE_ERROR_NEG(x) {if (x < 0) {ERROR(#x << "=" << x << "File:" << __FILE__ << ", line:" << __LINE__); __BREAKPOINT();}}
+ #define CHECK_ERROR(err, trace) {if (err < 0) ERROR(trace << err);}
+#else //ERROR_TRACE not defined
+ #define ERROR(trace)
+ #define ERROR_PARAM(param)
+ #define HANDLE_ERROR(trace)
+ #define HANDLE_ERROR_BOOL(x)
+ #define HANDLE_ERROR_NULL(x)
+ #define HANDLE_ERROR_NEG(x)
+ #define CHECK_ERROR(err,trace)
+#endif //ERROR_TRACE
+
+//-----------------------------------------------------------------------------
+// Info trace macros
+// Usage: wrap traces in INFO() macro to allow disabling them in release builds.
+// Use normal stream object operations.
+// Examples:
+// INFO( "Test trace" );
+// INFO( "Test trace arg =" << 999 << "arg2 =" << title() );
+//-----------------------------------------------------------------------------
+//
+#ifdef INFO_TRACE
+ #define INFO(trace) {qDebug() << _INFO_PREFIX << trace;}
+ #define INFO_PARAM(param) param
+#else //INFO_TRACE not defined
+ #define INFO(trace)
+ #define INFO_PARAM(param)
+#endif //INFO_TRACE
+
+//-----------------------------------------------------------------------------
+// Function trace macros
+//-----------------------------------------------------------------------------
+//
+#ifdef FUNC_TRACE
+
+ class FuncLog
+ {
+ public:
+ inline FuncLog( const char* func ) : m_func( func )
+ { qDebug() << _TRACE_PREFIX << m_func << "-START"; }
+ inline ~FuncLog() { qDebug() << _TRACE_PREFIX << m_func << "-END"; }
+ private: // Data
+ QString m_func;
+ };
+
+ #define FUNC_LOG FuncLog _fl( __PRETTY_FUNCTION__ );
+#else //FUNC_TRACE not defined
+ #define FUNC_LOG
+#endif //FUNC_TRACE
+
+//-----------------------------------------------------------------------------
+// Timestamp trace macros
+//-----------------------------------------------------------------------------
+//
+#ifdef TIMESTAMP_TRACE
+ #include <QTime>
+ #define TIMESTAMP(trace)\
+ {qDebug() << _TIMESTAMP_PREFIX << "(" << \
+ QTime::currentTime().toString("HH:mm:ss:zzz") << ")" << trace;}
+#else //TIMESTAMP_TRACE not defined
+ #define TIMESTAMP(trace)
+#endif //TIMESTAMP_TRACE
+
+#endif // TRACE_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/simplevideoplayback/resources/simplevideoplayback.docml Fri Aug 06 09:43:48 2010 +0300
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="1.1">
+ <widget name="view" type="SvpbView">
+ <widget name="transparentWindow" type="HbTransparentWindow">
+ <real name="z" value="1"/>
+ <sizepolicy horizontalPolicy="Ignored" horizontalStretch="0" verticalPolicy="Ignored" verticalStretch="0"/>
+ <layout type="anchor"/>
+ </widget>
+ <layout type="anchor">
+ <anchoritem dst="transparentWindow" dstEdge="TOP" spacing="0un" src="" srcEdge="TOP"/>
+ <anchoritem dst="transparentWindow" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
+ <anchoritem dst="transparentWindow" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
+ <anchoritem dst="transparentWindow" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
+ </layout>
+ </widget>
+ <metadata activeUIState="Common ui state" display="NHD-3.2-inch_portrait" unit="un">
+ <uistate name="Common ui state" sections="#common"/>
+ </metadata>
+</hbdocument>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/simplevideoplayback/rom/simplevideoplayback.iby Fri Aug 06 09:43:48 2010 +0300
@@ -0,0 +1,25 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: simplevideoplayback.iby
+*
+*/
+
+#ifndef SIMPLEVIDEOPLAYBACK_IBY
+#define SIMPLEVIDEOPLAYBACK_IBY
+
+#include <data_caging_paths_for_iby.hrh>
+
+ECOM_PLUGIN(simplevideoplayback.dll, simplevideoplayback.rsc)
+
+#endif // SIMPLEVIDEOPLAYBACK_IBY
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/simplevideoplayback/simplevideoplayback.pro Fri Aug 06 09:43:48 2010 +0300
@@ -0,0 +1,64 @@
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+TEMPLATE = lib
+CONFIG += hb qt ecomplugin
+TARGET = simplevideoplayback
+
+# MPX view plugin interface name
+SERVICE.INTERFACE_NAME = org.nokia.mmdt.QViewPlugin/1.0
+
+# Opaque data for resolving the correct plugin
+SERVICE.CONFIGURATION = "<t>0x20024338</t><p></p><i>EMPXViewPluginPriorityNormal</i><f>0x00000002</f>"
+
+INCLUDEPATH += inc \
+ ../../../inc
+DEPENDPATH += inc
+VPATH += src
+
+HEADERS += svpbdocumentloader.h \
+ svpbengine.h \
+ svpbnativewindow.h \
+ svpbplugin.h \
+ svpbsurfacecontainer.h \
+ svpbview.h \
+ trace.h
+
+SOURCES += svpbdocumentloader.cpp \
+ svpbengine.cpp \
+ svpbnativewindow.cpp \
+ svpbplugin.cpp \
+ svpbview.cpp
+
+RESOURCES = simplevideoplayback.qrc
+
+LIBS += -lcone \
+ -lmediaclientvideodisplay \
+ -lmpxcommon \
+ -lmpxplaybackutility \
+ -lmpxviewframeworkqt \
+ -lws32
+
+symbian:
+{
+ TARGETTYPE_OVERRIDE = PLUGIN
+ # KMpxVideoPluginDllPlaybackUid
+ TARGET.UID3 = 0x20024335
+ TARGET.CAPABILITY = ALL -TCB -DRM
+ TARGET.EPOCALLOWDLLDATA = 1
+ INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
+ BLD_INF_RULES.prj_exports += "rom/simplevideoplayback.iby CORE_APP_LAYER_IBY_EXPORT_PATH(simplevideoplayback.iby)"
+ MMP_RULES += SMPSAFE
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/simplevideoplayback/simplevideoplayback.qrc Fri Aug 06 09:43:48 2010 +0300
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/" >
+ <file>resources/simplevideoplayback.docml</file>
+ </qresource>
+</RCC>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/simplevideoplayback/src/svpbdocumentloader.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Document loader of the SimpleVideoPlayback MPX view plugin.
+*
+*/
+
+#include "svpbdocumentloader.h"
+#include "svpbview.h"
+#include "trace.h"
+
+SvpbDocumentLoader::SvpbDocumentLoader()
+{
+}
+
+QObject *SvpbDocumentLoader::createObject(const QString& type, const QString &name)
+{
+ FUNC_LOG;
+ INFO("Create object" << type << name);
+
+ QObject *object = 0;
+
+ if (type == SvpbView::staticMetaObject.className()) {
+ object = new SvpbView;
+ }
+
+ if (object) {
+ object->setObjectName(name);
+ return object;
+ }
+
+ return HbDocumentLoader::createObject(type, name);
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/simplevideoplayback/src/svpbengine.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -0,0 +1,236 @@
+#include <mpxplaybackutility.h> // MMPXPlaybackUtility
+#include <mpxmessagegeneraldefs.h>
+#include <mpxplaybackmessage.h>
+#include <mpxcommandgeneraldefs.h>
+#include <mpxvideoplaybackdefs.h>
+#include <mpxmediageneraldefs.h>
+#include <mpxmediageneralextdefs.h>
+#include <mpxmediavideodefs.h>
+
+#include "svpbengine.h"
+#include "trace.h"
+
+const TUid KVideoHelixPlaybackPluginUid = { 0x10282551 };
+
+SvpbEngine::SvpbEngine(QObject *parent) :
+ QObject(parent),
+ mSurfaceContainer(0),
+ mState(Disconnected),
+ mPlaybackUtility(0),
+ mMpxPbState(EPbStateNotInitialised)
+{
+ FUNC_LOG;
+}
+
+SvpbEngine::~SvpbEngine()
+{
+ FUNC_LOG;
+
+ disconnectMPX();
+}
+
+void SvpbEngine::connectMPX()
+{
+ FUNC_LOG;
+
+ if (mState == Disconnected && !mPlaybackUtility) {
+ QT_TRAP_THROWING(mPlaybackUtility =
+ MMPXPlaybackUtility::UtilityL(EMPXCategoryVideo, KPbModeDefault));
+ MMPXPlayerManager &manager = mPlaybackUtility->PlayerManager();
+ QT_TRAP_THROWING(manager.SelectPlayerL(KVideoHelixPlaybackPluginUid));
+ QT_TRAP_THROWING(mPlaybackUtility->AddObserverL(*this));
+ mState = Connected;
+ INFO("Connected");
+ }
+}
+
+void SvpbEngine::disconnectMPX()
+{
+ FUNC_LOG;
+
+ if (mState != Disconnected && mPlaybackUtility)
+ {
+ mPlaybackUtility->RemoveObserverL(*this);
+ mPlaybackUtility->Close();
+ mPlaybackUtility = 0;
+ mState = Disconnected;
+ INFO("Disconnected");
+ }
+}
+
+/** Ownership is not transferred. */
+void SvpbEngine::setSurfaceContainer(SvpbSurfaceContainer *surfaceContainer)
+{
+ FUNC_LOG;
+
+ mSurfaceContainer = surfaceContainer;
+}
+
+void SvpbEngine::togglePause()
+{
+ FUNC_LOG;
+
+ if (mState == PlayRequested || mState == Playing) {
+ QT_TRAP_THROWING(mPlaybackUtility->CommandL(EPbCmdPause, 0));
+ mState = PauseRequested;
+ INFO("Pause requested");
+ }
+ else if (mState == PauseRequested || mState == Paused) {
+ QT_TRAP_THROWING(mPlaybackUtility->CommandL(EPbCmdPlay, 0));
+ mState = PlayRequested;
+ INFO("Play requested");
+ }
+}
+
+void SvpbEngine::stop()
+{
+ FUNC_LOG;
+
+ if (mState == PlayRequested || mState == Playing) {
+ QT_TRAP_THROWING(mPlaybackUtility->CommandL(EPbCmdStop, 0));
+ mState = StopRequested;
+ INFO("Stop requested");
+ }
+}
+
+void SvpbEngine::HandlePlaybackMessage(CMPXMessage *aMessage, TInt aErr)
+{
+ FUNC_LOG;
+
+ if (aMessage) {
+ TMPXMessageId id(aMessage->ValueTObjectL<TMPXMessageId>(KMPXMessageGeneralId));
+
+ if (id == KMPXMessageGeneral) {
+ TInt msg(0), type(0);
+ QT_TRAP_THROWING(msg = aMessage->ValueTObjectL<TInt>(KMPXMessageGeneralEvent));
+ QT_TRAP_THROWING(type = aMessage->ValueTObjectL<TInt>(KMPXMessageGeneralType));
+ INFO("KMPXMessageGeneral" << msg << type);
+
+ switch(msg)
+ {
+ case TMPXPlaybackMessage::EInitializeComplete:
+ INFO("Initialize complete");
+ break;
+ case TMPXPlaybackMessage::EStateChanged:
+ mpxPbStateChanged(static_cast<TMPXPlaybackState>(type), aErr);
+ break;
+ default:
+ break;
+ }
+ }
+ else if (id == KMPXMediaIdVideoDisplayMessage) {
+ TMPXVideoDisplayCommand msg =
+ ( *(aMessage->Value<TMPXVideoDisplayCommand>(KMPXMediaVideoDisplayCommand)));
+ INFO("KMPXMediaIdVideoDisplayMessage" << msg);
+
+ switch (msg)
+ {
+ case EPbMsgVideoSurfaceCreated:
+ case EPbMsgVideoSurfaceChanged:
+ if (mSurfaceContainer) {
+ TSurfaceId surfaceId;
+ TRect cropRect;
+ TVideoAspectRatio aspectRatio;
+ QT_TRAP_THROWING(surfaceId = aMessage->ValueTObjectL<TSurfaceId>(KMPXMediaVideoDisplayTSurfaceId));
+ QT_TRAP_THROWING(cropRect = aMessage->ValueTObjectL<TRect>(KMPXMediaVideoDisplayCropRect));
+ QT_TRAP_THROWING(aspectRatio = aMessage->ValueTObjectL<TVideoAspectRatio>(KMPXMediaVideoDisplayAspectRatio));
+ mSurfaceContainer->attachSurface(surfaceId, cropRect, aspectRatio);
+ }
+ break;
+ case EPbMsgVideoSurfaceRemoved:
+ if (mSurfaceContainer) {
+ mSurfaceContainer->detachSurface();
+ }
+ break;
+ }
+ }
+ }
+}
+
+void SvpbEngine::HandlePropertyL(TMPXPlaybackProperty aProperty, TInt aValue, TInt aError)
+{
+ Q_UNUSED(aProperty);
+ Q_UNUSED(aValue);
+ Q_UNUSED(aError);
+ FUNC_LOG;
+}
+
+void SvpbEngine::HandleSubPlayerNamesL(TUid /*aPlayer*/,
+ const MDesCArray* /*aSubPlayers*/,
+ TBool /*aComplete*/,
+ TInt /*aError*/)
+{
+ FUNC_LOG;
+}
+
+void SvpbEngine::HandleMediaL(const CMPXMedia& /*aProperties*/, TInt /*aError*/)
+{
+ FUNC_LOG;
+
+ QT_TRAP_THROWING(mPlaybackUtility->CommandL(EPbCmdPlay, 0));
+ mState = PlayRequested;
+ INFO("Play requested");
+}
+
+void SvpbEngine::mpxPbStateChanged(TMPXPlaybackState type, int err)
+{
+ FUNC_LOG;
+ INFO("MPX PB state:" << type << "error" << err);
+
+ if (err == 0) {
+ switch(type) {
+ case EPbStateInitialised:
+ requestMedia(); // VideoHelixPlugin uses media request to signal view activation
+ mState = MediaRequested;
+ INFO("Media requested");
+ break;
+ case EPbStatePlaying:
+ mState = Playing;
+ INFO("Playing");
+ break;
+ case EPbStatePaused:
+ mState = Paused;
+ INFO("Paused");
+ break;
+ case EPbStateStopped:
+ mState = Connected;
+ INFO("Connected");
+ emit finished();
+ break;
+ default:
+ break;
+ };
+ }
+}
+
+void SvpbEngine::requestMedia()
+{
+ FUNC_LOG;
+
+ MMPXSource *source = mPlaybackUtility->Source();
+ HANDLE_ERROR_NULL(source);
+ if (source) {
+ RArray<TMPXAttribute> attrs;
+ attrs.Append(KMPXMediaGeneralUri|
+ KMPXMediaGeneralDuration|
+ KMPXMediaGeneralTitle|
+ KMPXMediaGeneralMimeType);
+ attrs.Append(KMPXMediaVideoAll);
+
+ CMPXAttributeSpecs *specs = 0;
+ TRAPD(err, specs = CMPXAttributeSpecs::NewL());
+ HANDLE_ERROR_NEG(err);
+ if (specs) {
+ // Set the attribute to always route the media call to playback plugin
+ TRAP(err, specs->SetTObjectValueL<TBool>(KMPXMediaGeneralExtMediaRedirect, ETrue));
+ HANDLE_ERROR_NEG(err);
+ if (err == KErrNone) {
+ TRAP(err, source->MediaL(attrs.Array(), *this, specs));
+ HANDLE_ERROR_NEG(err);
+ }
+ }
+
+ delete specs;
+ attrs.Close();
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/simplevideoplayback/src/svpbnativewindow.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -0,0 +1,133 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: CCoeControl to provide RWindow for videoplayback.
+* QGraphicsView derived class can not be used for this purpose,
+* because the Qt OpenVG context may interfere with the one being
+* used by the renderer.
+*
+*/
+
+#include <QGraphicsWidget>
+#include <graphics/surfaceconfiguration.h>
+#include <mediaclientvideodisplay.h>
+#include "svpbnativewindow.h"
+#include "trace.h"
+
+CSvpbNativeWindow* CSvpbNativeWindow::NewL(const TRect& displayRect)
+{
+ FUNC_LOG;
+
+ CSvpbNativeWindow* self = new (ELeave) CSvpbNativeWindow;
+ CleanupStack::PushL(self);
+ self->ConstructL(displayRect);
+ CleanupStack::Pop();
+ return self;
+}
+
+CSvpbNativeWindow::~CSvpbNativeWindow()
+{
+ FUNC_LOG;
+
+ detachSurface();
+ CloseWindow();
+}
+
+int CSvpbNativeWindow::attachSurface(
+ const TSurfaceId &surfaceId,
+ const TRect &cropRect,
+ const TVideoAspectRatio &aspectRatio)
+{
+ FUNC_LOG;
+
+ INFO("Surface id:" << surfaceId.iInternal[0]
+ << surfaceId.iInternal[1]
+ << surfaceId.iInternal[2]
+ << surfaceId.iInternal[3]);
+
+ if (mSurfaceId.IsNull()) {
+ mSurfaceId = surfaceId;
+ return setupSurface(cropRect, aspectRatio);
+ }
+ else if (mSurfaceId == surfaceId) {
+ detachSurface();
+ return setupSurface(cropRect, aspectRatio);
+ }
+ else {
+ detachSurface();
+ }
+
+ return 0;
+}
+
+void CSvpbNativeWindow::detachSurface()
+{
+ FUNC_LOG;
+
+ if (mDisplay) {
+ mDisplay->RemoveSurface();
+ mDisplay->RemoveDisplayWindow( *(DrawableWindow()));
+ delete mDisplay;
+ mDisplay = 0;
+ }
+
+ mSurfaceId = TSurfaceId::CreateNullId();
+}
+
+CSvpbNativeWindow::CSvpbNativeWindow() :
+ mSurfaceId(TSurfaceId::CreateNullId()),
+ mDisplay(0)
+{
+ FUNC_LOG;
+}
+
+void CSvpbNativeWindow::ConstructL(const TRect& displayRect)
+{
+ FUNC_LOG;
+
+ CreateWindowL();
+ SetRect(displayRect);
+ DrawableWindow()->SetOrdinalPosition(-1); // Send to background
+ ActivateL();
+}
+
+int CSvpbNativeWindow::setupSurface(
+ const TRect &cropRect, const TVideoAspectRatio &aspectRatio)
+{
+ FUNC_LOG;
+
+ TInt displayId = CCoeEnv::Static()->ScreenDevice()->GetScreenNumber();
+ INFO("Display id:" << displayId);
+ QT_TRAP_THROWING(mDisplay = CMediaClientVideoDisplay::NewL(displayId));
+
+ RWindowBase *videoWindow = DrawableWindow();
+ TRect displayRect = Rect();
+ TRAPD(err, mDisplay->AddDisplayWindowL(videoWindow,
+ displayRect, // Window clipping rectangle, relative to the window
+ cropRect, // The dimensions of the crop region, relative to the video image
+ displayRect, // Video extent on the screen
+ 100.0f,
+ 100.0f,
+ displayRect.Width() < displayRect.Height() ? EVideoRotationClockwise90 : EVideoRotationNone,
+ EAutoScaleStretch,
+ EHorizontalAlignCenter,
+ EVerticalAlignCenter,
+ (RWindow*)videoWindow));
+ HANDLE_ERROR_NEG(err);
+
+ if (err == 0) {
+ QT_TRAP_THROWING(mDisplay->SurfaceCreated(mSurfaceId, cropRect, aspectRatio, cropRect));
+ }
+
+ return err;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/simplevideoplayback/src/svpbplugin.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -0,0 +1,122 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Simple Video Playback MXP view plugin
+*
+*/
+
+#include <xqplugin.h>
+
+#include "svpbdocumentloader.h"
+#include "svpbengine.h"
+#include "svpbplugin.h"
+#include "svpbview.h"
+#include "mpxhbvideocommondefs.h"
+#include "trace.h"
+
+static const QString NAME_DOCML = ":/resources/simplevideoplayback.docml";
+static const QString NAME_VIEW = "view";
+
+SvpbPlugin::SvpbPlugin() : mView(0), mEngine(0)
+{
+ FUNC_LOG;
+}
+
+SvpbPlugin::~SvpbPlugin()
+{
+ FUNC_LOG;
+ destroyView();
+}
+
+void SvpbPlugin::createView()
+{
+ FUNC_LOG;
+
+ if (!mView) {
+ SvpbDocumentLoader loader;
+ bool ok;
+ loader.load(NAME_DOCML, &ok);
+
+ if (ok) {
+ mView = qobject_cast<SvpbView *>(loader.findWidget(NAME_VIEW));
+ HANDLE_ERROR_NULL(mView);
+ connect(mView, SIGNAL(finished()), SLOT(back()), Qt::QueuedConnection);
+
+ mEngine = new SvpbEngine;
+ HANDLE_ERROR_NULL(mEngine);
+ connect(mEngine, SIGNAL(finished()), SLOT(back()), Qt::QueuedConnection);
+
+ connect(mView, SIGNAL(tapped()), mEngine, SLOT(togglePause()));
+ connect(mView, SIGNAL(longTapped()), mEngine, SLOT(stop()));
+ }
+ else {
+ ERROR(QString("Unable to read ").append(NAME_DOCML));
+ }
+ }
+}
+
+void SvpbPlugin::destroyView()
+{
+ FUNC_LOG;
+
+ deactivateView();
+
+ delete mEngine; // disconnects any signals
+ mEngine = 0;
+
+ delete mView; // disconnects any signals
+ mView = 0;
+}
+
+void SvpbPlugin::activateView()
+{
+ FUNC_LOG;
+
+ if (mEngine && mView) {
+ mEngine->connectMPX();
+ mView->activate();
+ mEngine->setSurfaceContainer(mView->surfaceContainer());
+ }
+}
+
+void SvpbPlugin::deactivateView()
+{
+ FUNC_LOG;
+
+ if (mEngine && mView) {
+ mView->deactivate();
+ mEngine->disconnectMPX();
+ }
+}
+
+QGraphicsWidget* SvpbPlugin::getView()
+{
+ FUNC_LOG;
+
+ return mView;
+}
+
+void SvpbPlugin::orientationChange(Qt::Orientation orientation)
+{
+ FUNC_LOG;
+ Q_UNUSED( orientation );
+}
+
+void SvpbPlugin::back()
+{
+ FUNC_LOG;
+
+ emit command(MpxHbVideoCommon::CollectionView);
+}
+
+XQ_EXPORT_PLUGIN2(simplevideoplayback, SvpbPlugin);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/simplevideoplayback/src/svpbview.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -0,0 +1,122 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Main view of the SimpleVideoPlayback MPX view plugin.
+*
+*/
+
+#include <hbmainwindow.h>
+#include <hbtapgesture.h>
+#include "svpbnativewindow.h"
+#include "svpbview.h"
+#include "trace.h"
+
+SvpbView::SvpbView(QGraphicsItem *parent) :
+ HbView(parent),
+ mNativeWindow(0)
+{
+ FUNC_LOG;
+
+ grabGesture(Qt::TapGesture);
+}
+
+SvpbView::~SvpbView()
+{
+ FUNC_LOG;
+
+ delete mNativeWindow;
+}
+
+void SvpbView::activate()
+{
+ FUNC_LOG;
+ HANDLE_ERROR_BOOL(mNativeWindow == 0);
+
+ setContentFullScreen();
+ setItemVisible(Hb::AllItems, false);
+ mainWindow()->setOrientation(Qt::Horizontal, false);
+
+ RWindowBase *rootWindow = mainWindow()->winId()->DrawableWindow();
+ TRect displayRect(rootWindow->Position(), rootWindow->Size());
+
+ QT_TRAP_THROWING(mNativeWindow = CSvpbNativeWindow::NewL(displayRect));
+
+ mainWindow()->winId()->DrawableWindow()->SetSurfaceTransparency(ETrue); // This is required fow HW
+}
+
+void SvpbView::deactivate()
+{
+ FUNC_LOG;
+
+// If this is called, surface transparency can not be enabled again
+// mainWindow()->winId()->DrawableWindow()->SetSurfaceTransparency(EFalse);
+
+ delete mNativeWindow;
+ mNativeWindow = 0;
+}
+
+SvpbSurfaceContainer *SvpbView::surfaceContainer() const
+{
+ FUNC_LOG;
+
+ return mNativeWindow;
+}
+
+// this needs to be implemented for gesture framework to work
+void SvpbView::mousePressEvent(QGraphicsSceneMouseEvent *event)
+{
+ Q_UNUSED(event);
+}
+
+void SvpbView::gestureEvent(QGestureEvent *event)
+{
+ FUNC_LOG;
+
+ bool eventHandled(false);
+ HbTapGesture *tap = 0;
+ if (QGesture *gesture = event->gesture(Qt::TapGesture)) {
+ tap = static_cast<HbTapGesture *>(event->gesture(Qt::TapGesture));
+ if (tap->tapStyleHint() == HbTapGesture::TapAndHold) {
+ eventHandled = handleLongTap(tap->state());
+
+ } else {
+ eventHandled = handleTap(tap->state());
+ }
+ }
+
+ eventHandled ? event->accept() : event->ignore();
+}
+
+bool SvpbView::handleTap(Qt::GestureState state)
+{
+ FUNC_LOG;
+
+ if (state == Qt::GestureFinished) {
+ emit tapped();
+ return true;
+ }
+
+ return false;
+}
+
+bool SvpbView::handleLongTap(Qt::GestureState state)
+{
+ FUNC_LOG;
+
+ if (state == Qt::GestureFinished) {
+ emit longTapped();
+ return true;
+ }
+
+ return false;
+}
--- a/videocollection/tsrc/stubs/inc/hbglobal.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/hbglobal.h Fri Aug 06 09:43:48 2010 +0300
@@ -18,6 +18,9 @@
#ifndef HBGLOBAL_H
#define HBGLOBAL_H
+// need this here for forced include
+#include "xqsettingsmanagerstub.h"
+
#include <QtGlobal>
#ifdef BUILD_HB_CORE
--- a/videocollection/tsrc/stubs/inc/hblistview.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/hblistview.h Fri Aug 06 09:43:48 2010 +0300
@@ -301,6 +301,14 @@
Q_UNUSED(end);
}
+ /**
+ * Dummy method
+ */
+ void setItemPixmapCacheEnabled(bool enabled)
+ {
+ Q_UNUSED(enabled);
+ }
+
public:
/**
--- a/videocollection/tsrc/stubs/inc/hbmessagebox.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/hbmessagebox.h Fri Aug 06 09:43:48 2010 +0300
@@ -30,8 +30,12 @@
class HbMessageBox : public QObject
{
Q_OBJECT
+
+ Q_FLAGS(StandardButton StandardButtons)
+ Q_ENUMS(MessageBoxType StandardButton)
public:
+
enum MessageBoxType {
MessageTypeInformation,
MessageTypeQuestion,
@@ -56,7 +60,7 @@
};
Q_DECLARE_FLAGS(StandardButtons, StandardButton)
-
+
HbMessageBox(MessageBoxType type = MessageTypeInformation, QGraphicsItem *parent = 0);
HbMessageBox(const QString &text, MessageBoxType type = MessageTypeInformation, QGraphicsItem *parent = 0);
~HbMessageBox();
@@ -111,4 +115,6 @@
};
+Q_DECLARE_OPERATORS_FOR_FLAGS(HbMessageBox::StandardButtons)
+
#endif // HBMESSAGEBOX_H
--- a/videocollection/tsrc/stubs/inc/videocollectionviewutilsdata.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/videocollectionviewutilsdata.h Fri Aug 06 09:43:48 2010 +0300
@@ -22,6 +22,9 @@
#include <qvariant.h>
#include "videocollectioncommon.h"
+#define CENREP_NO_STRING "nostring"
+#define CENREP_NO_INT 1010100512
+
class VideoCollectionViewUtilsData
{
public: // methods
--- a/videocollection/tsrc/stubs/inc/videosortfilterproxymodeldata.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/videosortfilterproxymodeldata.h Fri Aug 06 09:43:48 2010 +0300
@@ -43,8 +43,8 @@
mGenericFilterId = TMPXItemId::InvalidId();
mGenericFilterValue = false;
mNewAlbumId = TMPXItemId::InvalidId();
- mLastAlbumNameInRename = "";
- mRenameAlbumReturnValue= 0;
+ mLastItemNameInRename = "";
+ mRenameItemReturnValue= 0;
mLastAddedAlbumName = "";
}
@@ -66,8 +66,8 @@
static TMPXItemId mGenericFilterId;
static bool mGenericFilterValue;
static TMPXItemId mNewAlbumId;
- static QString mLastAlbumNameInRename;
- static int mRenameAlbumReturnValue;
+ static QString mLastItemNameInRename;
+ static int mRenameItemReturnValue;
static QString mLastAddedAlbumName;
};
--- a/videocollection/tsrc/stubs/inc/videothumbnailtestdata.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/videothumbnailtestdata.h Fri Aug 06 09:43:48 2010 +0300
@@ -25,7 +25,7 @@
{
mInstanceCallCount = 0;
mFreeThumbnailDataCallCount = 0;
- mBackgroundThumbnailFetchingEnabled = 0;
+ mBackgroundThumbnailFetchingEnabled = false;
mStartBackgroundFetchingCallCount = 0;
mFetchIndex = -1;
}
@@ -33,7 +33,7 @@
public: // data
static int mInstanceCallCount;
static int mFreeThumbnailDataCallCount;
- static int mBackgroundThumbnailFetchingEnabled;
+ static bool mBackgroundThumbnailFetchingEnabled;
static int mStartBackgroundFetchingCallCount;
static int mFetchIndex;
};
--- a/videocollection/tsrc/stubs/inc/xqsettingsmanagerstub.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/xqsettingsmanagerstub.h Fri Aug 06 09:43:48 2010 +0300
@@ -23,7 +23,8 @@
class XQCentralRepositorySettingsKey : public QObject
{
-
+ Q_OBJECT
+
public:
XQCentralRepositorySettingsKey(int uid, int key)
@@ -33,9 +34,14 @@
}
};
-class XQSettingsManager
+class XQSettingsManager : QObject
{
-
+ Q_OBJECT
+
+public:
+ XQSettingsManager();
+ ~XQSettingsManager();
+
enum Type
{
TypeVariant = 0,
@@ -46,13 +52,9 @@
};
public:
- QVariant readItemValue(XQCentralRepositorySettingsKey &key, int type)
- {
- Q_UNUSED(key);
- Q_UNUSED(type);
- return QVariant();
- }
+ QVariant readItemValue(XQCentralRepositorySettingsKey &key, int type);
+ static QVariant mReadItemValueReturnValue;
};
#endif // XQSETTINGSMANAGER_H
--- a/videocollection/tsrc/stubs/src/videocollectionviewutils.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/tsrc/stubs/src/videocollectionviewutils.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -107,9 +107,13 @@
Q_UNUSED(key);
if(VideoCollectionViewUtilsData::mCenRepStringValues.count() > 0)
{
- return VideoCollectionViewUtilsData::mCenRepStringValues.takeFirst();;
+ QString str = VideoCollectionViewUtilsData::mCenRepStringValues.takeFirst();
+ if(str != CENREP_NO_STRING)
+ {
+ return str;
+ }
}
- return -1;
+ return QString();
}
int VideoCollectionViewUtils::getCenRepIntValue(int key)
@@ -117,7 +121,11 @@
Q_UNUSED(key);
if(VideoCollectionViewUtilsData::mCenRepIntValues.count() > 0)
{
- return VideoCollectionViewUtilsData::mCenRepIntValues.takeFirst();;
+ int value = VideoCollectionViewUtilsData::mCenRepIntValues.takeFirst();;
+ if(value != CENREP_NO_INT)
+ {
+ return value;
+ }
}
return -1;
}
--- a/videocollection/tsrc/stubs/src/videolistdatamodel.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/tsrc/stubs/src/videolistdatamodel.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -75,10 +75,9 @@
return 0;
}
-int VideoListDataModel::connectSignals()
+void VideoListDataModel::connectSignals()
{
// not stubbed
- return 0;
}
void VideoListDataModel::disconnectSignals()
--- a/videocollection/tsrc/stubs/src/videolistselectiondialog.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/tsrc/stubs/src/videolistselectiondialog.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -41,6 +41,8 @@
mListContainer(0),
mForcedCheck(false),
mModel(0),
+ mModelReady(false),
+ mAlbumListReady(false),
mListWidget(0),
mPrimaryAction(0),
mSecondaryAction(0)
@@ -124,6 +126,11 @@
// not stubbed
}
+void VideoListSelectionDialog::albumListReadySlot()
+{
+ // not stubbed
+}
+
void VideoListSelectionDialog::updateCounterSlot()
{
// not stubbed
--- a/videocollection/tsrc/stubs/src/videolistview.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/tsrc/stubs/src/videolistview.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -76,6 +76,11 @@
// not stubbed
}
+void VideoListView::albumListReadySlot()
+{
+ // not stubbed
+}
+
void VideoListView::layoutChangedSlot()
{
// not stubbed
@@ -91,6 +96,11 @@
VideoListViewData::mBackCount++;
}
+void VideoListView::modelReady()
+{
+ // not stubbed
+}
+
void VideoListView::cleanup()
{
// not stubbed
--- a/videocollection/tsrc/stubs/src/videooperatorservice.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/tsrc/stubs/src/videooperatorservice.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -42,7 +42,10 @@
VideoOperatorService::VideoOperatorService(QObject *parent) :
QObject(parent)
{
- // not stubbed
+ mTitle = "";
+ mIconResource = "";
+ mServiceUri = "";
+ mApplicationUid = 0;
}
// ---------------------------------------------------------------------------
@@ -51,12 +54,6 @@
//
bool VideoOperatorService::load(int titleKey, int iconKey, int serviceUriKey, int appUidKey)
{
- // not stubbed
- Q_UNUSED(titleKey);
- Q_UNUSED(iconKey);
- Q_UNUSED(serviceUriKey);
- Q_UNUSED(appUidKey);
-
VideoOperatorServiceData::mLoadCallCount++;
if(VideoOperatorServiceData::mTitles.count() > 0)
@@ -111,7 +108,6 @@
void VideoOperatorService::launchService()
{
VideoOperatorServiceData::mLaunchServiceCallCount++;
- // not stubbed
}
// ---------------------------------------------------------------------------
@@ -123,7 +119,6 @@
Q_UNUSED(uid);
Q_UNUSED(viewId);
VideoOperatorServiceData::mLaunchApplicationLCallCount++;
- // not stubbed
}
// End of file.
--- a/videocollection/tsrc/stubs/src/videosortfilterproxymodel.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/tsrc/stubs/src/videosortfilterproxymodel.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -39,8 +39,8 @@
TMPXItemId VideoSortFilterProxyModelData::mGenericFilterId = TMPXItemId::InvalidId();
bool VideoSortFilterProxyModelData::mGenericFilterValue = false;
TMPXItemId VideoSortFilterProxyModelData::mNewAlbumId = TMPXItemId::InvalidId();
-QString VideoSortFilterProxyModelData::mLastAlbumNameInRename;
-int VideoSortFilterProxyModelData::mRenameAlbumReturnValue = 0;
+QString VideoSortFilterProxyModelData::mLastItemNameInRename = "";
+int VideoSortFilterProxyModelData::mRenameItemReturnValue = 0;
QString VideoSortFilterProxyModelData::mLastAddedAlbumName = "";
VideoSortFilterProxyModel::VideoSortFilterProxyModel(VideoCollectionCommon::TModelType type, QObject *parent):
@@ -159,12 +159,6 @@
// not stubbed
}
-void VideoSortFilterProxyModel::itemModifiedSlot(const TMPXItemId &itemId)
-{
- Q_UNUSED(itemId);
- // not stubbed
-}
-
bool VideoSortFilterProxyModel::lessThan(const QModelIndex &left,
const QModelIndex &right) const
{
@@ -281,15 +275,15 @@
VideoSortFilterProxyModelData::mLastItemId = albumId;
}
-int VideoSortFilterProxyModel::renameAlbum(const TMPXItemId &albumId, const QString &newTitle)
+int VideoSortFilterProxyModel::renameItem(const TMPXItemId &itemId, const QString &newTitle)
{
if(VideoSortFilterProxyModelData::mRemoveItemsFromAlbumReturnValue >= 0)
{
- VideoSortFilterProxyModelData::mLastItemId = albumId;
- VideoSortFilterProxyModelData::mLastAlbumNameInRename = newTitle;
+ VideoSortFilterProxyModelData::mLastItemId = itemId;
+ VideoSortFilterProxyModelData::mLastItemNameInRename = newTitle;
}
- return VideoSortFilterProxyModelData::mRenameAlbumReturnValue;
+ return VideoSortFilterProxyModelData::mRenameItemReturnValue;
}
TMPXItemId VideoSortFilterProxyModel::getOpenItem() const
--- a/videocollection/tsrc/stubs/src/videothumbnaildata.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/tsrc/stubs/src/videothumbnaildata.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -21,7 +21,7 @@
int VideoThumbnailTestData::mInstanceCallCount = 0;
int VideoThumbnailTestData::mFreeThumbnailDataCallCount = 0;
-int VideoThumbnailTestData::mBackgroundThumbnailFetchingEnabled = 0;
+bool VideoThumbnailTestData::mBackgroundThumbnailFetchingEnabled = false;
int VideoThumbnailTestData::mStartBackgroundFetchingCallCount = 0;
int VideoThumbnailTestData::mFetchIndex = -1;
@@ -72,6 +72,11 @@
VideoThumbnailTestData::mBackgroundThumbnailFetchingEnabled = enable;
}
+bool VideoThumbnailData::backgroundFetchingEnabled()
+{
+ return VideoThumbnailTestData::mBackgroundThumbnailFetchingEnabled;
+}
+
void VideoThumbnailData::enableThumbnailCreation(bool enable)
{
Q_UNUSED(enable);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/stubs/src/xqsettingsmanagerstub.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -0,0 +1,37 @@
+/**
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "xqsettingsmanagerstub.h"
+
+QVariant XQSettingsManager::mReadItemValueReturnValue = QVariant();
+
+QVariant XQSettingsManager::readItemValue(XQCentralRepositorySettingsKey &key, int type)
+{
+ Q_UNUSED(key);
+ Q_UNUSED(type);
+ return mReadItemValueReturnValue;
+}
+
+XQSettingsManager::XQSettingsManager()
+{
+
+}
+
+XQSettingsManager::~XQSettingsManager()
+{
+
+}
--- a/videocollection/tsrc/stubs/stubs.pro Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/tsrc/stubs/stubs.pro Fri Aug 06 09:43:48 2010 +0300
@@ -135,7 +135,8 @@
src/videoserviceurifetch.cpp \
src/videoservicebrowse.cpp \
src/videoactivitystate.cpp \
- src/videooperatorservice.cpp
+ src/videooperatorservice.cpp \
+ src/xqsettingsmanagerstub.cpp
HEADERS += $$find(HEADERS_TEMP, ^(?!.*$$TESTEDCLASS).*$)
SOURCES += $$find(SOURCES_TEMP, ^(?!.*$$TESTEDCLASS).*$)
--- a/videocollection/videocollectionview/data/videocollectionview.qrc Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionview/data/videocollectionview.qrc Fri Aug 06 09:43:48 2010 +0300
@@ -1,7 +1,7 @@
<RCC>
<qresource prefix="/layout" >
<file alias="collectionview.docml">collectionview.docml.bin</file>
- <file alias="videolistselectiondialog.docml">videolistselectiondialog.docml</file>
+ <file alias="videolistselectiondialog.docml">videolistselectiondialog.docml.bin</file>
</qresource>
<qresource prefix="/style" >
<file>hbdialog.css</file>
--- a/videocollection/videocollectionview/data/videolistselectiondialog.docml Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionview/data/videolistselectiondialog.docml Fri Aug 06 09:43:48 2010 +0300
@@ -1,7 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hbdocument version="1.0">
+<hbdocument version="1.1">
<widget name="mMultiSelectionDialog" type="VideoListSelectionDialog">
- <widget name="mHeadingWidget" role="HbDialog:headingWidget" type="HbWidget">
+ <sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Expanding" verticalStretch="0"/>
+ <sizehint height="var(hb-param-screen-height)" type="PREFERRED" width="var(hb-param-screen-width)"/>
+ <widget name="contentContainer" role="HbDialog:contentWidget" type="HbWidget">
+ <widget name="mListContainer" type="HbStackedWidget">
+ <sizehint height="23.8806un" type="PREFERRED" width="23.8806un"/>
+ </widget>
<widget name="mHeadingLabel" type="HbLabel">
<sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="0"/>
<sizehint height="3.9un" type="PREFERRED" width="47.04478un"/>
@@ -15,7 +20,7 @@
<sizehint height="4un" type="MINIMUM"/>
</widget>
<widget name="mCheckBoxText" type="HbLabel">
- <enums name="alignment" value="AlignLeft|AlignLeading"/>
+ <enums name="alignment" value="AlignAbsolute|AlignLeft|AlignVCenter|AlignLeading"/>
<sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="0"/>
<sizehint height="3.9un" type="PREFERRED" width="25.22703un"/>
<string locid="txt_videos_setlabel_mark_all" name="plainText" value="Mark All"/>
@@ -43,23 +48,14 @@
<anchoritem dst="mCheckMarkAll" dstEdge="LEFT" spacing="-1.19403un" src="" srcEdge="LEFT"/>
</layout>
</widget>
- <real name="z" value="0"/>
- <contentsmargins bottom="1un" left="0un" right="0un" top="1un"/>
- <layout type="anchor">
- <anchoritem dst="mCheckBoxContainer" dstEdge="LEFT" spacing="1un" src="" srcEdge="LEFT"/>
- <anchoritem dst="mCheckBoxContainer" dstEdge="TOP" spacing="0.5un" src="mHeadingLabel" srcEdge="BOTTOM"/>
- <anchoritem dst="mCheckBoxContainer" dstEdge="RIGHT" spacing="-1un" src="" srcEdge="RIGHT"/>
- <anchoritem dst="mCheckBoxContainer" dstEdge="BOTTOM" spacing="0.5un" src="" srcEdge="BOTTOM"/>
- <anchoritem dst="mHeadingLabel" dstEdge="LEFT" spacing="1un" src="" srcEdge="LEFT"/>
- <anchoritem dst="mHeadingLabel" dstEdge="TOP" spacing="0.5un" src="" srcEdge="TOP"/>
- <anchoritem dst="mHeadingLabel" dstEdge="RIGHT" spacing="-1un" src="" srcEdge="RIGHT"/>
+ <layout orientation="Vertical" type="linear">
+ <linearitem itemname="mHeadingLabel"/>
+ <linearitem itemname="mCheckBoxContainer"/>
+ <linearitem itemname="mListContainer"/>
</layout>
</widget>
- <widget name="mListContainer" role="HbDialog:contentWidget" type="HbStackedWidget"/>
- <sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Expanding" verticalStretch="0"/>
- <sizehint height="var(hb-param-screen-height)" type="PREFERRED" width="var(hb-param-screen-width)"/>
</widget>
- <metadata activeUIState="Common ui state" display="NHD portrait" unit="un">
+ <metadata activeUIState="Common ui state" display="NHD-3.2-inch_portrait" unit="un">
<uistate name="Common ui state" sections="#common"/>
</metadata>
</hbdocument>
--- a/videocollection/videocollectionview/inc/videolistselectiondialog.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionview/inc/videolistselectiondialog.h Fri Aug 06 09:43:48 2010 +0300
@@ -128,15 +128,16 @@
void singleItemSelectedSlot(const QModelIndex &index);
/**
- * handles model ready signal from model.
- * In case dialog type is ESelectCollection and there are no data
- * in model, opens up a selection dialog for user to input new album name
- * In case type is something else than ESelectCollection, calls
- * updateCounterSlot()
+ * Handles model ready signal from model.
*/
void modelReadySlot();
/**
+ * Handles album list ready signal from model.
+ */
+ void albumListReadySlot();
+
+ /**
* Changes the counter value. Sets the checkbutton state based on selection count.
*
*/
@@ -266,6 +267,16 @@
*/
VideoSortFilterProxyModel *mModel;
+ /**
+ * Boolean to know if the model is ready or not.
+ */
+ bool mModelReady;
+
+ /**
+ * Boolean to know if album list is ready or not.
+ */
+ bool mAlbumListReady;
+
/**
* List widget to show in selection
*/
--- a/videocollection/videocollectionview/inc/videolistview.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionview/inc/videolistview.h Fri Aug 06 09:43:48 2010 +0300
@@ -127,7 +127,12 @@
* slot is connected to model's modelReady -signal
*/
void modelReadySlot();
-
+
+ /**
+ * slot is connected to model's albumListReady -signal
+ */
+ void albumListReadySlot();
+
/**
* slot is connected to plugin's doDelayeds -signal
*
@@ -272,6 +277,11 @@
private:
/**
+ * Convenience method that modelReadySlot and albumListReadySlot calls.
+ */
+ void modelReady();
+
+ /**
* Cleans all possibly created objects from this. In some cases there are no quarantees
* that they were created correctly, and thus is better to start again from clean slate.
*/
--- a/videocollection/videocollectionview/src/videolistselectiondialog.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionview/src/videolistselectiondialog.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 30 %
+// Version : %version: 30.1.2 %
// INCLUDE FILES
#include <qgraphicsitem.h>
@@ -86,6 +86,8 @@
, mListContainer( 0 )
, mForcedCheck( false )
, mModel( 0 )
+ , mModelReady( false )
+ , mAlbumListReady( false )
, mListWidget( 0 )
, mPrimaryAction( 0 )
, mSecondaryAction( 0 )
@@ -303,6 +305,9 @@
}
mPrimaryAction->setText(primaryTxt);
+
+ mModelReady = false;
+ mAlbumListReady = false;
if(mTypeOfSelection == ESelectCollection)
{
@@ -346,10 +351,10 @@
// scroll list back to top
mListWidget->scrollTo(mModel->index(0, 0));
+ connectSignals();
+
if(mModel->rowCount())
{
- connectSignals();
-
if(mTypeOfSelection == ECreateCollection)
{
// note this does not leak memory as the dialog will destroy itself upon close.
@@ -362,7 +367,8 @@
HbDialog::open();
}
}
- else
+ else if((mModelReady && mTypeOfSelection != ESelectCollection) ||
+ (mAlbumListReady && mTypeOfSelection == ESelectCollection))
{
INFO("VideoListSelectionDialog::exec(): nothing to show, finishing.")
// no items, finish right away
@@ -389,6 +395,8 @@
mTypeOfSelection = EAddToCollection;
if(mSelectedAlbumId == TMPXItemId::InvalidId())
{
+ close(); // closes selection dialog if it's open.
+
// note this does not leak memory as the dialog will destroy itself upon close.
HbInputDialog *dialog = gCreateNewAlbumNameDialog(SELECTION_DIALOG_OBJECT_NAME_NEW_COLLECTION);
dialog->open(this, SLOT(newAlbumNameDialogFinished(HbAction *)));
@@ -420,7 +428,7 @@
if(dialog->actions().first() == action && variant.isValid())
{
QString text = mModel->resolveAlbumName(variant.toString());
- if(text.length())
+ if(!text.isEmpty())
{
if(mSelectedVideos.count() == 0)
{
@@ -434,6 +442,16 @@
finalize(text);
}
}
+ else
+ {
+ // new album name empty, effectively cancel, so disconnect signals.
+ disconnectSignals();
+ }
+ }
+ else
+ {
+ // new album dialog cancelled, disconnect signals.
+ disconnectSignals();
}
}
@@ -586,18 +604,68 @@
void VideoListSelectionDialog::modelReadySlot()
{
FUNC_LOG;
+ mModelReady = true;
+
+ if(mTypeOfSelection != ESelectCollection)
+ {
+ if(!mModel->rowCount())
+ {
+ // no items, finish right away
+ INFO("VideoListSelectionDialog::modelReadySlot(): nothing to show, finishing.");
+
+ if(mTypeOfSelection == EAddToCollection ||
+ mTypeOfSelection == ERemoveFromCollection)
+ {
+ primaryActionTriggeredSlot();
+ }
+ else
+ {
+ finishedSlot(mPrimaryAction);
+ }
+
+ return;
+ }
+
+ // if dialog is not yet visible, bring it visible.
+ if(!isVisible() && mTypeOfSelection != ECreateCollection)
+ {
+ // scroll list back to top
+ mListWidget->scrollTo(mModel->index(0, 0));
+
+ HbDialog::open();
+ }
+
+ updateCounterSlot();
+ }
+}
+
+// ---------------------------------------------------------------------------
+// albumListReadySlot
+// ---------------------------------------------------------------------------
+//
+void VideoListSelectionDialog::albumListReadySlot()
+{
+ mAlbumListReady = true;
+
if(mTypeOfSelection == ESelectCollection)
{
if(!mModel->rowCount())
{
- // in case there are no user defined albums,
- // start input dialog right away by accepting dialog
- INFO("VideoListSelectionDialog::selectionChangedSlot(): no albums, starting album creation.")
- mPrimaryAction->trigger();
+ finishedSlot(mPrimaryAction);
return;
}
+
+ // if dialog is not yet visible, bring it visible.
+ if(!isVisible())
+ {
+ // scroll list back to top
+ mListWidget->scrollTo(mModel->index(0, 0));
+
+ HbDialog::open();
+ }
+
+ updateCounterSlot();
}
- updateCounterSlot();
}
// ---------------------------------------------------------------------------
@@ -639,11 +707,12 @@
connect(mPrimaryAction, SIGNAL(triggered()), this, SLOT(close()));
// update video items selection here before content changes.
- int count = mSelection.indexes().count();
+ QModelIndexList indexes = mSelection.indexes();
+ int count = indexes.count();
TMPXItemId id = TMPXItemId::InvalidId();
for(int i = 0; i < count; ++i)
{
- id = mModel->getMediaIdAtIndex(mSelection.indexes().at(i));
+ id = mModel->getMediaIdAtIndex(indexes.at(i));
if(id.iId2 == KVcxMvcMediaTypeVideo)
{
mSelectedVideos.insert(id);
@@ -685,8 +754,9 @@
this, SLOT(selectionChangedSlot(const QItemSelection&, const QItemSelection &)));
// model changes signals
- connect(mModel->sourceModel(), SIGNAL(modelReady()), this, SLOT(modelReadySlot()));
- connect(mModel->sourceModel(), SIGNAL(modelChanged()), this, SLOT(updateCounterSlot()));
+ connect(mModel->sourceModel(), SIGNAL(modelReady()), this, SLOT(modelReadySlot()));
+ connect(mModel->sourceModel(), SIGNAL(albumListReady()), this, SLOT(albumListReadySlot()));
+ connect(mModel->sourceModel(), SIGNAL(modelChanged()), this, SLOT(updateCounterSlot()));
// mark all state changes
connect(mCheckBox, SIGNAL(stateChanged(int)), this, SLOT(markAllStateChangedSlot(int)));
@@ -709,6 +779,7 @@
// model changes signals
disconnect(mModel->sourceModel(), SIGNAL(modelReady()), this, SLOT(modelReadySlot()));
+ disconnect(mModel->sourceModel(), SIGNAL(albumListReady()), this, SLOT(albumListReadySlot()));
disconnect(mModel->sourceModel(), SIGNAL(modelChanged()), this, SLOT(updateCounterSlot()));
// mark all state changes
--- a/videocollection/videocollectionview/src/videolistview.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionview/src/videolistview.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 113.1.4 %
+// Version : %version: 113.1.5 %
// INCLUDE FILES
#include <xqserviceutil.h>
@@ -350,7 +350,10 @@
this, SLOT(layoutChangedSlot())) ||
!connect(
mCurrentList->getModel()->sourceModel(), SIGNAL(modelReady()),
- this, SLOT(modelReadySlot())))
+ this, SLOT(modelReadySlot())) ||
+ !connect(
+ mCurrentList->getModel()->sourceModel(), SIGNAL(albumListReady()),
+ this, SLOT(albumListReadySlot())))
{
ERROR(-1, "VideoListView::activateView() failed to connect signals.");
// deactivate view so we get rid of dangling connections.
@@ -388,20 +391,28 @@
{
FUNC_LOG;
- // if mModelReady is false, then it means that this is the first time modelReady
- // signal fires. Signaling that view is ready.
- if(!mViewReady)
+ // check that current list is all videos or collection content.
+ VideoCollectionCommon::TCollectionLevels level = mCurrentList->getLevel();
+ if(level != VideoCollectionCommon::ELevelCategory)
{
- mViewReady = true;
- emit viewReady();
+ modelReady();
}
-
- mModelReady = true;
+}
+
+// ---------------------------------------------------------------------------
+// albumListReadySlot
+// ---------------------------------------------------------------------------
+//
+void VideoListView::albumListReadySlot()
+{
+ FUNC_LOG;
- // since the reset signal arrives after
- // layout changed, need to make sure that
- // view is updated in case needed
- layoutChangedSlot();
+ // check that current list is category list.
+ VideoCollectionCommon::TCollectionLevels level = mCurrentList->getLevel();
+ if(level == VideoCollectionCommon::ELevelCategory)
+ {
+ modelReady();
+ }
}
// ---------------------------------------------------------------------------
@@ -473,6 +484,30 @@
}
// ---------------------------------------------------------------------------
+// modelReady()
+// ---------------------------------------------------------------------------
+//
+void VideoListView::modelReady()
+{
+ FUNC_LOG;
+
+ // if mViewReady is false, then it means that this is the first time
+ // modelReady or albumListReady signal fires. Signaling that view is ready.
+ if(!mViewReady)
+ {
+ mViewReady = true;
+ emit viewReady();
+ }
+
+ mModelReady = true;
+
+ // since the reset signal arrives after
+ // layout changed, need to make sure that
+ // view is updated in case needed
+ layoutChangedSlot();
+}
+
+// ---------------------------------------------------------------------------
// cleanup()
// ---------------------------------------------------------------------------
//
--- a/videocollection/videocollectionview/src/videolistwidget.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionview/src/videolistwidget.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -151,6 +151,7 @@
connect(this, SIGNAL(fileUri(const QString&)), mVideoServices, SLOT(itemSelected(const QString&)));
}
+ setItemPixmapCacheEnabled(true);
setModel(mModel);
return 0;
@@ -544,6 +545,7 @@
mContextMenuActions[EActionDelete]->setVisible(true);
mContextMenuActions[EActionPlay]->setVisible(true);
mContextMenuActions[EActionDetails]->setVisible(true);
+ mContextMenuActions[EActionRename]->setVisible(true);
}
else if(mCurrentLevel == VideoCollectionCommon::ELevelCategory)
{
@@ -561,6 +563,7 @@
mContextMenuActions[EActionDelete]->setVisible(true);
mContextMenuActions[EActionPlay]->setVisible(true);
mContextMenuActions[EActionDetails]->setVisible(true);
+ mContextMenuActions[EActionRename]->setVisible(true);
}
}
@@ -790,9 +793,8 @@
QModelIndex index = currentIndex();
QVariant variant = mModel->data(index, VideoCollectionCommon::KeyTitle);
- TMPXItemId itemId = mModel->getMediaIdAtIndex(index);
-
- if(variant.isValid() && itemId.iId2 == KVcxMvcMediaTypeAlbum)
+
+ if(variant.isValid())
{
QString label(hbTrId("txt_videos_title_enter_name"));
QString albumName = variant.toString();
@@ -815,26 +817,34 @@
Q_UNUSED(action);
HbInputDialog *dialog = static_cast<HbInputDialog*>(sender());
-
+ if(dialog->actions().first() != action)
+ {
+ return;
+ }
QModelIndex index = currentIndex();
TMPXItemId itemId = mModel->getMediaIdAtIndex(index);
QVariant newNameVariant = dialog->value();
QVariant oldNameVariant = mModel->data(index, VideoCollectionCommon::KeyTitle);
-
- if(dialog->actions().first() == action &&
- oldNameVariant.isValid() && newNameVariant.isValid() && itemId.iId2 == KVcxMvcMediaTypeAlbum)
+ if(!newNameVariant.isValid() || !oldNameVariant.isValid())
+ {
+ // invalid data at index
+ return;
+ }
+ QString newAlbumName = newNameVariant.toString().trimmed();
+ QString oldAlbumName = oldNameVariant.toString();
+ if(!newAlbumName.length() || newAlbumName == oldAlbumName)
{
- QString newAlbumName = newNameVariant.toString();
- QString oldAlbumName = oldNameVariant.toString();
-
- if(newAlbumName.length() && newAlbumName.trimmed() != oldAlbumName)
- {
- // Resolve collection true name and rename the album
- newAlbumName = mModel->resolveAlbumName(newAlbumName);
- mModel->renameAlbum(itemId, newAlbumName);
- }
+ // no new name provided or name has not changed
+ return;
}
+ if(itemId.iId2 == KVcxMvcMediaTypeAlbum)
+ {
+ // for album, we need to make sure name is unique
+ newAlbumName = mModel->resolveAlbumName(newAlbumName);
+ }
+ mModel->renameItem(itemId, newAlbumName);
}
+
// ---------------------------------------------------------------------------
// addToCollectionSlot
// ---------------------------------------------------------------------------
@@ -1009,8 +1019,15 @@
void VideoListWidget::fetchThumbnailsForVisibleItems()
{
FUNC_LOG_ADDR(this);
+
+ // No need to do anything if thumbnail fetching is not enabled.
+ if(!VideoThumbnailData::instance().backgroundFetchingEnabled())
+ {
+ return;
+ }
+
const QList<HbAbstractViewItem *> itemsVisible = visibleItems();
-
+
if(itemsVisible.count() > 0)
{
int row = itemsVisible.value(0)->modelIndex().row();
--- a/videocollection/videocollectionview/src/videooperatorservice.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionview/src/videooperatorservice.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -57,7 +57,7 @@
mApplicationUid = utils.getCenRepIntValue(appUidKey);
// Icon is required, either service uri or application uid is required.
- if(mIconResource.isEmpty() && (mServiceUri.isEmpty() || mApplicationUid > 0))
+ if(mIconResource.isEmpty() || (mServiceUri.isEmpty() && mApplicationUid <= 0))
{
return false;
}
@@ -93,7 +93,7 @@
if(!mServiceUri.isEmpty())
{
- INFO_1("VideoOperatorService::launchService() starting url: %S", mServiceUri);
+ INFOQSTR_1("VideoOperatorService::launchService() starting url: %S", mServiceUri);
QDesktopServices::openUrl(QUrl(mServiceUri));
}
else
--- a/videocollection/videocollectionview/tsrc/testlistview/inc/testlistview.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionview/tsrc/testlistview/inc/testlistview.h Fri Aug 06 09:43:48 2010 +0300
@@ -194,6 +194,11 @@
*/
void testRemoveVideosFromCollectionSlot();
+ /**
+ * Tests createOperatorServicesToolbar
+ */
+ void testCreateOperatorServicesToolbar();
+
signals:
// Signals needed in tests.
--- a/videocollection/videocollectionview/tsrc/testlistview/src/testlistview.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionview/tsrc/testlistview/src/testlistview.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 50 %
+// Version : %version: 51 %
#define private public
#include "videoservices.h"
@@ -64,6 +64,7 @@
#include "videolistdatamodeldata.h"
#include "xqserviceutilxtra.h"
#include "videooperatorservicedata.h"
+#include "videooperatorservice.h"
// ---------------------------------------------------------------------------
// main
@@ -799,10 +800,8 @@
void TestListView::testOpenOperatorServiceSlot()
{
init();
-
TMPXItemId tmpId = TMPXItemId::InvalidId();
mTestView->activateView(tmpId);
-
VideoOperatorServiceData::mLaunchServiceCallCount = 0;
connect(this, SIGNAL(testSignal2()), mTestView, SLOT(openOperatorServiceSlot()));
emit testSignal2();
@@ -1752,4 +1751,61 @@
cleanup();
}
+// ---------------------------------------------------------------------------
+// testCreateOperatorServicesToolbar
+// ---------------------------------------------------------------------------
+//
+void TestListView::testCreateOperatorServicesToolbar()
+{
+ // Only one service.
+ init();
+ HbToolBarExtension::mAddActionCallCount = 0;
+ VideoOperatorServiceData::mIcons.clear();
+ VideoOperatorServiceData::mUris.clear();
+ VideoOperatorServiceData::mIcons.append("qtg_mono_ovistore");
+ VideoOperatorServiceData::mUris.append("testuri");
+ QCOMPARE(mTestView->mVideoOperatorServices.count(), 0);
+ TMPXItemId tmpId = TMPXItemId::InvalidId();
+ mTestView->activateView(tmpId);
+ QCOMPARE(mTestView->mVideoOperatorServices.count(), 1);
+ QVERIFY(mTestView->mToolbarActions[VideoListView::ETBActionServices] != 0);
+ QVERIFY(mTestView->mToolbarServiceExtension == 0);
+ QCOMPARE(HbToolBarExtension::mAddActionCallCount, 0);
+ cleanup();
+
+ // Multiple, 3, services
+ init();
+ HbToolBarExtension::mAddActionCallCount = 0;
+ VideoOperatorServiceData::mIcons.clear();
+ VideoOperatorServiceData::mUris.clear();
+ VideoOperatorServiceData::mIcons.append("qtg_mono_ovistore");
+ VideoOperatorServiceData::mUris.append("testuri");
+ VideoOperatorServiceData::mIcons.append("qtg_mono_ovistore2");
+ VideoOperatorServiceData::mUris.append("testuri2");
+ VideoOperatorServiceData::mIcons.append("qtg_mono_ovistore3");
+ VideoOperatorServiceData::mUris.append("testuri3");
+ QCOMPARE(mTestView->mVideoOperatorServices.count(), 0);
+ tmpId = TMPXItemId::InvalidId();
+ mTestView->activateView(tmpId);
+ QCOMPARE(mTestView->mVideoOperatorServices.count(), 3);
+ QVERIFY(mTestView->mToolbarActions[VideoListView::ETBActionServices] == 0);
+ QVERIFY(mTestView->mToolbarServiceExtension != 0);
+ QCOMPARE(HbToolBarExtension::mAddActionCallCount, 3);
+ cleanup();
+
+ // Services already loaded.
+ init();
+ VideoOperatorServiceData::mIcons.clear();
+ VideoOperatorServiceData::mUris.clear();
+ VideoOperatorServiceData::mIcons.append("qtg_mono_ovistore");
+ VideoOperatorServiceData::mUris.append("testuri");
+ mTestView->mVideoOperatorServices.append(new VideoOperatorService());
+ mTestView->activateView(tmpId);
+ QCOMPARE(mTestView->mVideoOperatorServices.count(), 1);
+ QVERIFY(mTestView->mToolbarActions[VideoListView::ETBActionServices] == 0);
+ QVERIFY(mTestView->mToolbarServiceExtension == 0);
+ cleanup();
+
+}
+
// End of file
--- a/videocollection/videocollectionview/tsrc/testlistwidget/src/testlistwidget.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionview/tsrc/testlistwidget/src/testlistwidget.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 58 %
+// Version : %version: 60 %
#include <qmap.h>
#include <vcxmyvideosdefs.h>
@@ -771,7 +771,7 @@
}
++iter;
}
- QVERIFY(visibleCount == 4);
+ QVERIFY(visibleCount == 5);
// invalid amount of actions -> invalid items gets removed
HbAction *nullAction = 0;
@@ -853,7 +853,7 @@
}
++iter;
}
- QVERIFY(visibleCount == 4);
+ QVERIFY(visibleCount == 5);
// service does exists
// object needs to be resetted for the service use
@@ -1017,7 +1017,7 @@
mTestWidget->initialize(*model);
// Good case
- VideoSortFilterProxyModelData::mLastAlbumNameInRename = "";
+ VideoSortFilterProxyModelData::mLastItemNameInRename = "";
HbInputDialog::mValueReturnValue = "renamedVideo";
HbInputDialog::mValueCallCount = 0;
HbInputDialog::mOpenCallCount = 0;
@@ -1028,21 +1028,21 @@
mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex());
emit testSignal();
dialog->emitDialogFinished(mTestWidget, SLOT(renameDialogFinished(HbAction *)), 0);
- QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == "renamedVideo");
+
QCOMPARE(HbInputDialog::mOpenCallCount, 1);
QVERIFY(HbInputDialog::mValueCallCount == 1);
-
- // New name is same as previous
- HbInputDialog::mValueReturnValue = "";
+
+ // New name is same as previous
+ HbInputDialog::mValueReturnValue = "albumName";
HbInputDialog::mValueCallCount = 0;
HbInputDialog::mOpenCallCount = 0;
- VideoSortFilterProxyModelData::mLastAlbumNameInRename = "";
+ VideoSortFilterProxyModelData::mLastItemNameInRename = "";
data = QString("albumName");
VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data);
mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex());
emit testSignal();
dialog->emitDialogFinished(mTestWidget, SLOT(renameDialogFinished(HbAction *)), 0);
- QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == "");
+ QVERIFY(VideoSortFilterProxyModelData::mLastItemNameInRename == "");
QCOMPARE(HbInputDialog::mOpenCallCount, 1);
QVERIFY(HbInputDialog::mValueCallCount == 1);
@@ -1050,18 +1050,18 @@
HbInputDialog::mValueReturnValue = "";
HbInputDialog::mValueCallCount = 0;
HbInputDialog::mOpenCallCount = 0;
- VideoSortFilterProxyModelData::mLastAlbumNameInRename = "";
+ VideoSortFilterProxyModelData::mLastItemNameInRename = "";
data = QString("albumName");
VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data);
mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex());
emit testSignal();
dialog->emitDialogFinished(mTestWidget, SLOT(renameDialogFinished(HbAction *)), 1);
- QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == "");
+ QVERIFY(VideoSortFilterProxyModelData::mLastItemNameInRename == "");
QCOMPARE(HbInputDialog::mOpenCallCount, 1);
- QVERIFY(HbInputDialog::mValueCallCount == 1);
+ QVERIFY(HbInputDialog::mValueCallCount == 0);
// New name is empty.
- VideoSortFilterProxyModelData::mLastAlbumNameInRename = "";
+ VideoSortFilterProxyModelData::mLastItemNameInRename = "";
HbInputDialog::mValueReturnValue = "";
HbInputDialog::mValueCallCount = 0;
HbInputDialog::mOpenCallCount = 0;
@@ -1070,28 +1070,29 @@
mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex());
emit testSignal();
dialog->emitDialogFinished(mTestWidget, SLOT(renameDialogFinished(HbAction *)), 0);
- QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == "");
+ QVERIFY(VideoSortFilterProxyModelData::mLastItemNameInRename == "");
QCOMPARE(HbInputDialog::mOpenCallCount, 1);
QVERIFY(HbInputDialog::mValueCallCount == 1);
// Item is video
VideoSortFilterProxyModelData::mItemIds.clear();
VideoSortFilterProxyModelData::mItemIds.append(TMPXItemId(0, KVcxMvcMediaTypeVideo));
- VideoSortFilterProxyModelData::mLastAlbumNameInRename = "";
- HbInputDialog::mValueReturnValue = "";
+ VideoSortFilterProxyModelData::mLastItemNameInRename = "";
+ HbInputDialog::mValueReturnValue = "renamedVideo";
HbInputDialog::mValueCallCount = 0;
HbInputDialog::mOpenCallCount = 0;
- data = QString("albumName");
+ data = QString("oldVideoNama");
VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data);
mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex());
emit testSignal();
- QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == "");
- QCOMPARE(HbInputDialog::mOpenCallCount, 0);
- QVERIFY(HbInputDialog::mValueCallCount == 0);
+ dialog->emitDialogFinished(mTestWidget, SLOT(renameDialogFinished(HbAction *)), 0);
+ QCOMPARE(HbInputDialog::mOpenCallCount, 1);
+ QVERIFY(HbInputDialog::mValueCallCount == 1);
+ QVERIFY(VideoSortFilterProxyModelData::mLastItemNameInRename == "renamedVideo");
// No model
- VideoSortFilterProxyModelData::mLastAlbumNameInRename = "";
- HbInputDialog::mValueReturnValue = "renamedVideo";
+ VideoSortFilterProxyModelData::mLastItemNameInRename = "";
+ HbInputDialog::mValueReturnValue = "";
HbInputDialog::mValueCallCount = 0;
HbInputDialog::mOpenCallCount = 0;
VideoSortFilterProxyModelData::mItemIds.clear();
@@ -1103,11 +1104,11 @@
mTestWidget->mModel = 0;
emit testSignal();
mTestWidget->mModel = tmp;
- QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == "");
+ QVERIFY(VideoSortFilterProxyModelData::mLastItemNameInRename == "");
QCOMPARE(HbInputDialog::mOpenCallCount, 0);
// Variant data is invalid
- VideoSortFilterProxyModelData::mLastAlbumNameInRename = "";
+ VideoSortFilterProxyModelData::mLastItemNameInRename = "";
HbInputDialog::mValueReturnValue = "renamedVideo";
HbInputDialog::mValueCallCount = 0;
HbInputDialog::mOpenCallCount = 0;
@@ -1117,7 +1118,7 @@
VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data);
mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex());
emit testSignal();
- QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == "");
+ QVERIFY(VideoSortFilterProxyModelData::mLastItemNameInRename == "");
QCOMPARE(HbInputDialog::mOpenCallCount, 0);
disconnect(this, SIGNAL(testSignal()), mTestWidget, SLOT(renameSlot()));
@@ -1417,7 +1418,7 @@
}
// ---------------------------------------------------------------------------
-// testScrollingEndedSlot
+// testScrollingStartedSlot
// ---------------------------------------------------------------------------
//
void TestListWidget::testScrollingStartedSlot()
@@ -1426,7 +1427,6 @@
emit testSignal();
-
disconnect(this, SIGNAL(testSignal()), mTestWidget, SLOT(scrollingStartedSlot()));
}
@@ -1436,6 +1436,7 @@
//
void TestListWidget::testScrollingEndedSlot()
{
+ VideoThumbnailTestData::mBackgroundThumbnailFetchingEnabled = true;
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
@@ -1511,7 +1512,17 @@
void TestListWidget::testScrollPositionTimerSlot()
{
connect(this, SIGNAL(testSignal()), mTestWidget, SLOT(scrollPositionTimerSlot()));
+
+ VideoThumbnailTestData::mStartBackgroundFetchingCallCount = 0;
+ VideoThumbnailTestData::mBackgroundThumbnailFetchingEnabled = true;
emit testSignal();
+ QCOMPARE(VideoThumbnailTestData::mStartBackgroundFetchingCallCount, 1);
+
+ VideoThumbnailTestData::mStartBackgroundFetchingCallCount = 0;
+ VideoThumbnailTestData::mBackgroundThumbnailFetchingEnabled = false;
+ emit testSignal();
+ QCOMPARE(VideoThumbnailTestData::mStartBackgroundFetchingCallCount, 0);
+
disconnect(this, SIGNAL(testSignal()), mTestWidget, SLOT(scrollPositionTimerSlot()));
}
@@ -1534,6 +1545,7 @@
}
// Test
+ VideoThumbnailTestData::mBackgroundThumbnailFetchingEnabled = true;
QModelIndex parent;
mTestWidget->callRowsInserted(parent, 0, 0);
QVERIFY(VideoThumbnailTestData::mStartBackgroundFetchingCallCount == 1);
@@ -1559,6 +1571,7 @@
}
// Test
+ VideoThumbnailTestData::mBackgroundThumbnailFetchingEnabled = true;
QModelIndex parent;
mTestWidget->callRowsRemoved(parent, 0, 0);
QVERIFY(VideoThumbnailTestData::mStartBackgroundFetchingCallCount == 1);
--- a/videocollection/videocollectionview/tsrc/testvideocollectionviewutils/src/testvideocollectionviewutils.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionview/tsrc/testvideocollectionviewutils/src/testvideocollectionviewutils.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -15,6 +15,7 @@
*
*/
+#include <qdebug.h>
#include <qapplication.h>
#include "xqsettingsmanagerstub.h"
#include <vcxmyvideosdefs.h>
@@ -32,6 +33,7 @@
#include "hblistview.h"
#include <hbactivitymanager.h>
#include <hbapplication.h>
+#include <xqsettingsmanagerstub.h>
#define private public
#include "videocollectionviewutils.h"
@@ -376,7 +378,9 @@
// -----------------------------------------------------------------------------
//
void TestVideoVideoCollectionViewUtils::testLoadSortingValues()
-{
+{
+ CRepository::setSetFail(255);
+
CRepository::mSortValues[KVideoSortingRoleKey] = VideoCollectionCommon::KeyDateTime;
CRepository::mSortValues[KVideoSortingOrderKey] = Qt::DescendingOrder;
CRepository::mSortValues[KCollectionsSortingRoleKey] = VideoCollectionCommon::KeyTitle;
@@ -524,7 +528,15 @@
//
void TestVideoVideoCollectionViewUtils::testGetCenRepStringValue()
{
+ VideoCollectionViewUtils &testObject(VideoCollectionViewUtils::instance());
+
+ // Invalid
+ XQSettingsManager::mReadItemValueReturnValue = QVariant();
+ QVERIFY(testObject.getCenRepStringValue(0) == "");
+ // Ok
+ XQSettingsManager::mReadItemValueReturnValue = QVariant("test");
+ QVERIFY(testObject.getCenRepStringValue(0) == "test");
}
// -----------------------------------------------------------------------------
@@ -533,7 +545,15 @@
//
void TestVideoVideoCollectionViewUtils::testGetCenRepIntValue()
{
+ VideoCollectionViewUtils &testObject(VideoCollectionViewUtils::instance());
+
+ // Invalid
+ XQSettingsManager::mReadItemValueReturnValue = QVariant();
+ QVERIFY(testObject.getCenRepIntValue(0) == -1);
+ // Ok
+ XQSettingsManager::mReadItemValueReturnValue = QVariant(13);
+ QVERIFY(testObject.getCenRepIntValue(0) == 13);
}
// -----------------------------------------------------------------------------
@@ -603,6 +623,8 @@
//
void TestVideoVideoCollectionViewUtils::testSortModel()
{
+ CRepository::setGetFail(255);
+
VideoCollectionViewUtils &testObject(VideoCollectionViewUtils::instance());
testObject.mVideosSortRole = -1;
testObject.mVideosSortOrder = Qt::AscendingOrder;
@@ -759,6 +781,3 @@
}
// End of file
-
-
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/videocollectionview/tsrc/testvideooperatorservice/inc/testvideooperatorservice.h Fri Aug 06 09:43:48 2010 +0300
@@ -0,0 +1,56 @@
+/**
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: tests for VideoOperatorService
+*
+*/
+
+#ifndef TESTVIDEOOPERATORSERVICE_H
+#define TESTVIDEOCOLLECTIONUILOADER_H
+
+// INCLUDES
+#include <qttest/qttest>
+
+// FORWARD DECLARATIONS
+class VideoOperatorService;
+
+class TestVideoOperatorService : public QObject
+{
+ Q_OBJECT
+
+public:
+ TestVideoOperatorService();
+ virtual ~TestVideoOperatorService();
+
+private slots: // test functions for the test framework
+ void init();
+
+ void cleanup();
+
+private slots:
+
+ void testLoad();
+ void testTitle();
+ void testIconResource();
+ void testLaunchService();
+
+signals:
+
+private:
+ /** class under test */
+ VideoOperatorService *mTestObject;
+
+
+};
+
+#endif//TESTVIDEOCOLLECTIONUILOADER_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/videocollectionview/tsrc/testvideooperatorservice/src/testvideooperatorservice.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -0,0 +1,167 @@
+/**
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: tests for VideoOperatorService
+*
+*/
+
+#include <hbapplication.h>
+#include <hbmainwindow.h>
+#include <hbinstance.h>
+#include <qdebug.h>
+
+#include "testvideooperatorservice.h"
+#include "videocollectionviewutilsdata.h"
+
+#define private public
+#include "videooperatorservice.h"
+#include "videooperatorservicedata.h"
+#undef private
+
+int main(int argc, char *argv[])
+{
+ HbApplication app(argc, argv);
+ HbMainWindow window;
+ TestVideoOperatorService tv;
+ int res;
+ if (argc > 1)
+ {
+ res = QTest::qExec(&tv, argc, argv);
+ }
+ else
+ {
+ char *pass[3];
+ pass[0] = argv[0];
+ pass[1] = "-o";
+ pass[2] = "c:\\data\\testvideooperatorservice.txt";
+ res = QTest::qExec(&tv, 3, pass);
+ }
+
+ return res;
+}
+
+TestVideoOperatorService::TestVideoOperatorService():
+ mTestObject(0)
+{
+
+}
+
+TestVideoOperatorService::~TestVideoOperatorService()
+{
+ cleanup();
+}
+
+// ---------------------------------------------------------------------------
+// init
+// ---------------------------------------------------------------------------
+//
+void TestVideoOperatorService::init()
+{
+ // create test object
+ if (!mTestObject)
+ {
+ mTestObject = new VideoOperatorService;
+ }
+}
+
+// ---------------------------------------------------------------------------
+// cleanup
+// ---------------------------------------------------------------------------
+//
+void TestVideoOperatorService::cleanup()
+{
+ // delete test object
+ delete mTestObject;
+ mTestObject = 0;
+}
+
+// TEST CASES START ----------------------------------------------------------
+
+// ---------------------------------------------------------------------------
+// testLoad
+// ---------------------------------------------------------------------------
+//
+void TestVideoOperatorService::testLoad()
+{
+ // Good case
+ VideoCollectionViewUtilsData::mCenRepStringValues.append("test title");
+ VideoCollectionViewUtilsData::mCenRepStringValues.append("test icon");
+ VideoCollectionViewUtilsData::mCenRepStringValues.append("test uri");
+ VideoCollectionViewUtilsData::mCenRepIntValues.append(5050);
+ QVERIFY(mTestObject->load(0, 0, 0, 0) == true);
+ QVERIFY(mTestObject->mTitle == "test title");
+ QVERIFY(mTestObject->mIconResource == "test icon");
+ QVERIFY(mTestObject->mServiceUri == "test uri");
+ QCOMPARE(mTestObject->mApplicationUid, 5050);
+
+ // Only icon is defined for service.
+ VideoCollectionViewUtilsData::mCenRepStringValues.append(CENREP_NO_STRING);
+ VideoCollectionViewUtilsData::mCenRepStringValues.append("test icon");
+ QVERIFY(mTestObject->load(0, 0, 0, 0) == false);
+ QVERIFY(mTestObject->mTitle == "");
+ QVERIFY(mTestObject->mIconResource == "test icon");
+ QVERIFY(mTestObject->mServiceUri == "");
+ QCOMPARE(mTestObject->mApplicationUid, -1);
+
+ // Only icon and uri are defined for service.
+ VideoCollectionViewUtilsData::mCenRepStringValues.append(CENREP_NO_STRING);
+ VideoCollectionViewUtilsData::mCenRepStringValues.append("test icon");
+ VideoCollectionViewUtilsData::mCenRepStringValues.append("test uri");
+ QVERIFY(mTestObject->load(0, 0, 0, 0) == true);
+ QVERIFY(mTestObject->mTitle == "");
+ QVERIFY(mTestObject->mIconResource == "test icon");
+ QVERIFY(mTestObject->mServiceUri == "test uri");
+ QCOMPARE(mTestObject->mApplicationUid, -1);
+
+ // Only icon and app uid are defined for service.
+ VideoCollectionViewUtilsData::mCenRepStringValues.append(CENREP_NO_STRING);
+ VideoCollectionViewUtilsData::mCenRepStringValues.append("test icon");
+ VideoCollectionViewUtilsData::mCenRepIntValues.append(5050);
+ QVERIFY(mTestObject->load(0, 0, 0, 0) == true);
+ QVERIFY(mTestObject->mTitle == "");
+ QVERIFY(mTestObject->mIconResource == "test icon");
+ QVERIFY(mTestObject->mServiceUri == "");
+ QCOMPARE(mTestObject->mApplicationUid, 5050);
+}
+
+// ---------------------------------------------------------------------------
+// testTitle
+// ---------------------------------------------------------------------------
+//
+void TestVideoOperatorService::testTitle()
+{
+ mTestObject->mTitle = "test title";
+ QVERIFY(mTestObject->title() == "test title");
+}
+
+// ---------------------------------------------------------------------------
+// testIconResource
+// ---------------------------------------------------------------------------
+//
+void TestVideoOperatorService::testIconResource()
+{
+ mTestObject->mIconResource = "test icon";
+ QVERIFY(mTestObject->iconResource() == "test icon");
+}
+
+// ---------------------------------------------------------------------------
+// test
+// ---------------------------------------------------------------------------
+//
+void TestVideoOperatorService::testLaunchService()
+{
+ mTestObject->mApplicationUid = 0;
+ mTestObject->launchService();
+}
+
+// end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/videocollectionview/tsrc/testvideooperatorservice/testvideooperatorservice.pro Fri Aug 06 09:43:48 2010 +0300
@@ -0,0 +1,60 @@
+#
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+TEMPLATE = app
+
+TARGET =
+
+DEPENDPATH += . \
+ inc \
+ src \
+ ../../../tsrc/stubs
+
+INCLUDEPATH += . \
+ inc \
+ ../../../tsrc/stubs/inc \
+ \ # keep these at bottom so that stub headers are taken first
+ ../../../inc \
+ ../../../videocollectionview/inc \
+ ../../../videocollectionwrapper/inc \
+ ../../../../inc \
+ ../../../../videoplayerapp/inc \
+ ../../../../videoplayerapp/videoplayerengine/inc
+
+CONFIG += qtestlib \
+ hb
+
+LIBS += -lestor.dll \
+ -lfbscli.dll \
+ -lbitgdi.dll \
+ -lgdi.dll \
+ -lcentralrepository.dll \
+ -lxqservice.dll \
+ -lxqserviceutil.dll \
+ -lapparc \
+ -lapgrfx \
+ -lws32 \
+ -lcone
+
+HEADERS += inc/testvideooperatorservice.h \
+ ../../../videocollectionview/inc/videooperatorservice.h
+
+SOURCES += src/testvideooperatorservice.cpp \
+ \ # sources needed in test
+ ../../../videocollectionview/src/videooperatorservice.cpp
+
+TESTEDCLASS = videooperatorservice
+include(../../../tsrc/stubs/stubs.pro)
--- a/videocollection/videocollectionview/videocollectionview.pro Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionview/videocollectionview.pro Fri Aug 06 09:43:48 2010 +0300
@@ -72,7 +72,8 @@
src/videolistselectiondialog.cpp \
src/videooperatorservice.cpp
-DOCML += data/collectionview.docml
+DOCML += data/collectionview.docml \
+ data/videolistselectiondialog.docml
RESOURCES += data/videocollectionview.qrc
--- a/videocollection/videocollectionwrapper/inc/videocollectionclient.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/inc/videocollectionclient.h Fri Aug 06 09:43:48 2010 +0300
@@ -140,7 +140,7 @@
* @param aMediaId id of the item
* @return KErrNone if ok
*/
- int openItem(TMPXItemId &mediaId);
+ int openItem(const TMPXItemId &mediaId);
/**
* calls collection to go back to collection level
@@ -157,7 +157,7 @@
*
* @return 0 media fetchingstarted ok
*/
- int fetchMpxMediaByMpxId(TMPXItemId &aMpxId);
+ int fetchMpxMediaByMpxId(const TMPXItemId &aMpxId);
/**
* Gets all details for the selected MPX Media object.
@@ -167,7 +167,7 @@
*
* @return 0 if detail fetching started ok
*/
- int getVideoDetails(TMPXItemId& aMediaId);
+ int getVideoDetails(const TMPXItemId& aMediaId);
/**
* Add a new album.
@@ -192,7 +192,7 @@
* @param mediaIds, Items which to add.
* @return 0 if no errors.
*/
- int addItemsInAlbum(TMPXItemId &albumId, const QList<TMPXItemId> &mediaIds);
+ int addItemsInAlbum(const TMPXItemId &albumId, const QList<TMPXItemId> &mediaIds);
/**
* Removes items from existing album.
@@ -201,16 +201,16 @@
* @param mediaIds, Items which to remove.
* @return 0 if no errors.
*/
- int removeItemsFromAlbum(TMPXItemId &albumId, const QList<TMPXItemId> &mediaIds);
+ int removeItemsFromAlbum(const TMPXItemId &albumId, const QList<TMPXItemId> &mediaIds);
/**
- * Renames an album.
+ * Renames a video or user defined collection item.
*
- * @param albumId, Album to be renamed.
+ * @param itemId, id of item to be renamed.
* @param newTitle, New title for the album.
* @return 0 if no errors.
*/
- int renameAlbum(const TMPXItemId &albumId, const QString &newTitle);
+ int renameItem(const TMPXItemId &itemId, const QString &newTitle);
private:
@@ -232,14 +232,14 @@
*
* @param videoId id of the video to open
*/
- void openVideoL(TMPXItemId &videoId);
+ void openVideoL(const TMPXItemId &videoId);
/**
* Private implementation to handle leaving code of collection opening.
*
* @param id id of the collection to open
*/
- void openCategoryL(TMPXItemId &id);
+ void openCategoryL(const TMPXItemId &id);
/**
* Private implementation to handle leaving code of collection back stepping.
@@ -253,7 +253,7 @@
*
* @param videoId id of the video to get details from
*/
- void getVideoDetailsL(TMPXItemId &videoId);
+ void getVideoDetailsL(const TMPXItemId &videoId);
/**
* Removes user created albums.
@@ -268,7 +268,7 @@
*
* @param mpxId mpxif for the video object to fetch from collection
*/
- void fetchMpxMediaByMpxIdL(TMPXItemId &mpxId);
+ void fetchMpxMediaByMpxIdL(const TMPXItemId &mpxId);
/**
* Create a new album.
@@ -285,7 +285,7 @@
* @param mediaIds, Items to add in the album.
* @return None.
*/
- void addItemsInAlbumL(TMPXItemId &albumId, const QList<TMPXItemId> &mediaIds);
+ void addItemsInAlbumL(const TMPXItemId &albumId, const QList<TMPXItemId> &mediaIds);
/**
* Removes items from an album.
@@ -294,16 +294,16 @@
* @param mediaIds, Items to remove from album.
* @return None.
*/
- void removeItemsFromAlbumL(TMPXItemId &albumId, const QList<TMPXItemId> &mediaIds);
+ void removeItemsFromAlbumL(const TMPXItemId &albumId, const QList<TMPXItemId> &mediaIds);
/**
- * Renames an album.
+ * Renames a media item.
*
- * @param albumId, Album to be renamed.
+ * @param itemId, Album to be renamed.
* @param newTitle, New title for the album.
* @return None.
*/
- void renameAlbumL(const TMPXItemId &albumId, const QString newTitle);
+ void renameL(const TMPXItemId &itemId, const QString newTitle);
private:
--- a/videocollection/videocollectionwrapper/inc/videodatacontainer.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/inc/videodatacontainer.h Fri Aug 06 09:43:48 2010 +0300
@@ -72,7 +72,7 @@
* object is not found from wanted index
*
*/
- CMPXMedia* fromIndex(int index) const;
+ CMPXMedia* fromIndex(const int &index) const;
/**
* Returns an index of id.
@@ -81,7 +81,7 @@
*
* @return int index of item or -1 if item with provided id is not found
*/
- int indexOfId(const TMPXItemId &id) const;
+ const int& indexOfId(const TMPXItemId &id) const;
/**
* Returns id of item from provided index
@@ -90,7 +90,7 @@
*
* @return id of item or invalid TMPXItemId if item is not found from provided index
*/
- TMPXItemId idFromIndex(int index) const;
+ const TMPXItemId& idFromIndex(const int &index) const;
/**
* returns count of items
@@ -111,7 +111,7 @@
* @param inteIndex index of item
* @return TMPXItemId id of the item marked as removed
*/
- TMPXItemId markItemRemoved(const int &itemIndex);
+ const TMPXItemId markItemRemoved(const int &itemIndex);
/**
* Method removes provided items from mRemovedMedia
@@ -136,7 +136,7 @@
*
* @param itemId id of item to be returned
*/
- CMPXMedia* getRemovedMedia(TMPXItemId itemId);
+ CMPXMedia* getRemovedMedia(TMPXItemId &itemId);
private:
@@ -148,7 +148,7 @@
*
* @param fromindex - index from where to start decreasing
*/
- void decIndexesAfter(int fromIndex);
+ void decIndexesAfter(const int &fromIndex);
private: // data
--- a/videocollection/videocollectionwrapper/inc/videodatasignalreceiver.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/inc/videodatasignalreceiver.h Fri Aug 06 09:43:48 2010 +0300
@@ -73,7 +73,7 @@
*
* @param itemId item id
*/
- virtual void itemDeletedSlot( TMPXItemId itemId ) = 0;
+ virtual void itemDeletedSlot( TMPXItemId &itemId ) = 0;
/**
* Signaled when multiple video deletion command is completed.
@@ -103,7 +103,7 @@
* @param albumId, Album which items are received.
* @param albumItems, Items belonging to the current album.
*/
- virtual void albumListAvailableSlot(TMPXItemId albumId,
+ virtual void albumListAvailableSlot(TMPXItemId &albumId,
CMPXMediaArray *albumItems) = 0;
/**
@@ -114,9 +114,14 @@
virtual void itemModifiedSlot(const TMPXItemId &itemId) = 0;
/**
- * Signalled when list is complete.
+ * Signalled when video list is complete.
*/
- virtual void listCompleteSlot() = 0;
+ virtual void videoListCompleteSlot() = 0;
+
+ /**
+ * Signalled when album list is complete.
+ */
+ virtual void albumListCompleteSlot() = 0;
};
#endif // __VIDEOMODELOBSERVER_H
--- a/videocollection/videocollectionwrapper/inc/videodeleteworker.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/inc/videodeleteworker.h Fri Aug 06 09:43:48 2010 +0300
@@ -134,9 +134,9 @@
/**
* Emitted if some delete startup fails.
*
- * @param list of item ids whose edletion does not start
+ * @param list of item ids whose deletion does not start
*/
- void deleteStartupFailed(QList<TMPXItemId>);
+ void deleteStartupFailed(QList<TMPXItemId>&);
private:
--- a/videocollection/videocollectionwrapper/inc/videolistdatamodel.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/inc/videolistdatamodel.h Fri Aug 06 09:43:48 2010 +0300
@@ -86,7 +86,7 @@
* @param index index of the item to be opened
* @return TMPXItemId item id or TMPXItemId::Invalid() if no valid item.
*/
- TMPXItemId mediaIdAtIndex(int index) const;
+ const TMPXItemId& mediaIdAtIndex(const int &index) const;
/**
* returns model index of id provided
@@ -94,7 +94,7 @@
* @param id of the item
* @return modelIndex
*/
- QModelIndex indexOfId(TMPXItemId id);
+ QModelIndex indexOfId(const TMPXItemId &id);
/**
* Method calls video list data to check if there are valid media object
@@ -103,7 +103,7 @@
* @param mediaId id of the item to be opened
* @return QString file path of the media at index, empty string if not valid item.
*/
- QString mediaFilePathForId(TMPXItemId mediaId) const;
+ QString mediaFilePathForId(const TMPXItemId &mediaId) const;
/**
* Called by the client when removal of videos are requested.
@@ -131,14 +131,14 @@
* @param albumId, Album to set in use.
* @return None.
*/
- void setAlbumInUse(TMPXItemId albumId);
+ void setAlbumInUse(const TMPXItemId &albumId);
/**
* returns album id currently in use
*
* @return TMPXItemId
*/
- TMPXItemId albumInUse();
+ const TMPXItemId& albumInUse() const;
/**
* removes provided items from provided album id and calls
@@ -149,7 +149,7 @@
*
* @return count of items removed or -1 if failed
*/
- int removeItemsFromAlbum(TMPXItemId &albumId, const QList<TMPXItemId> &items);
+ int removeItemsFromAlbum(const TMPXItemId &albumId, const QList<TMPXItemId> &items);
public: // from QAbstractItemModel
@@ -214,12 +214,17 @@
* @param id of the video item
*/
void shortDetailsReady(TMPXItemId id);
-
+
/**
* Signals that the model is ready, ie. loaded all data from
* myvideocollection.
*/
void modelReady();
+
+ /**
+ * Signals that all albums have been loaded from myvideoscollection.
+ */
+ void albumListReady();
/**
* Signal to be emitted when something has happened in the
@@ -231,11 +236,6 @@
* Signals that album content has been updated.
*/
void albumChanged();
-
- /**
- * Signals that item data has changed.
- */
- void itemModified(const TMPXItemId &itemId);
private slots:
@@ -244,14 +244,14 @@
*
* @param ids list of ids whose deletion fails
*/
- void deleteStartingFailsSlot(QList<TMPXItemId> ids);
+ void deleteStartingFailsSlot(QList<TMPXItemId>& ids);
private:
/**
- * Method connects signals emitted from or throught this object
+ * Method connects signals used for delete worker
*/
- int connectSignals();
+ void connectSignals();
/**
* method disconnects signals
@@ -269,7 +269,7 @@
*
* @return QString detail string
*/
- QString prepareDetailRow(int index) const;
+ QString prepareDetailRow(int &index) const;
/**
* Formats a detail row string for the video item
@@ -283,7 +283,7 @@
*
* @return QString detail string
*/
- QString doDetailRow(int index) const;
+ QString doDetailRow(int &index) const;
/**
* Generates a video count string for category or album at given index.
@@ -296,7 +296,7 @@
*
* @return QString video count string
*/
- QString prepareVideoCountString(int index) const;
+ QString prepareVideoCountString(int &index) const;
/**
* Generates a video size string from video item at given index
@@ -308,7 +308,7 @@
*
* @return QString size string
*/
- QString prepareSizeString(int index) const;
+ QString prepareSizeString(int &index) const;
/**
* Called when there are status changes in some async operation
--- a/videocollection/videocollectionwrapper/inc/videolistdatamodel_p.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/inc/videolistdatamodel_p.h Fri Aug 06 09:43:48 2010 +0300
@@ -76,24 +76,6 @@
*/
int initialize();
-signals:
-
- /**
- * This signal is emitted, when data to some video item changes.
- * Like for example new thumbnail is fetched.
- *
- * @param startIndex
- * @param endIndex
- *
- */
- void dataChanged(const QModelIndex &startIndex, const QModelIndex &endIndex);
-
- /**
- * This signal is emitted, collection notifies details for item has been
- * fetched and provides a QMap of the details'.
- */
- void videoDetailsReady(QVariant &);
-
private slots:
/**
@@ -105,7 +87,7 @@
* @param mediaIds: media ids of the items
*
*/
- void thumbnailsFetchedSlot(QList<TMPXItemId> mediaIds);
+ void thumbnailsFetchedSlot(QList<TMPXItemId> &mediaIds);
private slots: //slots from VideoDataSignalReceiver
@@ -143,7 +125,7 @@
*
* @param itemId id of the removed item
*/
- void itemDeletedSlot(TMPXItemId itemId);
+ void itemDeletedSlot(TMPXItemId &itemId);
/**
* Signaled by the collection client video deletion request
@@ -175,7 +157,7 @@
* @param albumId, Album which items are received.
* @param albumItems, Items belonging to the current album.
*/
- void albumListAvailableSlot(TMPXItemId albumId, CMPXMediaArray *albumItems);
+ void albumListAvailableSlot(TMPXItemId &albumId, CMPXMediaArray *albumItems);
/**
* Signalled when item has been mofidied.
@@ -185,9 +167,14 @@
void itemModifiedSlot(const TMPXItemId &itemId);
/**
- * Signalled when list is complete.
+ * Signalled when video list is complete.
*/
- void listCompleteSlot();
+ void videoListCompleteSlot();
+
+ /**
+ * Signalled when album list is complete.
+ */
+ void albumListCompleteSlot();
public: // services
@@ -206,7 +193,7 @@
*
* @return TMPXItemId item id or invalid TMPXItemId if id not found at that index
*/
- TMPXItemId getMediaIdFromIndex(int index) const;
+ const TMPXItemId& getMediaIdFromIndex(const int &index) const;
/**
* Returns name of the video from the given index.
@@ -216,7 +203,7 @@
*
* @return QString name of the item
*/
- const QString getVideoNameFromIndex(int index) const;
+ const QString getVideoNameFromIndex(const int &index) const;
/**
* Returns the thumbnail of the item from given index.
@@ -227,7 +214,7 @@
*
* @return QIcon thumbnail of the item
*/
- const QIcon* getVideoThumbnailFromIndex(int index) const;
+ const QIcon* getVideoThumbnailFromIndex(const int &index) const;
/**
* Returns the value for item count attribute from given index.
@@ -237,7 +224,7 @@
*
* @return guint32 size in bytes
*/
- quint32 getCategoryVideoCountFromIndex( int index ) const;
+ quint32 getCategoryVideoCountFromIndex(const int &index ) const;
/**
* Returns the size of the video from given index.
@@ -247,7 +234,7 @@
*
* @return guint32 size in bytes
*/
- quint32 getVideoSizeFromIndex(int index) const;
+ quint32 getVideoSizeFromIndex(const int &index) const;
/**
* Returns the age profile of the video from given index
@@ -257,7 +244,7 @@
*
* @return quint32 age profile in bytes
*/
- quint32 getVideoAgeProfileFromIndex(int index) const;
+ quint32 getVideoAgeProfileFromIndex(const int &index) const;
/**
* Returns the duration of the video from given index.
@@ -267,7 +254,7 @@
*
* @return guint32 duration
*/
- quint32 getVideodurationFromIndex(int index) const;
+ quint32 getVideodurationFromIndex(const int &index) const;
/**
* Returns the duration of the video from given media.
@@ -285,7 +272,7 @@
*
* @return QDate date
*/
- QDateTime getVideoDateFromIndex(int index) const;
+ QDateTime getVideoDateFromIndex(const int &index) const;
/**
* Returns the creation/download date of the video
@@ -302,7 +289,7 @@
* @return TMPXItemId: id of the item marked
*
*/
- TMPXItemId markVideoRemoved(const QModelIndex &itemIndex);
+ const TMPXItemId markVideoRemoved(const QModelIndex &itemIndex);
/**
* Removes provided ids from the remove -list
@@ -317,14 +304,14 @@
*
* @param index: item position where client wants the file path from.
*/
- const QString getFilePathFromIndex(int index) const;
+ const QString getFilePathFromIndex(const int &index) const;
/**
* Returns the file path of the video.
*
* @param mediaId: id for the item
*/
- const QString getFilePathForId(TMPXItemId mediaId) const;
+ const QString getFilePathForId(const TMPXItemId &mediaId);
/**
* Checks if the specified item belongs to currently open album.
@@ -341,7 +328,7 @@
* @param albumId, Album to set in use.
* @return None.
*/
- void setAlbumInUse(TMPXItemId albumId);
+ void setAlbumInUse(const TMPXItemId &albumId);
/**
* removes provided items from album provided
@@ -351,7 +338,7 @@
*
* @return count of item removed;
*/
- int removeItemsFromAlbum(TMPXItemId &albumId, const QList<TMPXItemId> &items);
+ int removeItemsFromAlbum(const TMPXItemId &albumId, const QList<TMPXItemId> &items);
private: // private methods
@@ -403,21 +390,21 @@
* @param albumId id of album
* @param videoarray array of videos in album
*/
- void albumDataChangedL(TMPXItemId albumId, CMPXMediaArray *videoArray);
+ void albumDataChangedL(TMPXItemId &albumId, CMPXMediaArray *videoArray);
/**
* Called when an album has been removed.
*
* @param albumId, Album which items are received.
*/
- void albumRemoved(TMPXItemId albumId);
+ void albumRemoved(TMPXItemId &albumId);
/**
* Called when a video has been removed.
*
* @param videoId id of the removed video
*/
- void videoDeleted(TMPXItemId videoId);
+ void videoDeleted(TMPXItemId &videoId);
private:
--- a/videocollection/videocollectionwrapper/inc/videosortfilterproxymodel.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/inc/videosortfilterproxymodel.h Fri Aug 06 09:43:48 2010 +0300
@@ -132,7 +132,7 @@
* @return TMPXItemId mpx id if succeeds TMPXItemId::InvalidId() in case of error
*
*/
- TMPXItemId getMediaIdAtIndex(const QModelIndex &index) const;
+ const TMPXItemId& getMediaIdAtIndex(const QModelIndex &index) const;
/**
* returns qmodelindex of item id provided.
@@ -140,7 +140,7 @@
* @param item id
* @return QModelIndex;
*/
- QModelIndex indexOfId(TMPXItemId id);
+ QModelIndex indexOfId(const TMPXItemId &id);
/**
* Method checks that model exists and asks for file path from
@@ -150,7 +150,7 @@
* @return QString file path if succeeds, empty string in case of error.
*
*/
- QString getMediaFilePathForId(TMPXItemId mediaId);
+ QString getMediaFilePathForId(const TMPXItemId &mediaId);
/**
* Add a new album.
@@ -188,13 +188,13 @@
int removeItemsFromAlbum(TMPXItemId &albumId, const QList<TMPXItemId> &mediaIds);
/**
- * Renames an album.
+ * Renames a video or user defined colletion.
*
- * @param itemId, Album to be renamed.
- * @param newTitle, New title for the album.
+ * @param itemId, id of item to be renamed.
+ * @param newTitle, New title for the item.
* @return 0 if no errors.
*/
- int renameAlbum(const TMPXItemId &albumId, const QString &newTitle);
+ int renameItem(const TMPXItemId &itemId, const QString &newTitle);
/**
* Resolves duplicate album names and returns the resolved name.
@@ -217,14 +217,14 @@
* @param filterValue item id used as filter
* @param filterValue
*/
- void setGenericIdFilter(TMPXItemId itemId, bool filterValue);
+ void setGenericIdFilter(const TMPXItemId &itemId, bool filterValue);
/**
* Set album in use and invalidates filtering.
*
* @param albumId album id
*/
- void setAlbumInUse(TMPXItemId albumId);
+ void setAlbumInUse(const TMPXItemId &albumId);
/**
* Gets the currently opened item.
@@ -297,12 +297,6 @@
* refiltering is required
*/
void albumChangedSlot();
-
- /**
- * signaled when data for item has changed and
- * invalidate is required.
- */
- void itemModifiedSlot(const TMPXItemId &itemId);
private:
--- a/videocollection/videocollectionwrapper/inc/videothumbnaildata.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/inc/videothumbnaildata.h Fri Aug 06 09:43:48 2010 +0300
@@ -71,7 +71,7 @@
* @return bool: true if item removed correctly, false if not.
*
*/
- bool removeThumbnail(TMPXItemId mediaId);
+ bool removeThumbnail(const TMPXItemId &mediaId);
/**
* Method returns a pointer to video's thumbnail.
@@ -85,7 +85,7 @@
* @return QIcon* thumbnail pointer
*
*/
- const QIcon* getThumbnail(TMPXItemId mediaId);
+ const QIcon* getThumbnail(const TMPXItemId &mediaId);
/**
* Starts background thumbnail fetching, the model used for the background fetching
@@ -113,6 +113,13 @@
void enableThumbnailCreation(bool enable);
/**
+ * Returns background fetching enabled status.
+ *
+ * @return bool: true if background fetching is enabled, otherwise false.
+ */
+ bool backgroundFetchingEnabled();
+
+ /**
* Frees allocated data for thumbnails and cancels ongoing fetches.
*
*/
@@ -126,7 +133,7 @@
* @param mediaIds: media ids of the videos whose thumbnail is ready.
*
*/
- void thumbnailsFetched(QList<TMPXItemId> mediaIds);
+ void thumbnailsFetched(QList<TMPXItemId>& mediaIds);
private:
--- a/videocollection/videocollectionwrapper/inc/videothumbnaildata_p.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/inc/videothumbnaildata_p.h Fri Aug 06 09:43:48 2010 +0300
@@ -68,7 +68,7 @@
* @return QIcon* thumbnail pointer
*
*/
- const QIcon* getThumbnail(TMPXItemId mediaId);
+ const QIcon* getThumbnail(const TMPXItemId &mediaId);
/**
* Method removes thumbnail data from the icon cache.
@@ -78,7 +78,7 @@
* @return bool: true if item removed correctly, false if not.
*
*/
- bool removeThumbnail(TMPXItemId mediaId);
+ bool removeThumbnail(const TMPXItemId &mediaId);
/**
* Starts background thumbnail fetching from the given fetch index.
@@ -104,6 +104,13 @@
void enableThumbnailCreation(bool enable);
/**
+ * Returns if background fetching is enabled.
+ *
+ * @return bool: true if background fetching is enabled, otherwise false.
+ */
+ bool backgroundFetchingEnabled();
+
+ /**
* Frees allocated data for thumbnails and cancels ongoing fetches.
*/
void freeThumbnailData();
@@ -159,7 +166,7 @@
* @return int: thumbnail id or -1 if fetch starting fails.
*
*/
- int startFetchingThumbnail(TMPXItemId mediaId, int priority);
+ int startFetchingThumbnail(const TMPXItemId &mediaId, int priority);
/**
* Appends indexes in the source model to the list between start and end.
@@ -168,7 +175,7 @@
* @param startIndex start index
* @param endIndex end index
*/
- void getModelIndexes(QList<QModelIndex> &indexes, int startIndex, int endIndex);
+ void getModelIndexes(QList<QModelIndex> &indexes, int &startIndex, int &endIndex);
/**
* Method returns default thumbnail data.
@@ -178,7 +185,7 @@
* @return QIcon: reference to default thumbnail data
*
*/
- const QIcon* defaultThumbnail(TMPXItemId mediaId);
+ const QIcon* defaultThumbnail(const TMPXItemId &mediaId);
/**
* Loads icon from file or resource, the icon is scaled to size of the
@@ -204,7 +211,7 @@
* @param mediaIds: media ids of the videos whose thumbnail is ready.
*
*/
- void thumbnailsFetched(QList<TMPXItemId> mediaIds);
+ void thumbnailsFetched(QList<TMPXItemId>& mediaIds);
private slots:
--- a/videocollection/videocollectionwrapper/src/videocollectionclient.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/src/videocollectionclient.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 39 %
+// Version : %version: 41 %
// INCLUDE FILES
#include <qobject.h>
@@ -208,7 +208,7 @@
// openItem
// -----------------------------------------------------------------------------
//
-int VideoCollectionClient::openItem(TMPXItemId &mediaId)
+int VideoCollectionClient::openItem(const TMPXItemId &mediaId)
{
FUNC_LOG;
if(!mCollectionUtility)
@@ -247,7 +247,7 @@
// fetchMpxMediaByMpxId
// -----------------------------------------------------------------------------
//
-int VideoCollectionClient::fetchMpxMediaByMpxId(TMPXItemId &mpxId)
+int VideoCollectionClient::fetchMpxMediaByMpxId(const TMPXItemId &mpxId)
{
FUNC_LOG;
if(!mCollectionUtility)
@@ -263,7 +263,7 @@
// getVideoDetails
// -----------------------------------------------------------------------------
//
-int VideoCollectionClient::getVideoDetails(TMPXItemId &mediaId)
+int VideoCollectionClient::getVideoDetails(const TMPXItemId &mediaId)
{
FUNC_LOG;
if(!mCollectionUtility)
@@ -319,7 +319,7 @@
// addItemsInAlbum
// -----------------------------------------------------------------------------
//
-int VideoCollectionClient::addItemsInAlbum(TMPXItemId &albumId,
+int VideoCollectionClient::addItemsInAlbum(const TMPXItemId &albumId,
const QList<TMPXItemId> &mediaIds)
{
FUNC_LOG;
@@ -338,7 +338,7 @@
// removeItemsFromAlbum
// -----------------------------------------------------------------------------
//
-int VideoCollectionClient::removeItemsFromAlbum(TMPXItemId &albumId,
+int VideoCollectionClient::removeItemsFromAlbum(const TMPXItemId &albumId,
const QList<TMPXItemId> &mediaIds)
{
FUNC_LOG;
@@ -354,19 +354,20 @@
}
// -----------------------------------------------------------------------------
-// renameAlbum
+// renameItem
// -----------------------------------------------------------------------------
//
-int VideoCollectionClient::renameAlbum(const TMPXItemId &albumId,
+int VideoCollectionClient::renameItem(const TMPXItemId &itemId,
const QString &newTitle)
{
FUNC_LOG;
int err(-1);
- if(mCollectionUtility && albumId.iId2 == KVcxMvcMediaTypeAlbum &&
- !newTitle.isEmpty())
+ if(mCollectionUtility && !newTitle.isEmpty() &&
+ (itemId.iId2 == KVcxMvcMediaTypeAlbum ||
+ itemId.iId2 == KVcxMvcMediaTypeVideo ) )
{
- TRAP(err, renameAlbumL(albumId, newTitle));
+ TRAP(err, renameL(itemId, newTitle));
}
return err;
@@ -453,7 +454,7 @@
// openVideoL
// -----------------------------------------------------------------------------
//
-void VideoCollectionClient::openVideoL(TMPXItemId &videoId)
+void VideoCollectionClient::openVideoL(const TMPXItemId &videoId)
{
FUNC_LOG;
if(!mCollectionUtility)
@@ -475,7 +476,7 @@
// openCategoryL
// -----------------------------------------------------------------------------
//
-void VideoCollectionClient::openCategoryL(TMPXItemId &id)
+void VideoCollectionClient::openCategoryL(const TMPXItemId &id)
{
FUNC_LOG;
if(!mCollectionUtility)
@@ -522,7 +523,7 @@
// getVideoDetailsL
// -----------------------------------------------------------------------------
//
-void VideoCollectionClient::getVideoDetailsL(TMPXItemId &videoId)
+void VideoCollectionClient::getVideoDetailsL(const TMPXItemId &videoId)
{
FUNC_LOG;
if(!mCollectionUtility)
@@ -628,7 +629,7 @@
// addItemsInAlbumL
// -----------------------------------------------------------------------------
//
-void VideoCollectionClient::addItemsInAlbumL(TMPXItemId &albumId,
+void VideoCollectionClient::addItemsInAlbumL(const TMPXItemId &albumId,
const QList<TMPXItemId> &mediaIds)
{
FUNC_LOG;
@@ -674,7 +675,7 @@
// removeItemsFromAlbumL
// -----------------------------------------------------------------------------
//
-void VideoCollectionClient::removeItemsFromAlbumL(TMPXItemId &albumId,
+void VideoCollectionClient::removeItemsFromAlbumL(const TMPXItemId &albumId,
const QList<TMPXItemId> &mediaIds)
{
FUNC_LOG;
@@ -716,16 +717,16 @@
}
// -----------------------------------------------------------------------------
-// renameAlbumL
+// renameL
// -----------------------------------------------------------------------------
//
-void VideoCollectionClient::renameAlbumL(const TMPXItemId &albumId, const QString newTitle)
+void VideoCollectionClient::renameL(const TMPXItemId &itemId, const QString newTitle)
{
FUNC_LOG;
CMPXMedia *media = CMPXMedia::NewL();
CleanupStack::PushL(media);
TPtrC titlePtrC(newTitle.utf16());
- media->SetTObjectValueL<TMPXItemId>(KMPXMediaGeneralId, albumId);
+ media->SetTObjectValueL<TMPXItemId>(KMPXMediaGeneralId, itemId);
media->SetTextValueL(KMPXMediaGeneralTitle, titlePtrC);
CMPXCommand* cmd = CMPXMedia::NewL();
@@ -747,7 +748,7 @@
// fetchMpxMediaByMpxIdL
// -----------------------------------------------------------------------------
//
-void VideoCollectionClient::fetchMpxMediaByMpxIdL(TMPXItemId &aMpxId)
+void VideoCollectionClient::fetchMpxMediaByMpxIdL(const TMPXItemId &aMpxId)
{
FUNC_LOG;
if(!mCollectionUtility)
--- a/videocollection/videocollectionwrapper/src/videocollectionlistener.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/src/videocollectionlistener.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 33 %
+// Version : %version: 34 %
// INCLUDE FILES
#include <mpxmediageneraldefs.h>
@@ -131,11 +131,23 @@
}
int listCompleted(-1);
- if(mVideoUtils.mediaValue<int>(&aEntries, KVcxMediaMyVideosInt32Value, listCompleted))
+
+ if(path->Levels() == VideoCollectionCommon::PathLevelCategories)
+ {
+ bool listIsPartial(false);
+ if(mVideoUtils.mediaValue<bool>(&aEntries, KVcxMediaMyVideosVideoListIsPartial, listIsPartial))
+ {
+ if(!listIsPartial)
+ {
+ mSignalReceiver.albumListCompleteSlot();
+ }
+ }
+ }
+ else if(mVideoUtils.mediaValue<int>(&aEntries, KVcxMediaMyVideosInt32Value, listCompleted))
{
if(listCompleted == EVcxMyVideosVideoListComplete)
{
- mSignalReceiver.listCompleteSlot();
+ mSignalReceiver.videoListCompleteSlot();
}
}
}
--- a/videocollection/videocollectionwrapper/src/videodatacontainer.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/src/videodatacontainer.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -14,7 +14,7 @@
* Description: VideoDataContainer class declaration*
*/
-// Version : %version: 14 %
+// Version : %version: 15 %
// INCLUDE FILES
#include <mpxmediageneraldefs.h>
@@ -25,6 +25,10 @@
#include "videocollectionutils.h"
#include "videocollectiontrace.h"
+const int INVALID_INDEX = -1;
+const TMPXItemId INVALID_ID = TMPXItemId::InvalidId();
+
+
/**
* global qHash function required fo creating hash values for TMPXItemId -keys
*/
@@ -131,7 +135,7 @@
// fromIndex
// -----------------------------------------------------------------------------
//
-CMPXMedia* VideoDataContainer::fromIndex(int index) const
+CMPXMedia* VideoDataContainer::fromIndex(const int &index) const
{
if(index >= 0 && index < mMediaIds.count() && mMediaData.contains(mMediaIds[index]))
{
@@ -144,27 +148,27 @@
// indexOfId
// -----------------------------------------------------------------------------
//
-int VideoDataContainer::indexOfId(const TMPXItemId &id) const
+const int& VideoDataContainer::indexOfId(const TMPXItemId &id) const
{
QHash<TMPXItemId, QPair<int, CMPXMedia*> >::const_iterator iter = mMediaData.find(id);
if( iter != mMediaData.constEnd())
{
return iter->first;
}
- return -1;
+ return INVALID_INDEX;
}
// -----------------------------------------------------------------------------
// idFromIndex
// -----------------------------------------------------------------------------
//
-TMPXItemId VideoDataContainer::idFromIndex(int index) const
-{
+const TMPXItemId& VideoDataContainer::idFromIndex(const int &index) const
+{
if(index >= 0 && index < mMediaIds.count())
{
- return mMediaIds[index];
+ return mMediaIds.at(index);
}
- return TMPXItemId::InvalidId();
+ return INVALID_ID;
}
// -----------------------------------------------------------------------------
@@ -180,7 +184,7 @@
// decIndexesAfter
// -----------------------------------------------------------------------------
//
-void VideoDataContainer::decIndexesAfter(int fromIndex)
+void VideoDataContainer::decIndexesAfter(const int &fromIndex)
{
int count = mMediaIds.count();
QMultiHash<TMPXItemId, QPair<int, CMPXMedia*> >::iterator hashIter;
@@ -198,7 +202,7 @@
// markItemsRemoved
// -----------------------------------------------------------------------------
//
-TMPXItemId VideoDataContainer::markItemRemoved(const int &itemIndex)
+const TMPXItemId VideoDataContainer::markItemRemoved(const int &itemIndex)
{
// for all provided indexes:
// - get item address from mMediaData
@@ -207,9 +211,9 @@
// - remove item's id from mMediaIds -list
// - append item into mRemovedMedia
// - append item's id into returned id -list
- TMPXItemId id = TMPXItemId::InvalidId();
CMPXMedia *media = 0;
- id = idFromIndex(itemIndex);
+ // get copy of id of item to be removed
+ const TMPXItemId id = idFromIndex(itemIndex);
media = fromIndex(itemIndex);
if(id == TMPXItemId::InvalidId() || !media)
{
@@ -303,7 +307,7 @@
// getRemovedMedia
// -----------------------------------------------------------------------------
//
-CMPXMedia* VideoDataContainer::getRemovedMedia(TMPXItemId itemId)
+CMPXMedia* VideoDataContainer::getRemovedMedia(TMPXItemId &itemId)
{
QHash<TMPXItemId, CMPXMedia*>::const_iterator itemIter =
mRemovedMedia.constFind(itemId);
--- a/videocollection/videocollectionwrapper/src/videolistdatamodel.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/src/videolistdatamodel.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 52 %
+// Version : %version: 52.1.2 %
// INCLUDE FILES
#include <hbglobal.h>
@@ -99,13 +99,6 @@
return -1;
}
- if(connectSignals() == -1)
- {
- ERROR(-1, "VideoListDataModel::initialize() failed to connect signals.");
- disconnectSignals();
- return -1;
- }
-
mInitialized = true;
return 0;
}
@@ -124,34 +117,16 @@
// connectSignals()
// -----------------------------------------------------------------------------
//
-int VideoListDataModel::connectSignals()
+void VideoListDataModel::connectSignals()
{
FUNC_LOG;
- if(!connect(d_ptr, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)),
- this, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&))))
- {
- return -1;
- }
- if(!connect(d_ptr, SIGNAL(videoDetailsReady(QVariant&)),
- this, SIGNAL(fullVideoDetailsReady(QVariant&))))
- {
- return -1;
- }
- if(!connect(this, SIGNAL(modelChanged()), mDeleteWorker, SLOT(continueSlot())))
- {
- return -1;
- }
- if(!connect(this, SIGNAL(modelReady()), mDeleteWorker, SLOT(continueSlot())))
- {
- return -1;
- }
- if(!connect(mDeleteWorker, SIGNAL(deleteStartupFailed(QList<TMPXItemId>)),
- this, SLOT(deleteStartingFailsSlot(QList<TMPXItemId>))))
- {
- return -1;
- }
-
- return 0;
+
+ connect(this, SIGNAL(modelChanged()), mDeleteWorker, SLOT(continueSlot()), Qt::UniqueConnection);
+
+ connect(this, SIGNAL(modelReady()), mDeleteWorker, SLOT(continueSlot()), Qt::UniqueConnection);
+
+ connect(mDeleteWorker, SIGNAL(deleteStartupFailed(QList<TMPXItemId>&)),
+ this, SLOT(deleteStartingFailsSlot(QList<TMPXItemId>&)), Qt::UniqueConnection);
}
// -----------------------------------------------------------------------------
@@ -161,37 +136,26 @@
void VideoListDataModel::disconnectSignals()
{
FUNC_LOG;
- disconnect(d_ptr, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)),
- this, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)));
- disconnect(d_ptr, SIGNAL(videoDetailsReady(QVariant&)),
- this, SIGNAL(fullVideoDetailsReady(QVariant&)));
disconnect(this, SIGNAL(modelChanged()), mDeleteWorker, SLOT(continueSlot()));
disconnect(this, SIGNAL(modelReady()), mDeleteWorker, SLOT(continueSlot()));
- disconnect(mDeleteWorker, SIGNAL(deleteStartupFailed(QList<TMPXItemId>)),
- this, SLOT(deleteStartingFailsSlot(QList<TMPXItemId>)));
+ disconnect(mDeleteWorker, SIGNAL(deleteStartupFailed(QList<TMPXItemId>&)),
+ this, SLOT(deleteStartingFailsSlot(QList<TMPXItemId>&)));
}
// -----------------------------------------------------------------------------
// mediaIdAtIndex()
// -----------------------------------------------------------------------------
//
-TMPXItemId VideoListDataModel::mediaIdAtIndex(int index) const
+const TMPXItemId& VideoListDataModel::mediaIdAtIndex(const int &index) const
{
- TMPXItemId mpxId =TMPXItemId::InvalidId();
-
- if(index >= 0 && index < d_ptr->getVideoCount())
- {
- mpxId = d_ptr->getMediaIdFromIndex(index);
- }
-
- return mpxId;
+ return d_ptr->getMediaIdFromIndex(index);
}
// -----------------------------------------------------------------------------
// indexOfId()
// -----------------------------------------------------------------------------
//
-QModelIndex VideoListDataModel::indexOfId(TMPXItemId id)
+QModelIndex VideoListDataModel::indexOfId(const TMPXItemId &id)
{
int rowIndex = d_ptr->mMediaData.indexOfId(id);
return index(rowIndex, 0, QModelIndex());
@@ -201,12 +165,9 @@
// mediaFilePathForId()
// -----------------------------------------------------------------------------
//
-QString VideoListDataModel::mediaFilePathForId(TMPXItemId mediaId) const
+QString VideoListDataModel::mediaFilePathForId(const TMPXItemId &mediaId) const
{
- QString filePath;
- filePath = d_ptr->getFilePathForId(mediaId);
-
- return filePath;
+ return d_ptr->getFilePathForId(mediaId);;
}
// -----------------------------------------------------------------------------
@@ -248,7 +209,7 @@
// prepareDetailRow()
// -----------------------------------------------------------------------------
//
-QString VideoListDataModel::prepareDetailRow(int index) const
+QString VideoListDataModel::prepareDetailRow(int &index) const
{
// TODO: download -status?
@@ -271,7 +232,7 @@
// prepareVideoCountString()
// -----------------------------------------------------------------------------
//
-QString VideoListDataModel::prepareVideoCountString(int index) const
+QString VideoListDataModel::prepareVideoCountString(int &index) const
{
QString videoCountString("");
@@ -292,7 +253,7 @@
// prepareSizeString()
// -----------------------------------------------------------------------------
//
-QString VideoListDataModel::prepareSizeString(int index) const
+QString VideoListDataModel::prepareSizeString(int &index) const
{
QString sizeStr("");
@@ -306,7 +267,7 @@
// VideoListDataModel::doDetailRow()
// -----------------------------------------------------------------------------
//
-QString VideoListDataModel::doDetailRow(int index) const
+QString VideoListDataModel::doDetailRow(int &index) const
{
QString detailStr("");
@@ -512,7 +473,8 @@
}
emit modelChanged();
if(removedIds.count() > 0 )
- {
+ {
+ connectSignals();
mDeleteWorker->requestDelete(removedIds);
return true;
}
@@ -533,7 +495,7 @@
// setAlbumInUse()
// -----------------------------------------------------------------------------
//
-void VideoListDataModel::setAlbumInUse(TMPXItemId albumId)
+void VideoListDataModel::setAlbumInUse(const TMPXItemId &albumId)
{
FUNC_LOG;
d_ptr->setAlbumInUse(albumId);
@@ -543,7 +505,7 @@
// albumInUse()
// -----------------------------------------------------------------------------
//
-TMPXItemId VideoListDataModel::albumInUse()
+const TMPXItemId& VideoListDataModel::albumInUse() const
{
FUNC_LOG;
return d_ptr->mCurrentAlbum;
@@ -553,7 +515,7 @@
// removeItemsFromAlbum()
// -----------------------------------------------------------------------------
//
-int VideoListDataModel::removeItemsFromAlbum(TMPXItemId &albumId, const QList<TMPXItemId> &items)
+int VideoListDataModel::removeItemsFromAlbum(const TMPXItemId &albumId, const QList<TMPXItemId> &items)
{
FUNC_LOG;
int removeCount = d_ptr->removeItemsFromAlbum(albumId, items);
@@ -573,7 +535,7 @@
// deleteStartingFailsSlot()
// -----------------------------------------------------------------------------
//
-void VideoListDataModel::deleteStartingFailsSlot(QList<TMPXItemId> ids)
+void VideoListDataModel::deleteStartingFailsSlot(QList<TMPXItemId>& ids)
{
FUNC_LOG;
if(ids.count())
@@ -610,6 +572,7 @@
report = true;
// delete procedure ends, reset statuses
mDeleteWorker->clearStatus();
+ disconnectSignals();
}
}
if(report)
--- a/videocollection/videocollectionwrapper/src/videolistdatamodel_p.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/src/videolistdatamodel_p.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 38.1.2 %
+// Version : %version: 38.1.6 %
// INCLUDE FILES
#include <hbglobal.h>
@@ -26,6 +26,7 @@
#include <mpxmedia.h>
#include <qvariant.h>
#include <hbextendedlocale.h>
+#include <qfileinfo.h>
#include "videolistdatamodel.h"
#include "videocollectionclient.h"
@@ -91,8 +92,8 @@
return 0;
}
mVideoThumbnailData = &(VideoThumbnailData::instance());
- if(!connect( mVideoThumbnailData, SIGNAL(thumbnailsFetched( QList<TMPXItemId> )),
- this, SLOT(thumbnailsFetchedSlot( QList<TMPXItemId> ))))
+ if(!connect( mVideoThumbnailData, SIGNAL(thumbnailsFetched( QList<TMPXItemId>& )),
+ this, SLOT(thumbnailsFetchedSlot( QList<TMPXItemId>& ))))
{
return -1;
}
@@ -114,7 +115,7 @@
// getMediaIdFromIndex
// -----------------------------------------------------------------------------
//
-TMPXItemId VideoListDataModelPrivate::getMediaIdFromIndex( int index ) const
+const TMPXItemId& VideoListDataModelPrivate::getMediaIdFromIndex(const int &index ) const
{
return mMediaData.idFromIndex(index);
}
@@ -123,7 +124,7 @@
// getVideoNameFromIndex
// -----------------------------------------------------------------------------
//
-const QString VideoListDataModelPrivate::getVideoNameFromIndex( int index ) const
+const QString VideoListDataModelPrivate::getVideoNameFromIndex(const int &index ) const
{
QString txt;
CMPXMedia* media = mMediaData.fromIndex(index);
@@ -135,7 +136,7 @@
// getVideoThumbnailFromIndex
// -----------------------------------------------------------------------------
//
-const QIcon* VideoListDataModelPrivate::getVideoThumbnailFromIndex( int index ) const
+const QIcon* VideoListDataModelPrivate::getVideoThumbnailFromIndex(const int &index ) const
{
if(mVideoThumbnailData)
{
@@ -148,7 +149,7 @@
// getCategoryVideoCountFromIndex
// -----------------------------------------------------------------------------
//
-quint32 VideoListDataModelPrivate::getCategoryVideoCountFromIndex( int index ) const
+quint32 VideoListDataModelPrivate::getCategoryVideoCountFromIndex(const int &index ) const
{
quint32 count(0);
CMPXMedia *media = mMediaData.fromIndex(index);
@@ -160,7 +161,7 @@
// getVideoSizeFromIndex
// -----------------------------------------------------------------------------
//
-quint32 VideoListDataModelPrivate::getVideoSizeFromIndex( int index ) const
+quint32 VideoListDataModelPrivate::getVideoSizeFromIndex(const int &index ) const
{
quint32 size(0);
CMPXMedia *media = mMediaData.fromIndex(index);
@@ -172,7 +173,7 @@
// getVideoAgeProfileFromIndex
// ---------------------------------------------------------------------------
//
-quint32 VideoListDataModelPrivate::getVideoAgeProfileFromIndex( int index ) const
+quint32 VideoListDataModelPrivate::getVideoAgeProfileFromIndex(const int &index ) const
{
quint32 ageProfile(0);
CMPXMedia *media = mMediaData.fromIndex(index);
@@ -184,7 +185,7 @@
// getVideodurationFromIndex
// -----------------------------------------------------------------------------
//
-quint32 VideoListDataModelPrivate::getVideodurationFromIndex( int index ) const
+quint32 VideoListDataModelPrivate::getVideodurationFromIndex(const int &index ) const
{
CMPXMedia *media = mMediaData.fromIndex(index);
return getVideoDuration(media);
@@ -207,7 +208,7 @@
// getVideoDateFromIndex
// -----------------------------------------------------------------------------
//
-QDateTime VideoListDataModelPrivate::getVideoDateFromIndex( int index ) const
+QDateTime VideoListDataModelPrivate::getVideoDateFromIndex(const int &index ) const
{
return getVideoDate(mMediaData.fromIndex(index));
}
@@ -234,7 +235,7 @@
// markVideosRemoved
// -----------------------------------------------------------------------------
//
-TMPXItemId VideoListDataModelPrivate::markVideoRemoved(const QModelIndex &itemIndex)
+const TMPXItemId VideoListDataModelPrivate::markVideoRemoved(const QModelIndex &itemIndex)
{
return mMediaData.markItemRemoved(itemIndex.row());
}
@@ -259,7 +260,7 @@
// getFilePathFromIndex
// -----------------------------------------------------------------------------
//
-const QString VideoListDataModelPrivate::getFilePathFromIndex(int index) const
+const QString VideoListDataModelPrivate::getFilePathFromIndex(const int &index) const
{
QString filePath;
VideoCollectionUtils::instance().mediaValue<QString>(mMediaData.fromIndex(index),
@@ -271,7 +272,7 @@
// getFilePathForId
// -----------------------------------------------------------------------------
//
-const QString VideoListDataModelPrivate::getFilePathForId(TMPXItemId mediaId) const
+const QString VideoListDataModelPrivate::getFilePathForId(const TMPXItemId &mediaId)
{
QString filePath;
int index = mMediaData.indexOfId(mediaId);
@@ -308,7 +309,7 @@
// setAlbumInUse
// -----------------------------------------------------------------------------
//
-void VideoListDataModelPrivate::setAlbumInUse(TMPXItemId albumId)
+void VideoListDataModelPrivate::setAlbumInUse(const TMPXItemId &albumId)
{
FUNC_LOG;
mCurrentAlbum = albumId;
@@ -318,7 +319,7 @@
// removeItemsFromAlbum
// -----------------------------------------------------------------------------
//
-int VideoListDataModelPrivate::removeItemsFromAlbum(TMPXItemId &albumId,
+int VideoListDataModelPrivate::removeItemsFromAlbum(const TMPXItemId &albumId,
const QList<TMPXItemId> &items)
{
FUNC_LOG;
@@ -422,7 +423,7 @@
// albumDataChangedL
// -----------------------------------------------------------------------------
//
-void VideoListDataModelPrivate::albumDataChangedL(TMPXItemId albumId,
+void VideoListDataModelPrivate::albumDataChangedL(TMPXItemId &albumId,
CMPXMediaArray *videoArray)
{
FUNC_LOG;
@@ -467,7 +468,7 @@
// thumbnailsFetchedSlot
// -----------------------------------------------------------------------------
//
-void VideoListDataModelPrivate::thumbnailsFetchedSlot(QList<TMPXItemId> mediaIds)
+void VideoListDataModelPrivate::thumbnailsFetchedSlot(QList<TMPXItemId> &mediaIds)
{
TMPXItemId id;
QModelIndex rowIndex;
@@ -478,7 +479,7 @@
rowIndex = q_ptr->index(mMediaData.indexOfId(id), 0);
if(rowIndex.isValid())
{
- emit dataChanged( rowIndex, rowIndex);
+ emit q_ptr->dataChanged( rowIndex, rowIndex);
}
}
}
@@ -578,7 +579,7 @@
// itemDeletedSlot
// -----------------------------------------------------------------------------
//
-void VideoListDataModelPrivate::itemDeletedSlot(TMPXItemId itemId)
+void VideoListDataModelPrivate::itemDeletedSlot(TMPXItemId &itemId)
{
FUNC_LOG;
if(itemId == TMPXItemId::InvalidId())
@@ -600,7 +601,7 @@
// albumRemoved
// -----------------------------------------------------------------------------
//
-void VideoListDataModelPrivate::albumRemoved(TMPXItemId albumId)
+void VideoListDataModelPrivate::albumRemoved(TMPXItemId &albumId)
{
FUNC_LOG;
if (albumId == TMPXItemId::InvalidId() || albumId.iId2 != KVcxMvcMediaTypeAlbum)
@@ -644,7 +645,7 @@
// videoDeleted
// -----------------------------------------------------------------------------
//
-void VideoListDataModelPrivate::videoDeleted(TMPXItemId videoId)
+void VideoListDataModelPrivate::videoDeleted(TMPXItemId &videoId)
{
FUNC_LOG;
if(videoId == TMPXItemId::InvalidId())
@@ -693,7 +694,7 @@
if(failedMediaIds->count() > 0)
{
QString nameOfFirstFailed("");
- CMPXMedia *media = mMediaData.getRemovedMedia( TMPXItemId(failedMediaIds->at(0)));
+ CMPXMedia *media = mMediaData.getRemovedMedia(failedMediaIds->first());
VideoCollectionUtils::instance().mediaValue<QString>(media, KMPXMediaGeneralTitle, nameOfFirstFailed );
if(failedMediaIds->count() == 1)
{
@@ -727,7 +728,7 @@
if(failedMediaIds->count() > 0)
{
QString nameOfFirstFailed("");
- CMPXMedia *media = mMediaData.getRemovedMedia( TMPXItemId(failedMediaIds->at(0)));
+ CMPXMedia *media = mMediaData.getRemovedMedia(failedMediaIds->first());
VideoCollectionUtils::instance().mediaValue<QString>(media, KMPXMediaGeneralTitle, nameOfFirstFailed );
if(failedMediaIds->count() == 1)
{
@@ -861,15 +862,34 @@
map[MetaKeyFormat] = format;
}
+ // MetaKeyFileName and MetaKeyFilePath
+ QString fileName;
+ if(VideoCollectionUtils::instance().mediaValue<QString>(media, KMPXMediaGeneralUri, fileName)) {
+
+ QFileInfo fInfo(fileName);
+ if(fInfo.isFile())
+ {
+ map[MetaKeyFileName] = fInfo.fileName();
+ map[MetaKeyFilePath] = fInfo.absolutePath();
+ }
+ }
+
+ // Metakey video title
+ QString videoTitle;
+ if(VideoCollectionUtils::instance().mediaValue<QString>(media, KMPXMediaGeneralTitle, videoTitle)) {
+ map[MetaKeyVideoTitle] = videoTitle;
+ }
+
+
QVariant variant = QVariant(map);
- emit videoDetailsReady(variant);
+ emit q_ptr->fullVideoDetailsReady(variant);
}
// -----------------------------------------------------------------------------
// albumListAvailableSlot
// -----------------------------------------------------------------------------
//
-void VideoListDataModelPrivate::albumListAvailableSlot(TMPXItemId albumId,
+void VideoListDataModelPrivate::albumListAvailableSlot(TMPXItemId &albumId,
CMPXMediaArray *albumItems)
{
FUNC_LOG;
@@ -889,20 +909,29 @@
{
QModelIndex rowIndex = q_ptr->index(index, 0);
if(rowIndex.isValid())
- {
- emit dataChanged(rowIndex, rowIndex);
- emit q_ptr->itemModified(itemId);
+ {
+ emit q_ptr->dataChanged(rowIndex, rowIndex);
+ emit q_ptr->modelChanged();
}
}
}
// -----------------------------------------------------------------------------
-// listCompleteSlot
+// videoListCompleteSlot
// -----------------------------------------------------------------------------
//
-void VideoListDataModelPrivate::listCompleteSlot()
+void VideoListDataModelPrivate::videoListCompleteSlot()
{
emit q_ptr->modelReady();
}
+// -----------------------------------------------------------------------------
+// albumListCompleteSlot
+// -----------------------------------------------------------------------------
+//
+void VideoListDataModelPrivate::albumListCompleteSlot()
+{
+ emit q_ptr->albumListReady();
+}
+
// End of file
--- a/videocollection/videocollectionwrapper/src/videosortfilterproxymodel.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/src/videosortfilterproxymodel.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 66.1.5 %
+// Version : %version: 66.1.8 %
// INCLUDE FILES
#include <qstringlist.h>
@@ -32,6 +32,8 @@
#include "videocollectionwrapper.h"
#include "videocollectiontrace.h"
+const TMPXItemId INVALID_ID = TMPXItemId::InvalidId();
+
// -----------------------------------------------------------------------------
// VideoSortFilterProxyModel::VideoSortFilterProxyModel
// -----------------------------------------------------------------------------
@@ -110,14 +112,7 @@
return false;
}
}
- if(mType == VideoCollectionCommon::EModelTypeCollections)
- {
- if(!connect(mModel, SIGNAL(itemModified(const TMPXItemId &)),
- this, SLOT(itemModifiedSlot(const TMPXItemId &))))
- {
- return false;
- }
- }
+
return true;
}
@@ -240,6 +235,10 @@
int VideoSortFilterProxyModel::deleteItems(const QModelIndexList &indexList)
{
FUNC_LOG_ADDR(this);
+
+ // Disable thumbnail fetching while items are removed from the model.
+ VideoThumbnailData::instance().enableBackgroundFetching(false);
+
if(mModel)
{
QModelIndexList mappedList;
@@ -251,10 +250,13 @@
if(mModel->removeRows(mappedList))
{
// Start fetching thumbnails at start of the model.
+ VideoThumbnailData::instance().enableBackgroundFetching(true);
VideoThumbnailData::instance().startBackgroundFetching(0, 0);
return 0;
}
}
+
+ VideoThumbnailData::instance().enableBackgroundFetching(true);
return -1;
}
@@ -374,8 +376,10 @@
{
return false;
}
- TMPXItemId leftId = mModel->mediaIdAtIndex(left.row());
- TMPXItemId rightId = mModel->mediaIdAtIndex(right.row());
+ int index = left.row();
+ TMPXItemId leftId = mModel->mediaIdAtIndex(index);
+ index = right.row();
+ TMPXItemId rightId = mModel->mediaIdAtIndex(index);
// Default categories are always first in the following order:
// Recently played (missing currently)
@@ -526,25 +530,24 @@
// VideoSortFilterProxyModel::getMediaIdAtIndex()
// -----------------------------------------------------------------------------
//
-TMPXItemId VideoSortFilterProxyModel::getMediaIdAtIndex(const QModelIndex &index) const
+const TMPXItemId& VideoSortFilterProxyModel::getMediaIdAtIndex(const QModelIndex &index) const
{
- TMPXItemId mpxId = TMPXItemId::InvalidId();
if(index.isValid())
{
- QModelIndex sourceIndex = mapToSource(index);
- if(mModel && sourceIndex.isValid())
+ int rowIndex = mapToSource(index).row();
+ if(mModel)
{
- mpxId = mModel->mediaIdAtIndex(sourceIndex.row());
+ return mModel->mediaIdAtIndex(rowIndex);
}
}
- return mpxId;
+ return INVALID_ID;
}
// -----------------------------------------------------------------------------
// VideoSortFilterProxyModel::indexOfId()
// -----------------------------------------------------------------------------
//
-QModelIndex VideoSortFilterProxyModel::indexOfId(TMPXItemId id)
+QModelIndex VideoSortFilterProxyModel::indexOfId(const TMPXItemId &id)
{
QModelIndex sourceIndex;
if(!mModel || id == TMPXItemId::InvalidId())
@@ -559,7 +562,7 @@
// VideoSortFilterProxyModel::getMediaFilePathForId()
// -----------------------------------------------------------------------------
//
-QString VideoSortFilterProxyModel::getMediaFilePathForId(TMPXItemId mediaId)
+QString VideoSortFilterProxyModel::getMediaFilePathForId(const TMPXItemId &mediaId)
{
QString filePath;
if(mModel)
@@ -695,9 +698,12 @@
{
FUNC_LOG_ADDR(this);
int err(-1);
-
+
+ // Disable thumbnail fetching while items are removed from the model.
+ VideoThumbnailData::instance().enableBackgroundFetching(false);
+
if (mModel)
- {
+ {
// remove items in album
err = mModel->removeItemsFromAlbum(albumId, mediaIds);
if(err > 0)
@@ -707,23 +713,24 @@
invalidateFilter();
err = 0;
}
-
}
+
+ VideoThumbnailData::instance().enableBackgroundFetching(true);
return err;
}
// -----------------------------------------------------------------------------
-// VideoSortFilterProxyModel::renameAlbum()
+// VideoSortFilterProxyModel::renameItem()
// -----------------------------------------------------------------------------
//
-int VideoSortFilterProxyModel::renameAlbum(const TMPXItemId &albumId, const QString &newTitle)
+int VideoSortFilterProxyModel::renameItem(const TMPXItemId &itemId, const QString &newTitle)
{
FUNC_LOG_ADDR(this);
int err(-1);
if(mCollectionClient)
{
- return mCollectionClient->renameAlbum(albumId, newTitle);
+ return mCollectionClient->renameItem(itemId, newTitle);
}
return err;
}
@@ -759,7 +766,7 @@
// VideoSortFilterProxyModel::setGenericIdFilter()
// -----------------------------------------------------------------------------
//
-void VideoSortFilterProxyModel::setGenericIdFilter(TMPXItemId itemId, bool filterValue)
+void VideoSortFilterProxyModel::setGenericIdFilter(const TMPXItemId &itemId, bool filterValue)
{
FUNC_LOG_ADDR(this);
if(mType == VideoCollectionCommon::EModelTypeGeneric)
@@ -776,7 +783,7 @@
// VideoSortFilterProxyModel::setAlbumInUse()
// -----------------------------------------------------------------------------
//
-void VideoSortFilterProxyModel::setAlbumInUse(TMPXItemId albumId)
+void VideoSortFilterProxyModel::setAlbumInUse(const TMPXItemId &albumId)
{
FUNC_LOG_ADDR(this);
if(mModel)
@@ -806,21 +813,6 @@
}
// -----------------------------------------------------------------------------
-// VideoSortFilterProxyModel::itemModifiedSlot()
-// -----------------------------------------------------------------------------
-//
-void VideoSortFilterProxyModel::itemModifiedSlot(const TMPXItemId &itemId)
-{
- FUNC_LOG_ADDR(this);
- if(mType == VideoCollectionCommon::EModelTypeCollections &&
- (itemId.iId2 == KVcxMvcMediaTypeAlbum || itemId.iId2 == KVcxMvcMediaTypeCategory))
- {
- INFO_1("VideoSortFilterProxyModel::itemModifiedSlot() [0x%x] invalidating.", this);
- invalidate();
- }
-}
-
-// -----------------------------------------------------------------------------
// VideoSortFilterProxyModel::getType()
// -----------------------------------------------------------------------------
//
--- a/videocollection/videocollectionwrapper/src/videothumbnaildata.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/src/videothumbnaildata.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 26 %
+// Version : %version: 26.1.2 %
// INCLUDE FILES
#include "videocollectiontrace.h"
@@ -44,8 +44,8 @@
d_ptr(new VideoThumbnailDataPrivate())
{
FUNC_LOG;
- connect(d_ptr, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)),
- this, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
+ connect(d_ptr, SIGNAL(thumbnailsFetched(QList<TMPXItemId>&)),
+ this, SIGNAL(thumbnailsFetched(QList<TMPXItemId>&)));
}
// -----------------------------------------------------------------------------
@@ -55,8 +55,8 @@
VideoThumbnailData::~VideoThumbnailData()
{
FUNC_LOG;
- disconnect(d_ptr, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)),
- this, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
+ disconnect(d_ptr, SIGNAL(thumbnailsFetched(QList<TMPXItemId>&)),
+ this, SIGNAL(thumbnailsFetched(QList<TMPXItemId>&)));
delete d_ptr;
}
@@ -64,7 +64,7 @@
// VideoThumbnailData::removeThumbnail()
// -----------------------------------------------------------------------------
//
-bool VideoThumbnailData::removeThumbnail(TMPXItemId mediaId)
+bool VideoThumbnailData::removeThumbnail(const TMPXItemId &mediaId)
{
INFO_2("VideoThumbnailData::removeThumbnail() mediaId (%d, %d)", mediaId.iId1, mediaId.iId2);
return d_ptr->removeThumbnail(mediaId);
@@ -74,7 +74,7 @@
// VideoThumbnailData::getThumbnail()
// -----------------------------------------------------------------------------
//
-const QIcon* VideoThumbnailData::getThumbnail(TMPXItemId mediaId)
+const QIcon* VideoThumbnailData::getThumbnail(const TMPXItemId &mediaId)
{
INFO_2("VideoThumbnailData::getThumbnail() mediaId (%d, %d)", mediaId.iId1, mediaId.iId2);
return d_ptr->getThumbnail(mediaId);
@@ -111,6 +111,15 @@
}
// -----------------------------------------------------------------------------
+// VideoThumbnailData::backgroundFetchingEnabled()
+// -----------------------------------------------------------------------------
+//
+bool VideoThumbnailData::backgroundFetchingEnabled()
+{
+ return d_ptr->backgroundFetchingEnabled();
+}
+
+// -----------------------------------------------------------------------------
// VideoThumbnailData::freeThumbnailData()
// -----------------------------------------------------------------------------
//
--- a/videocollection/videocollectionwrapper/src/videothumbnaildata_p.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/src/videothumbnaildata_p.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 24.1.1 %
+// Version : %version: 24.1.3 %
// INCLUDE FILES
#include <qapplication.h>
@@ -211,7 +211,7 @@
// VideoThumbnailDataPrivate::getThumbnail()
// -----------------------------------------------------------------------------
//
-const QIcon* VideoThumbnailDataPrivate::getThumbnail(TMPXItemId mediaId)
+const QIcon* VideoThumbnailDataPrivate::getThumbnail( const TMPXItemId &mediaId)
{
const QIcon *thumbnail = mThumbnailData[mediaId];
if(!thumbnail)
@@ -259,7 +259,7 @@
// VideoThumbnailDataPrivate::startFetchingThumbnail()
// -----------------------------------------------------------------------------
//
-int VideoThumbnailDataPrivate::startFetchingThumbnail(TMPXItemId mediaId, int priority)
+int VideoThumbnailDataPrivate::startFetchingThumbnail(const TMPXItemId &mediaId, int priority)
{
if(!mCurrentModel || !mThumbnailFetcher)
{
@@ -341,7 +341,7 @@
// VideoThumbnailDataPrivate::getModelIndexes()
// -----------------------------------------------------------------------------
//
-void VideoThumbnailDataPrivate::getModelIndexes(QList<QModelIndex> &indexes, int startIndex, int endIndex)
+void VideoThumbnailDataPrivate::getModelIndexes(QList<QModelIndex> &indexes, int &startIndex, int &endIndex)
{
FUNC_LOG;
INFO_2("VideoThumbnailDataPrivate::getModelIndexes() from %d to %d", startIndex, endIndex);
@@ -408,7 +408,7 @@
// VideoThumbnailDataPrivate::defaultThumbnail()
// -----------------------------------------------------------------------------
//
-const QIcon* VideoThumbnailDataPrivate::defaultThumbnail(TMPXItemId mediaId)
+const QIcon* VideoThumbnailDataPrivate::defaultThumbnail(const TMPXItemId &mediaId)
{
const TMPXItemId defaultIdVideo(KMaxTUint32-1, KVcxMvcMediaTypeVideo);
const TMPXItemId defaultIdAlbum(KMaxTUint32-1, KVcxMvcMediaTypeAlbum);
@@ -523,7 +523,7 @@
// VideoThumbnailDataPrivate::removeThumbnail()
// -----------------------------------------------------------------------------
//
-bool VideoThumbnailDataPrivate::removeThumbnail(TMPXItemId mediaId)
+bool VideoThumbnailDataPrivate::removeThumbnail(const TMPXItemId &mediaId)
{
FUNC_LOG;
return mThumbnailData.remove(mediaId);
@@ -556,6 +556,15 @@
}
// -----------------------------------------------------------------------------
+// VideoThumbnailDataPrivate::backgroundFetchingEnabled()
+// -----------------------------------------------------------------------------
+//
+bool VideoThumbnailDataPrivate::backgroundFetchingEnabled()
+{
+ return mBackgroundFetchingEnabled;
+}
+
+// -----------------------------------------------------------------------------
// VideoThumbnailDataPrivate::freeThumbnailData()
// -----------------------------------------------------------------------------
//
--- a/videocollection/videocollectionwrapper/tsrc/testvideocollectionclient/inc/testvideocollectionclient.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideocollectionclient/inc/testvideocollectionclient.h Fri Aug 06 09:43:48 2010 +0300
@@ -168,9 +168,9 @@
void testRemoveItemsFromAlbum();
/**
- * verifies renameAlbum
+ * verifies testRenameItem
*/
- void testRenameAlbum();
+ void testRenameItem();
/**
* verifies back -call
--- a/videocollection/videocollectionwrapper/tsrc/testvideocollectionclient/src/testvideocollectionclient.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideocollectionclient/src/testvideocollectionclient.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -597,46 +597,46 @@
}
// -----------------------------------------------------------------------------
-// testRenameAlbum
+// testRenameItem
// -----------------------------------------------------------------------------
//
-void TestVideoCollectionClient::testRenameAlbum()
+void TestVideoCollectionClient::testRenameItem()
{
MMPXCollection::setCommandLLeave(false);
QString title = "test";
- TMPXItemId albumId = TMPXItemId(1, 2);
+ TMPXItemId itemId = TMPXItemId(1, 2);
// no collectionutility
- QVERIFY(mTestObject->renameAlbum(albumId, title) < 0);
+ QVERIFY(mTestObject->renameItem(itemId, title) < 0);
mTestObject->initialize(mSignalReceiver);
// invalid album id
- albumId = TMPXItemId::InvalidId();
- QVERIFY(mTestObject->renameAlbum(albumId, title) < 0);
+ itemId = TMPXItemId::InvalidId();
+ QVERIFY(mTestObject->renameItem(itemId, title) < 0);
// empty title
title = "";
- QVERIFY(mTestObject->renameAlbum(albumId, title) < 0);
+ QVERIFY(mTestObject->renameItem(itemId, title) < 0);
// video id
title = "test";
- albumId = TMPXItemId(0, 0);
- QVERIFY(mTestObject->renameAlbum(albumId, title) < 0);
+ itemId = TMPXItemId(0, 0);
+ QVERIFY(mTestObject->renameItem(itemId, title) == 0);
// category id
- albumId = TMPXItemId(0, 1);
- QVERIFY(mTestObject->renameAlbum(albumId, title) < 0);
+ itemId = TMPXItemId(0, 1);
+ QVERIFY(mTestObject->renameItem(itemId, title) < 0);
// good case
- albumId = TMPXItemId(0, 2);
- QVERIFY(mTestObject->renameAlbum(albumId, title) == 0);
+ itemId = TMPXItemId(0, 2);
+ QVERIFY(mTestObject->renameItem(itemId, title) == 0);
// command leaves
- albumId = TMPXItemId(1, 2);
+ itemId = TMPXItemId(1, 2);
MMPXCollection::setCommandLLeave(true);
- QVERIFY(mTestObject->renameAlbum(albumId, title) < 0);
+ QVERIFY(mTestObject->renameItem(itemId, title) < 0);
MMPXCollection::setCommandLLeave(false);
}
--- a/videocollection/videocollectionwrapper/tsrc/testvideocollectionclient/stub/inc/stubcollectionsignalreceiver.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideocollectionclient/stub/inc/stubcollectionsignalreceiver.h Fri Aug 06 09:43:48 2010 +0300
@@ -73,7 +73,7 @@
/**
* No implementation needed for these tests
*/
- void itemDeletedSlot(TMPXItemId id)
+ void itemDeletedSlot(TMPXItemId &id)
{
Q_UNUSED(id);
}
@@ -89,7 +89,7 @@
/**
* No implementation needed for these tests
*/
- void videoDeletedSlot(TMPXItemId id)
+ void videoDeletedSlot(TMPXItemId &id)
{
Q_UNUSED(id);
}
@@ -114,7 +114,7 @@
/**
* No implementation needed for these tests
*/
- void albumListAvailableSlot(TMPXItemId albumId, CMPXMediaArray *albumItems)
+ void albumListAvailableSlot(TMPXItemId &albumId, CMPXMediaArray *albumItems)
{
Q_UNUSED(albumId);
Q_UNUSED(albumItems);
@@ -131,7 +131,14 @@
/**
* No implementation needed for these tests
*/
- void listCompleteSlot()
+ void videoListCompleteSlot()
+ {
+
+ }
+ /**
+ * No implementation needed for these tests
+ */
+ void albumListCompleteSlot()
{
}
--- a/videocollection/videocollectionwrapper/tsrc/testvideodatacontainer/src/testvideodatacontainer.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideodatacontainer/src/testvideodatacontainer.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -582,12 +582,15 @@
QVERIFY(mTestObject->mRemovedMedia.count() == 3);
CMPXMedia *media = 0;
- media = mTestObject->getRemovedMedia(TMPXItemId(1,0));
+ TMPXItemId testId = TMPXItemId(1,0);
+ media = mTestObject->getRemovedMedia(testId);
QVERIFY(!media);
- media = mTestObject->getRemovedMedia(TMPXItemId(0,0));
+ testId = TMPXItemId(0,0);
+ media = mTestObject->getRemovedMedia(testId);
QVERIFY(media);
media = 0;
- media = mTestObject->getRemovedMedia(TMPXItemId(MEDIA_COUNT - 1,0));
+ testId = TMPXItemId(MEDIA_COUNT - 1,0);
+ media = mTestObject->getRemovedMedia(testId);
QVERIFY(media);
}
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel/src/testvideolistdatamodel.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel/src/testvideolistdatamodel.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -201,32 +201,20 @@
//
void TestVideoListDataModel::testMediaIdAtIndex()
{
- mMediaFactory->removeArray();
+ // test is just for coverity, because there only 1
+ // function call at mediaIdAtIndex -method
- mMediaFactory->createMediaItems(MEDIA_COUNT);
-
- // ownership of media-array transferred
- mTestObjectInitialized->d_ptr->newVideoListSlot(mMediaFactory->mediaArray());
-
- // invalid index: below bounds
- QVERIFY(mTestObjectInitialized->mediaIdAtIndex(-1) == TMPXItemId::InvalidId());
+ mTestObjectInitialized->d_ptr->mItemIdToReturn = TMPXItemId::InvalidId();
- //invalid index: above bounds
- QVERIFY(mTestObjectInitialized->mediaIdAtIndex(MEDIA_COUNT) == TMPXItemId::InvalidId());
+ QVERIFY(mTestObjectInitialized->mediaIdAtIndex(0) == TMPXItemId::InvalidId());
- // first
- QVERIFY(mTestObjectInitialized->mediaIdAtIndex(0).iId1 == 0);
+ mTestObjectInitialized->d_ptr->mItemIdToReturn = TMPXItemId(0,0);
- // middle
- QVERIFY(mTestObjectInitialized->mediaIdAtIndex(MEDIA_COUNT / 2).iId1 == (MEDIA_COUNT / 2));
+ QVERIFY(mTestObjectInitialized->mediaIdAtIndex(0) == TMPXItemId(0,0));
- // last
- QVERIFY(mTestObjectInitialized->mediaIdAtIndex(MEDIA_COUNT - 1).iId1 == (MEDIA_COUNT - 1));
-
- // no items
- mMediaFactory->removeArray();
- mTestObjectInitialized->d_ptr->newVideoListSlot(0);
- QVERIFY( mTestObjectInitialized->mediaIdAtIndex(MEDIA_COUNT / 2) == TMPXItemId::InvalidId());
+ mTestObjectInitialized->d_ptr->mItemIdToReturn = TMPXItemId(1,2);
+
+ QVERIFY(mTestObjectInitialized->mediaIdAtIndex(0) == TMPXItemId(1,2));
}
// -----------------------------------------------------------------------------
@@ -816,13 +804,26 @@
}
+// -----------------------------------------------------------------------------
+// testDeleteStartingFailsSlot
+// -----------------------------------------------------------------------------
+//
void TestVideoListDataModel::testDeleteStartingFailsSlot()
-{
- QSignalSpy spysignal(mTestObjectInitialized, SIGNAL(modelChanged()));
+{
mTestObjectInitialized->mDeleteWorker->mIsDeleting = false;
VideoCollectionWrapper::mLatestStatusCode = -1;
VideoCollectionWrapper::mLatestAdditional = QVariant();
+ // "start deletion to get signals connected
+ QModelIndexList indexList;
+ mMediaFactory->createMediaItems(MEDIA_COUNT);
+ mTestObjectInitialized->d_ptr->newVideoListSlot(mMediaFactory->mediaArray());
+ indexList.append(mTestObjectInitialized->index(0,0));
+ indexList.append(mTestObjectInitialized->index(1,0));
+ mTestObjectInitialized->removeRows(indexList);
+
+ QSignalSpy spysignal(mTestObjectInitialized, SIGNAL(modelChanged()));
+
QList<TMPXItemId> idList;
// empty list
emit mTestObjectInitialized->mDeleteWorker->deleteStartupFailed(idList);
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel/stub/inc/videocollectionclient.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel/stub/inc/videocollectionclient.h Fri Aug 06 09:43:48 2010 +0300
@@ -58,7 +58,7 @@
/**
* returns mRemoveItemsReturn
*/
- int removeItemsFromAlbum(TMPXItemId &albumId, const QList<TMPXItemId> &items);
+ int removeItemsFromAlbum(const TMPXItemId &albumId, const QList<TMPXItemId> &items);
/**
* if true, initializate fails
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel/stub/inc/videodeleteworker.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel/stub/inc/videodeleteworker.h Fri Aug 06 09:43:48 2010 +0300
@@ -97,7 +97,7 @@
/**
* dummy signal
*/
- void deleteStartupFailed(QList<TMPXItemId>);
+ void deleteStartupFailed(QList<TMPXItemId>&);
public slots:
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel/stub/inc/videolistdatamodel_p.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel/stub/inc/videolistdatamodel_p.h Fri Aug 06 09:43:48 2010 +0300
@@ -114,7 +114,7 @@
* @param index
* @return int
*/
- TMPXItemId getMediaIdFromIndex(int index) const;
+ TMPXItemId& getMediaIdFromIndex(const int &index) const;
/**
* return video path of the item with given media id
@@ -122,7 +122,7 @@
* @param mediaId
* @return int
*/
- const QString getFilePathForId(TMPXItemId mediaId) const;
+ const QString getFilePathForId(const TMPXItemId &mediaId) const;
/**
* return name of the item at given index
@@ -130,7 +130,7 @@
* @param index
* @return QString
*/
- const QString getVideoNameFromIndex( int index ) const;
+ const QString getVideoNameFromIndex(const int &index ) const;
/**
* return default tn always
@@ -138,7 +138,7 @@
* @param index
* @return QIcon
*/
- const QIcon* getVideoThumbnailFromIndex( int index ) const;
+ const QIcon* getVideoThumbnailFromIndex(const int &index ) const;
/**
* return video count of the item at given index
@@ -146,7 +146,7 @@
* @param index
* @return quint32
*/
- quint32 VideoListDataModelPrivate::getCategoryVideoCountFromIndex( int index ) const;
+ quint32 getCategoryVideoCountFromIndex(const int &index ) const;
/**
* return video size of the item at given index
@@ -154,7 +154,7 @@
* @param index
* @return quint32
*/
- quint32 getVideoSizeFromIndex( int index ) const;
+ quint32 getVideoSizeFromIndex(const int &index ) const;
/**
* return video age profile of the item at given index
@@ -162,7 +162,7 @@
* @param index
* @return quint32
*/
- quint32 getVideoAgeProfileFromIndex( int index ) const;
+ quint32 getVideoAgeProfileFromIndex(const int &index ) const;
/**
* return video duration of the item at given index
@@ -170,7 +170,7 @@
* @param index
* @return quint32
*/
- quint32 getVideodurationFromIndex( int index ) const;
+ quint32 getVideodurationFromIndex(const int &index ) const;
/**
* return video creation datetime of the item at given index
@@ -178,7 +178,7 @@
* @param index
* @return QDateTime
*/
- QDateTime getVideoDateFromIndex( int index ) const;
+ QDateTime getVideoDateFromIndex(const int &index ) const;
/**
* Returns video status
@@ -187,7 +187,7 @@
*
* @return int status code
*/
- int getVideoStatusFromIndex(int index) const;
+ int getVideoStatusFromIndex(const int &index) const;
/**
* marks videos to be removed: it's id and index are saved to
@@ -211,22 +211,22 @@
*
* @param index: item position where client wants the file path from.
*/
- const QString getFilePathFromIndex(int index) const;
+ const QString getFilePathFromIndex(const int &index) const;
/**
* returns mBelongsToAlbum;
*/
- bool belongsToAlbum(TMPXItemId itemId, TMPXItemId albumId);
+ bool belongsToAlbum(const TMPXItemId &itemId, TMPXItemId albumId);
/**
* returns mBelongsToAlbum;
*/
- void setAlbumInUse(TMPXItemId albumId);
+ void setAlbumInUse(const TMPXItemId &albumId);
/**
* returns mRemoveFrAlbumReturn
*/
- int removeItemsFromAlbum(TMPXItemId &albumId, const QList<TMPXItemId> &ids);
+ int removeItemsFromAlbum(const TMPXItemId &albumId, const QList<TMPXItemId> &ids);
private: // private methods
@@ -245,7 +245,7 @@
* @param index
* @return CMPXMedia
*/
- CMPXMedia* getMediaFromIndex( int index ) const;
+ CMPXMedia* getMediaFromIndex(const int &index) const;
/**
* return index of item of given id
@@ -253,7 +253,7 @@
* @param mediaId
* @return int
*/
- int indexOfMediaId(TMPXItemId mediaId) const;
+ int indexOfMediaId(const TMPXItemId &mediaId) const;
public slots:
@@ -277,13 +277,7 @@
*
*/
void newVideoAvailableSlot(CMPXMedia* aVideo);
-
- /**
- * not used in stub
- *
- */
- void videoDeletedSlot(TMPXItemId videoId);
-
+
/**
* used to clear mItemsUnderDeletion for this stub
*
@@ -299,7 +293,7 @@
/**
* not used in stub
*/
- void albumListAvailableSlot(TMPXItemId albumId, CMPXMediaArray *albumItems);
+ void albumListAvailableSlot(TMPXItemId &albumId, CMPXMediaArray *albumItems);
/**
* not used in stub
@@ -314,12 +308,17 @@
/**
* not used in stub
*/
- void itemDeletedSlot(TMPXItemId id);
+ void itemDeletedSlot(TMPXItemId &id);
/**
* not used in stub
*/
- void listCompleteSlot();
+ void videoListCompleteSlot();
+
+ /**
+ * not used in stub
+ */
+ void albumListCompleteSlot();
public:
@@ -409,6 +408,11 @@
*/
static int mRemoveFrAlbumReturn;
+ /**
+ * value returned from getMediaIdFromIndex
+ */
+ static TMPXItemId mItemIdToReturn;
+
};
/**
@@ -427,7 +431,7 @@
for(int i = 0; i < mObj->getVideoCount(); ++i)
{
- if(id == mObj->getMediaIdFromIndex(i))
+ if(id == mObj->getMediaId(mObj->getMediaFromIndex(i)))
{
return i;
}
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel/stub/src/videocollectionclient.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel/stub/src/videocollectionclient.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -67,7 +67,7 @@
// removeItemsFromAlbum
// -----------------------------------------------------------------------------
//
-int VideoCollectionClient::removeItemsFromAlbum(TMPXItemId &albumId, const QList<TMPXItemId> &items)
+int VideoCollectionClient::removeItemsFromAlbum(const TMPXItemId &albumId, const QList<TMPXItemId> &items)
{
Q_UNUSED(albumId);
Q_UNUSED(items);
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel/stub/src/videolistdatamodel_p.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel/stub/src/videolistdatamodel_p.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -28,6 +28,8 @@
#include "vcxmyvideosdefs.h"
#include "videocollectioncommon.h"
+const TMPXItemId INVALID_ID = TMPXItemId::InvalidId();
+
inline uint qHash(TMPXItemId key)
{
QPair<uint, uint> keyPair(key.iId1, key.iId2);
@@ -79,6 +81,8 @@
int VideoListDataModelPrivate::mRemoveFrAlbumReturn = -1;
+TMPXItemId VideoListDataModelPrivate::mItemIdToReturn = TMPXItemId::InvalidId();
+
// -----------------------------------------------------------------------------
// CVideoListData
// -----------------------------------------------------------------------------
@@ -156,7 +160,7 @@
// getVideoNameFromIndex
// -----------------------------------------------------------------------------
//
-const QString VideoListDataModelPrivate::getVideoNameFromIndex( int index ) const
+const QString VideoListDataModelPrivate::getVideoNameFromIndex(const int &index ) const
{
QString txt = "";
CMPXMedia* media = getMediaFromIndex(index);
@@ -169,7 +173,7 @@
// getVideoThumbnailFromIndex
// -----------------------------------------------------------------------------
//
-const QIcon* VideoListDataModelPrivate::getVideoThumbnailFromIndex( int index ) const
+const QIcon* VideoListDataModelPrivate::getVideoThumbnailFromIndex(const int &index ) const
{
Q_UNUSED(index);
@@ -180,7 +184,7 @@
// getVideoThumbnailFromIndex
// -----------------------------------------------------------------------------
//
-quint32 VideoListDataModelPrivate::getCategoryVideoCountFromIndex( int index ) const
+quint32 VideoListDataModelPrivate::getCategoryVideoCountFromIndex(const int &index ) const
{
if(mOverrideVideoCount)
{
@@ -200,7 +204,7 @@
// getVideoSizeFromIndex
// -----------------------------------------------------------------------------
//
-quint32 VideoListDataModelPrivate::getVideoSizeFromIndex( int index ) const
+quint32 VideoListDataModelPrivate::getVideoSizeFromIndex(const int &index ) const
{
if(mOverrideSize)
{
@@ -219,7 +223,7 @@
// getVideodurationFromIndex
// -----------------------------------------------------------------------------
//
-quint32 VideoListDataModelPrivate::getVideodurationFromIndex( int index ) const
+quint32 VideoListDataModelPrivate::getVideodurationFromIndex(const int &index ) const
{
if(mOverrideDuration)
{
@@ -240,7 +244,7 @@
// getVideoDateFromIndex
// -----------------------------------------------------------------------------
//
-QDateTime VideoListDataModelPrivate::getVideoDateFromIndex( int index ) const
+QDateTime VideoListDataModelPrivate::getVideoDateFromIndex(const int &index ) const
{
QDateTime date;
CMPXMedia *media = getMediaFromIndex(index);
@@ -258,16 +262,17 @@
// getMediaIdFromIndex
// -----------------------------------------------------------------------------
//
-TMPXItemId VideoListDataModelPrivate::getMediaIdFromIndex( int index ) const
+TMPXItemId& VideoListDataModelPrivate::getMediaIdFromIndex(const int &index ) const
{
- return getMediaId( getMediaFromIndex(index) );
+ Q_UNUSED(index);
+ return mItemIdToReturn;
}
// -----------------------------------------------------------------------------
// getFilePathForId
// -----------------------------------------------------------------------------
//
-const QString VideoListDataModelPrivate::getFilePathForId( TMPXItemId mediaId ) const
+const QString VideoListDataModelPrivate::getFilePathForId(const TMPXItemId &mediaId ) const
{
return getFilePathFromIndex( indexOfMediaId(mediaId) );
}
@@ -276,7 +281,7 @@
// getFilePathForId
// -----------------------------------------------------------------------------
//
-bool VideoListDataModelPrivate::belongsToAlbum(TMPXItemId itemId, TMPXItemId albumId)
+bool VideoListDataModelPrivate::belongsToAlbum(const TMPXItemId &itemId, TMPXItemId albumId)
{
Q_UNUSED(itemId);
Q_UNUSED(albumId);
@@ -287,7 +292,7 @@
// setAlbumInUse
// -----------------------------------------------------------------------------
//
-void VideoListDataModelPrivate::setAlbumInUse(TMPXItemId albumId)
+void VideoListDataModelPrivate::setAlbumInUse(const TMPXItemId &albumId)
{
mCurrentAlbum = albumId;
}
@@ -296,7 +301,7 @@
// removeItemsFromAlbum
// -----------------------------------------------------------------------------
//
-int VideoListDataModelPrivate::removeItemsFromAlbum(TMPXItemId &albumId, const QList<TMPXItemId> &ids)
+int VideoListDataModelPrivate::removeItemsFromAlbum(const TMPXItemId &albumId, const QList<TMPXItemId> &ids)
{
Q_UNUSED(albumId);
Q_UNUSED(ids);
@@ -307,7 +312,7 @@
// getVideoStatusFromIndex
// -----------------------------------------------------------------------------
//
-int VideoListDataModelPrivate::getVideoStatusFromIndex(int index) const
+int VideoListDataModelPrivate::getVideoStatusFromIndex(const int &index) const
{
int status = 0;
if(mItemsUnderDeletion.contains(getMediaIdFromIndex(index)))
@@ -354,7 +359,7 @@
// getFilePathFromIndex
// -----------------------------------------------------------------------------
//
-const QString VideoListDataModelPrivate::getFilePathFromIndex(int index) const
+const QString VideoListDataModelPrivate::getFilePathFromIndex(const int &index) const
{
QString filePath;
VideoCollectionUtils::instance().mediaValue<QString>(getMediaFromIndex(index),
@@ -366,7 +371,7 @@
// getMediaFromIndex
// -----------------------------------------------------------------------------
//
-CMPXMedia* VideoListDataModelPrivate::getMediaFromIndex( int index ) const
+CMPXMedia* VideoListDataModelPrivate::getMediaFromIndex(const int &index) const
{
CMPXMedia *media = NULL;
if( mMediaArray && index >= 0 && index < mMediaArray->Count() )
@@ -394,7 +399,7 @@
// indexOfMediaId
// -----------------------------------------------------------------------------
//
-int VideoListDataModelPrivate::indexOfMediaId(TMPXItemId mediaId) const
+int VideoListDataModelPrivate::indexOfMediaId(const TMPXItemId &mediaId) const
{
int index = -1;
if( !mMediaArray )
@@ -449,15 +454,6 @@
}
// -----------------------------------------------------------------------------
-// videoDeleted
-// -----------------------------------------------------------------------------
-//
-void VideoListDataModelPrivate::videoDeletedSlot(TMPXItemId videoId)
-{
- Q_UNUSED(videoId);
-}
-
-// -----------------------------------------------------------------------------
// videoDeleteCompleted
// -----------------------------------------------------------------------------
//
@@ -481,7 +477,7 @@
// albumListAvailableSlot
// -----------------------------------------------------------------------------
//
-void VideoListDataModelPrivate::albumListAvailableSlot(TMPXItemId albumId,
+void VideoListDataModelPrivate::albumListAvailableSlot(TMPXItemId &albumId,
CMPXMediaArray *albumItems)
{
Q_UNUSED(albumId);
@@ -510,16 +506,24 @@
// itemDeletedSlot
// -----------------------------------------------------------------------------
//
-void VideoListDataModelPrivate::itemDeletedSlot(TMPXItemId id)
+void VideoListDataModelPrivate::itemDeletedSlot(TMPXItemId &id)
{
Q_UNUSED(id);
}
// -----------------------------------------------------------------------------
-// listCompleteSlot
+// videoListCompleteSlot
// -----------------------------------------------------------------------------
//
-void VideoListDataModelPrivate::listCompleteSlot()
+void VideoListDataModelPrivate::videoListCompleteSlot()
+{
+}
+
+// -----------------------------------------------------------------------------
+// albumListCompleteSlot
+// -----------------------------------------------------------------------------
+//
+void VideoListDataModelPrivate::albumListCompleteSlot()
{
}
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/inc/mediaobjectfactory.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/inc/mediaobjectfactory.h Fri Aug 06 09:43:48 2010 +0300
@@ -19,6 +19,8 @@
#define __TESTVIDEOLISTMEDIAFACTORY_H__
+#include <qtemporaryfile.h>
+
class CMPXMediaArray;
class CMPXMedia;
@@ -52,7 +54,7 @@
_LIT( KMediaTestNamePrefix, "MEDIATESTNAME_%d" );
const QString gQTMediaNamePrefix = "MEDIATESTNAME_";
-_LIT( KMediaTestPathPrefix, "MEDIATESTPATH_%d" );
+_LIT( KMediaTestPathPrefix, "c:\\MEDIATESTPATH_%d\\" );
const QString gQTMediaPathPrefix = "MEDIATESTPATH_";
_LIT( KMediaTestDescPrefix, "MEDIATESTDESC_%d" );
@@ -144,6 +146,11 @@
* array of medias
*/
CMPXMediaArray *mArray;
+
+ /**
+ * list of temp files
+ */
+ QList<QTemporaryFile*> mTmpFiles;
};
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/inc/testvideomodel_p.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/inc/testvideomodel_p.h Fri Aug 06 09:43:48 2010 +0300
@@ -39,7 +39,7 @@
/**
* emitted to test thumbnailFetchedSlot
*/
- void signalThumbnailsFetched(QList<TMPXItemId>);
+ void signalThumbnailsFetched(QList<TMPXItemId>&);
/**
* emitted to pass new media-array into testable object and
@@ -56,7 +56,7 @@
/**
* emitted to verify albumListAvailableSlot
*/
- void signalAlbumListAvailable(TMPXItemId, CMPXMediaArray*);
+ void signalAlbumListAvailable(TMPXItemId&, CMPXMediaArray*);
/**
* emitted to verify itemModifiedSlot
@@ -71,7 +71,7 @@
/**
* emitted to get deleteItemSlot to be called.
*/
- void signalDeleteItem(TMPXItemId);
+ void signalDeleteItem(TMPXItemId&);
/**
* emitted to get videoDeleteCompletedSlot to be called.
@@ -255,9 +255,14 @@
void testGetCollectionIdFromIndex();
/**
- * verifies listCompleteSlot
+ * verifies videoListCompleteSlot
*/
void testListCompleteSlot();
+
+ /**
+ * verifies albumListCompleteSlot;
+ */
+ void testalbumListCompleteSlot();
private:
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/src/mediaobjectfactory.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/src/mediaobjectfactory.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -22,6 +22,7 @@
#include <mpxmediaarray.h>
#include <mpxmedia.h>
#include <qdatetime.h>
+#include <xqconversions.h>
#include "vcxmyvideosdefs.h"
#include "mediaobjectfactory.h"
@@ -320,8 +321,13 @@
// set "filepath"
if(dataSelectionFlags & MediaDataFilePath)
{
- videoname.Format(KMediaTestPathPrefix, index);
- TRAPD(error, media->SetTextValueL( KMPXMediaGeneralUri, videoname));
+ mTmpFiles.append(new QTemporaryFile());
+ mTmpFiles.last()->open();
+
+ HBufC *fileName = XQConversions::qStringToS60Desc(mTmpFiles.last()->fileName());
+
+ TRAPD(error, media->SetTextValueL( KMPXMediaGeneralUri, *fileName));
+ delete fileName;
if(error != KErrNone)
{
delete media;
@@ -462,6 +468,13 @@
//
void MediaObjectFactory::removeArray()
{
+ while(!mTmpFiles.isEmpty())
+ {
+ mTmpFiles.first()->close();
+ delete mTmpFiles.first();
+ mTmpFiles.removeFirst();
+ }
+
delete mArray;
mArray = 0;
}
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/src/testvideomodel_p.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/src/testvideomodel_p.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -542,7 +542,7 @@
QVERIFY(path.isNull());
path = mTestObject->getFilePathFromIndex(0);
- QCOMPARE(path, gQTMediaPathPrefix + "0");
+ QVERIFY(!path.isEmpty());
// data does not exist
mTestObject->mMediaData.clear();
@@ -576,7 +576,7 @@
QVERIFY(path.isNull());
path = mTestObject->getFilePathForId(TMPXItemId(0,0));
- QCOMPARE(path, gQTMediaPathPrefix + "0");
+ QVERIFY(!path.isEmpty());
// data does not exist
mTestObject->mMediaData.clear();
@@ -649,9 +649,9 @@
//
void TestVideoModel_p::testThumbnailsFetchedSlot()
{
- QVERIFY(connect(this, SIGNAL(signalThumbnailsFetched(QList<TMPXItemId>)), mTestObject, SLOT(thumbnailsFetchedSlot(QList<TMPXItemId>))));
+ QVERIFY(connect(this, SIGNAL(signalThumbnailsFetched(QList<TMPXItemId>&)), mTestObject, SLOT(thumbnailsFetchedSlot(QList<TMPXItemId>&))));
- QSignalSpy spysignal(mTestObject, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)));
+ QSignalSpy spysignal(mStubModel, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)));
mMediaFactory->removeArray();
QList<TMPXItemId> mediaIds;
@@ -699,7 +699,7 @@
QVERIFY(spysignal.count() == 1);
disconnect(this, SIGNAL(signalNewVideoList(CMPXMediaArray*)), mTestObject, SLOT(newVideoListSlot(CMPXMediaArray*)));
- disconnect(this, SIGNAL(signalThumbnailsFetched(QList<TMPXItemId>)), mTestObject, SLOT(thumbnailsFetchedSlot(QList<TMPXItemId>)));
+ disconnect(this, SIGNAL(signalThumbnailsFetched(QList<TMPXItemId>&)), mTestObject, SLOT(thumbnailsFetchedSlot(QList<TMPXItemId>&)));
}
// -----------------------------------------------------------------------------
@@ -894,8 +894,8 @@
QVERIFY(mTestObject->initialize() == 0);
- QVERIFY(connect(this, SIGNAL(signalAlbumListAvailable(TMPXItemId, CMPXMediaArray*)),
- mTestObject, SLOT(albumListAvailableSlot(TMPXItemId, CMPXMediaArray*))));
+ QVERIFY(connect(this, SIGNAL(signalAlbumListAvailable(TMPXItemId&, CMPXMediaArray*)),
+ mTestObject, SLOT(albumListAvailableSlot(TMPXItemId&, CMPXMediaArray*))));
TMPXItemId albumId(1,2);
@@ -932,8 +932,8 @@
TMPXItemId itemToCheck(1,0);
QVERIFY(mTestObject->belongsToAlbum(itemToCheck, albumId));
- disconnect(this, SIGNAL(signalAlbumListAvailable(TMPXItemId, CMPXMediaArray*)),
- mTestObject, SLOT(albumListAvailableSlot(TMPXItemId, CMPXMediaArray*)));
+ disconnect(this, SIGNAL(signalAlbumListAvailable(TMPXItemId&, CMPXMediaArray*)),
+ mTestObject, SLOT(albumListAvailableSlot(TMPXItemId&, CMPXMediaArray*)));
}
// -----------------------------------------------------------------------------
@@ -946,7 +946,7 @@
QVERIFY(connect(this, SIGNAL(signalItemModified(const TMPXItemId &)), mTestObject, SLOT(itemModifiedSlot(const TMPXItemId &))));
- QSignalSpy spysignal(mTestObject, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)));
+ QSignalSpy spysignal(mStubModel, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)));
// invalid item id, no items
TMPXItemId id = TMPXItemId::InvalidId();
@@ -1077,16 +1077,19 @@
QSignalSpy spyModelChanged(mStubModel, SIGNAL(modelChanged()));
QVERIFY(connect(this, SIGNAL(signalNewVideoList(CMPXMediaArray*)), mTestObject, SLOT(newVideoListSlot(CMPXMediaArray*))));
- QVERIFY(connect(this, SIGNAL(signalDeleteItem(TMPXItemId)), mTestObject, SLOT(itemDeletedSlot(TMPXItemId))));
+ QVERIFY(connect(this, SIGNAL(signalDeleteItem(TMPXItemId&)), mTestObject, SLOT(itemDeletedSlot(TMPXItemId&))));
+
+ TMPXItemId idForSignal = TMPXItemId(0,0);
// no videos
- emit signalDeleteItem(TMPXItemId(0,0));
+ emit signalDeleteItem(idForSignal);
QVERIFY(VideoListDataModel::mFirstRemoved == -1);
QVERIFY(VideoListDataModel::mFirstRemoved == -1);
QVERIFY(spyModelChanged.count() == 0);
+ idForSignal = TMPXItemId::InvalidId();
// invalid id
- emit signalDeleteItem(TMPXItemId::InvalidId());
+ emit signalDeleteItem(idForSignal);
QVERIFY(VideoListDataModel::mFirstRemoved == -1);
QVERIFY(VideoListDataModel::mFirstRemoved == -1);
QVERIFY(spyModelChanged.count() == 0);
@@ -1097,9 +1100,10 @@
VideoListDataModel::mFirstRemoved = -1;
VideoListDataModel::mLastRemoved = -1;
spyModelChanged.clear();
-
+
// not marked as removed
- emit signalDeleteItem(TMPXItemId(MEDIA_COUNT / 2,0));
+ idForSignal = TMPXItemId(MEDIA_COUNT / 2,0);
+ emit signalDeleteItem(idForSignal);
QVERIFY(VideoListDataModel::mFirstRemoved == MEDIA_COUNT / 2);
QVERIFY(VideoListDataModel::mFirstRemoved == MEDIA_COUNT / 2);
QVERIFY(spyModelChanged.count() == 1);
@@ -1154,7 +1158,8 @@
mTestObject->mAlbumData[album2] = items;
// not existing album
- emit signalDeleteItem(TMPXItemId(1,2));
+ idForSignal = TMPXItemId(1,2);
+ emit signalDeleteItem(idForSignal);
QVERIFY(VideoListDataModel::mFirstRemoved == -1);
QVERIFY(spyModelChanged.count() == 0);
QVERIFY( mTestObject->mAlbumData.count() == 2);
@@ -1177,7 +1182,7 @@
QVERIFY( mTestObject->mAlbumData.count() == 0);
mTestObject->mVideoThumbnailData = pTmp;
- disconnect(this, SIGNAL(signalDeleteItem(TMPXItemId)), mTestObject, SLOT(itemDeletedSlot(TMPXItemId)));
+ disconnect(this, SIGNAL(signalDeleteItem(TMPXItemId&)), mTestObject, SLOT(itemDeletedSlot(TMPXItemId&)));
disconnect(this, SIGNAL(signalNewVideoList(CMPXMediaArray*)), mTestObject, SLOT(newVideoListSlot(CMPXMediaArray*)));
}
@@ -1294,12 +1299,12 @@
using namespace VideoCollectionCommon;
mMediaFactory->removeArray();
-// QVERIFY(connect(this, SIGNAL(signalNewVideoList(CMPXMediaArray*)), mTestObject, SLOT(newVideoListSlot(CMPXMediaArray*))));
+
QVERIFY(connect(this, SIGNAL(signalVideoDetailsCompleted(CMPXMedia*)), mTestObject, SLOT(videoDetailsCompletedSlot(CMPXMedia*))));
HbExtendedLocale locale = HbExtendedLocale::system();
- MetaDataSignalSpy spysignal(mTestObject, SIGNAL(videoDetailsReady(QVariant&)));
+ MetaDataSignalSpy spysignal(mStubModel, SIGNAL(fullVideoDetailsReady(QVariant&)));
// check with NULL media.
emit signalVideoDetailsCompleted(0);
@@ -1326,6 +1331,9 @@
QVERIFY(map.contains(MetaKeyFormat));
QVERIFY(map.contains(MetaKeyVideoResolutionString));
QVERIFY(map.contains(MetaKeyBitRate));
+ QVERIFY(map.contains(MetaKeyFileName));
+ QVERIFY(map.contains(MetaKeyFilePath));
+ QVERIFY(map.contains(MetaKeyVideoTitle));
// one or several of these will fail, when rest of the metadata is implemented.
QVERIFY(map.contains(MetaKeyDRMInfo) == false);
@@ -1346,7 +1354,9 @@
QCOMPARE(map[MetaKeyFormat].toString(), gQTMediaFormatPrefix + "0");
QCOMPARE(map[MetaKeyVideoResolutionString].toString(), hbTrId("txt_videos_list_l1l2").arg(1).arg(2));
QCOMPARE(map[MetaKeyBitRate].toString(), hbTrId("txt_videos_list_l1_kbps", 800));
-
+ QVERIFY(!map[MetaKeyFileName].toString().isEmpty());
+ QVERIFY(!map[MetaKeyFilePath].toString().isEmpty());
+ QVERIFY(!map[MetaKeyVideoTitle].toString().isEmpty());
// Mbps case
media = mMediaFactory->mediaArray()->operator [](1);
emit signalVideoDetailsCompleted(media);
@@ -1369,7 +1379,7 @@
QVERIFY(map.contains(MetaKeySizeString));
disconnect(this, SIGNAL(signalNewVideoList(CMPXMediaArray*)), mTestObject, SLOT(newVideoListSlot(CMPXMediaArray*)));
- disconnect(this, SIGNAL(signalVideoDetailsCompleted(TMPXItemId)), mTestObject, SLOT(videoDetailsCompletedSlot(TMPXItemId)));
+ disconnect(this, SIGNAL(signalVideoDetailsCompleted(CMPXMedia*)), mTestObject, SLOT(videoDetailsCompletedSlot(CMPXMedia*)));
}
// -----------------------------------------------------------------------------
@@ -1420,12 +1430,24 @@
//
void TestVideoModel_p::testListCompleteSlot()
{
- QVERIFY(connect(this, SIGNAL(signalListCompleteSlot()), mTestObject, SLOT(listCompleteSlot())));
+ QVERIFY(connect(this, SIGNAL(signalListCompleteSlot()), mTestObject, SLOT(videoListCompleteSlot())));
QSignalSpy spy(mStubModel, SIGNAL(modelReady()));
emit signalListCompleteSlot();
QCOMPARE(spy.count(), 1);
}
+// -----------------------------------------------------------------------------
+// testalbumListCompleteSlot
+// -----------------------------------------------------------------------------
+//
+void TestVideoModel_p::testalbumListCompleteSlot()
+{
+ QVERIFY(connect(this, SIGNAL(signalListCompleteSlot()), mTestObject, SLOT(albumListCompleteSlot())));
+ QSignalSpy spy(mStubModel, SIGNAL(albumListReady()));
+ emit signalListCompleteSlot();
+ QCOMPARE(spy.count(), 1);
+}
+
// End of file
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/stub/inc/videodatacontainer.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/stub/inc/videodatacontainer.h Fri Aug 06 09:43:48 2010 +0300
@@ -74,7 +74,7 @@
* object is not found from wanted index
*
*/
- CMPXMedia* fromIndex(int index) const;
+ CMPXMedia* fromIndex(const int &index) const;
/**
* Returns an index of id.
@@ -83,7 +83,7 @@
*
* @return int index of item or -1 if item with provided id is not found
*/
- int indexOfId(const TMPXItemId &id) const;
+ const int& indexOfId(const TMPXItemId &id) const;
/**
* Returns id of item from provided index
@@ -92,7 +92,7 @@
*
* @return id of item or invalid TMPXItemId if item is not found from provided index
*/
- TMPXItemId idFromIndex(int index) const;
+ const TMPXItemId& idFromIndex(const int &index) const;
/**
* returns count of items
@@ -108,7 +108,7 @@
* @param inteIndex index of item
* @return TMPXItemId id of the item marked as removed
*/
- TMPXItemId markItemRemoved(const int &itemIndex);
+ const TMPXItemId markItemRemoved(const int &itemIndex);
/**
* Method removes provided items from mRemovedMedia
@@ -133,12 +133,12 @@
*
* @param itemId id of item to be returned
*/
- CMPXMedia* getRemovedMedia(TMPXItemId itemId);
+ CMPXMedia* getRemovedMedia(TMPXItemId &itemId);
/**
* decrements indexes of items after provided index by one.
*/
- void decHashIndexesAfter(int fromIndex);
+ void decHashIndexesAfter(const int &fromIndex);
public: // data
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/stub/inc/videolistdatamodel.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/stub/inc/videolistdatamodel.h Fri Aug 06 09:43:48 2010 +0300
@@ -54,12 +54,22 @@
/**
* dummy signal
*/
+ void albumListReady();
+
+ /**
+ * dummy signal
+ */
void modelChanged();
/**
* dummy signal
*/
void albumChanged();
+
+ /**
+ * dummy signal
+ */
+ void fullVideoDetailsReady(QVariant &);
public: // from QAbstractItemModel
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/stub/inc/videothumbnaildata.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/stub/inc/videothumbnaildata.h Fri Aug 06 09:43:48 2010 +0300
@@ -153,7 +153,7 @@
* @param mediaId: id of the video whose thumbnail is ready.
*
*/
- void thumbnailsFetched( QList<TMPXItemId> mediaId );
+ void thumbnailsFetched( QList<TMPXItemId>& mediaId );
private:
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/stub/src/videodatacontainer.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/stub/src/videodatacontainer.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -19,6 +19,9 @@
#include "videodatacontainer.h"
#include "videocollectionutils.h"
+const TMPXItemId INVALID_ID = TMPXItemId::InvalidId();
+const int INVALID_INDEX = -1;
+
/**
* global qHash function required fo creating hash values for TMPXItemId -keys
*/
@@ -87,7 +90,7 @@
mMediaData.erase(removeIter);
}
-void VideoDataContainer::decHashIndexesAfter(int fromIndex)
+void VideoDataContainer::decHashIndexesAfter(const int &fromIndex)
{
int count = mMediaIds.count();
QMultiHash<TMPXItemId, QPair<int, CMPXMedia*> >::iterator hashIter;
@@ -129,7 +132,7 @@
// fromIndex
// -----------------------------------------------------------------------------
//
-CMPXMedia* VideoDataContainer::fromIndex(int index) const
+CMPXMedia* VideoDataContainer::fromIndex(const int &index) const
{
if(index >= 0 && index < mMediaIds.count() && mMediaData.contains(mMediaIds[index]))
{
@@ -143,27 +146,27 @@
// indexOfId
// -----------------------------------------------------------------------------
//
-int VideoDataContainer::indexOfId(const TMPXItemId &id) const
+const int& VideoDataContainer::indexOfId(const TMPXItemId &id) const
{
QMultiHash<TMPXItemId, QPair<int, CMPXMedia*> >::const_iterator iter = mMediaData.find(id);
if(iter != mMediaData.constEnd())
{
return iter->first;
}
- return -1;
+ return INVALID_INDEX;
}
// -----------------------------------------------------------------------------
// idFromIndex
// -----------------------------------------------------------------------------
//
-TMPXItemId VideoDataContainer::idFromIndex(int index) const
+TMPXItemId& VideoDataContainer::idFromIndex(const int &index) const
{
if(index >= 0 && index < mMediaIds.count())
{
return mMediaIds[index];
}
- return TMPXItemId::InvalidId();
+ return INVALID_ID;
}
// -----------------------------------------------------------------------------
@@ -179,7 +182,7 @@
// markItemsRemoved
// -----------------------------------------------------------------------------
//
-TMPXItemId VideoDataContainer::markItemRemoved(const int &itemIndex)
+const TMPXItemId VideoDataContainer::markItemRemoved(const int &itemIndex)
{
// for all provided indexes:
// - get item address from mMediaData
@@ -283,7 +286,7 @@
// getRemovedMedia
// -----------------------------------------------------------------------------
//
-CMPXMedia* VideoDataContainer::getRemovedMedia(TMPXItemId itemId)
+CMPXMedia* VideoDataContainer::getRemovedMedia(TMPXItemId &itemId)
{
QHash<TMPXItemId, CMPXMedia*>::const_iterator itemIter =
mRemovedMedia.constFind(itemId);
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/testvideomodel_p.pro Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/testvideomodel_p.pro Fri Aug 06 09:43:48 2010 +0300
@@ -22,7 +22,7 @@
symbian_test
LIBS += -lmpxcommon.dll -lflogger.dll -lestor.dll \
- -lfbscli.dll -lbitgdi.dll -lgdi.dll
+ -lfbscli.dll -lbitgdi.dll -lgdi.dll -lxqutils.dll
# Input
HEADERS += stub/inc/metadatasignalspy.h \
--- a/videocollection/videocollectionwrapper/tsrc/testvideosortfilterproxymodel/inc/testvideosortfilterproxymodel.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideosortfilterproxymodel/inc/testvideosortfilterproxymodel.h Fri Aug 06 09:43:48 2010 +0300
@@ -252,15 +252,11 @@
void testSetAlbumInUse();
/**
- * tests renameAlbum
+ * tests renameItem
*/
- void testRenameAlbum();
+ void testRenameItem();
- /**
- * tests itemModifiedSlot
- */
- void testItemModifiedSlot();
-
+
private:
/**
--- a/videocollection/videocollectionwrapper/tsrc/testvideosortfilterproxymodel/src/testvideosortfilterproxymodel.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideosortfilterproxymodel/src/testvideosortfilterproxymodel.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -165,6 +165,7 @@
//
void TestVideoSortFilterProxyModel::testDeleteItems()
{
+ VideoThumbnailData::mEnableBackgroundThumbnailFetchingCallCount = 0;
VideoCollectionClient::mFailStartOpen = false;
QVERIFY(mTestObject->initialize(mStubModel) == 0);
QVERIFY(mTestObject->open(VideoCollectionCommon::ELevelVideos) == 0);
@@ -198,7 +199,11 @@
QModelIndexList emptyList;
VideoThumbnailData::mStartBackgroundFetchingCallCount = 0;
QVERIFY(mTestObject->deleteItems(emptyList) == 0);
+ QCOMPARE(VideoThumbnailData::mEnableBackgroundThumbnailFetchingCallCount, 2);
+ QVERIFY(VideoThumbnailData::mBackgroundThumbnailFetchingEnabled == true);
QVERIFY(mTestObject->deleteItems(list) == 0);
+ QCOMPARE(VideoThumbnailData::mEnableBackgroundThumbnailFetchingCallCount, 4);
+ QVERIFY(VideoThumbnailData::mBackgroundThumbnailFetchingEnabled == true);
QVERIFY(mStubModel->mLastDeletedIndexRow == 0);
QVERIFY(VideoThumbnailData::mStartBackgroundFetchingCallCount == 2);
}
@@ -851,8 +856,8 @@
// need to wait for awhile to make sure zero-counter gets
// processing time.
QTest::qWait(500);
- QCOMPARE(spyAboutToChange.count(), 2); // 2 times because also the setSortRole causes this signal.
- QCOMPARE(spyChanged.count(), 2); // 2 times because also the setSortRole causes this signal.
+ QCOMPARE(spyAboutToChange.count(), 1);
+ QCOMPARE(spyChanged.count(), 1);
QCOMPARE(mTestObject->sortRole(), (int)VideoCollectionCommon::KeyTitle);
QCOMPARE(mTestObject->sortOrder(), Qt::AscendingOrder);
QVERIFY(VideoThumbnailData::mStartBackgroundFetchingCallCount == 1);
@@ -1274,18 +1279,25 @@
TMPXItemId albumId(1,2);
QList<TMPXItemId> items;
items.append(TMPXItemId(1,0));
-
+ VideoThumbnailData::mEnableBackgroundThumbnailFetchingCallCount = 0;
// no model
+
QVERIFY(mTestObject->removeItemsFromAlbum(albumId, items) == -1);
+ QCOMPARE(VideoThumbnailData::mEnableBackgroundThumbnailFetchingCallCount, 2);
+ QVERIFY(VideoThumbnailData::mBackgroundThumbnailFetchingEnabled == true);
mTestObject->initialize(mStubModel);
// model returns < 0
VideoListDataModel::mRemoveFrAlbumReturn = -1;
QVERIFY(mTestObject->removeItemsFromAlbum(albumId, items) == -1);
+ QCOMPARE(VideoThumbnailData::mEnableBackgroundThumbnailFetchingCallCount, 4);
+ QVERIFY(VideoThumbnailData::mBackgroundThumbnailFetchingEnabled == true);
VideoListDataModel::mRemoveFrAlbumReturn = 11;
// "succeed"
QVERIFY(mTestObject->removeItemsFromAlbum(albumId, items) == 0);
+ QCOMPARE(VideoThumbnailData::mEnableBackgroundThumbnailFetchingCallCount, 6);
+ QVERIFY(VideoThumbnailData::mBackgroundThumbnailFetchingEnabled == true);
}
// ---------------------------------------------------------------------------
@@ -1486,10 +1498,10 @@
}
// ---------------------------------------------------------------------------
-// testRenameAlbum
+// testRenameItem
// ---------------------------------------------------------------------------
//
-void TestVideoSortFilterProxyModel::testRenameAlbum()
+void TestVideoSortFilterProxyModel::testRenameItem()
{
delete mTestObject;
mTestObject = new FilterProxyTester(VideoCollectionCommon::EModelTypeAllVideos);
@@ -1497,42 +1509,11 @@
// Not initialized.
TMPXItemId id = TMPXItemId::InvalidId();
QString name = "";
- QVERIFY(mTestObject->renameAlbum(id, name) == -1);
+ QVERIFY(mTestObject->renameItem(id, name) == -1);
// Initialized.
mTestObject->initialize(mStubModel);
- QVERIFY(mTestObject->renameAlbum(id, name) == 0);
-}
-
-// ---------------------------------------------------------------------------
-// testItemModifiedSlot
-// ---------------------------------------------------------------------------
-//
-void TestVideoSortFilterProxyModel::testItemModifiedSlot()
-{
- connect(this, SIGNAL(testSignalMpxId(const TMPXItemId &)), mTestObject, SLOT(itemModifiedSlot(const TMPXItemId &)));
-
- TMPXItemId id = TMPXItemId::InvalidId();
- mTestObject->initialize(mStubModel);
-
- // mType wrong
- mTestObject->mType = VideoCollectionCommon::EModelTypeAllVideos;
- emit testSignalMpxId(id);
-
- // invalid id
- mTestObject->mType = VideoCollectionCommon::EModelTypeCollections;
-
- emit testSignalMpxId(id);
-
- // item is album
- id = TMPXItemId(0, KVcxMvcMediaTypeAlbum);
- emit testSignalMpxId(id);
-
- // item is category
- id = TMPXItemId(0, KVcxMvcMediaTypeCategory);
- emit testSignalMpxId(id);
-
- disconnect(this, SIGNAL(testSignalMpxId(const TMPXItemId &)), mTestObject, SLOT(itemModifiedSlot(const TMPXItemId &)));
+ QVERIFY(mTestObject->renameItem(id, name) == 0);
}
// End of file
--- a/videocollection/videocollectionwrapper/tsrc/testvideosortfilterproxymodel/stub/inc/videocollectionclient.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideosortfilterproxymodel/stub/inc/videocollectionclient.h Fri Aug 06 09:43:48 2010 +0300
@@ -110,9 +110,9 @@
int back();
/**
- * returns mRenameAlbumReturnValue
+ * returns mRenameItemReturnValue
*/
- int renameAlbum(const TMPXItemId &albumId, const QString &newTitle);
+ int renameItem(const TMPXItemId &itemId, const QString &newTitle);
public:
static bool mFailInit;
@@ -127,7 +127,7 @@
static QString mAddNewCollectionName;
static QString mAddNewCollectionThumb;
static QList<TMPXItemId> mAddNewCollectionIds;
- static int mRenameAlbumReturnValue;
+ static int mRenameItemReturnValue;
static int mBackReturnValue;
private:
--- a/videocollection/videocollectionwrapper/tsrc/testvideosortfilterproxymodel/stub/inc/videothumbnaildata.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideosortfilterproxymodel/stub/inc/videothumbnaildata.h Fri Aug 06 09:43:48 2010 +0300
@@ -93,6 +93,7 @@
~VideoThumbnailData();
public:
+ static int mEnableBackgroundThumbnailFetchingCallCount;
static int mStartFetchingThumbnailsCallCount;
static int mStartFetchingThumbnailsThumbnailCount;
static int mInstanceCallCount;
--- a/videocollection/videocollectionwrapper/tsrc/testvideosortfilterproxymodel/stub/src/videocollectionclient.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideosortfilterproxymodel/stub/src/videocollectionclient.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -34,7 +34,7 @@
QString VideoCollectionClient::mAddNewCollectionName = QString();
QString VideoCollectionClient::mAddNewCollectionThumb = QString();
QList<TMPXItemId> VideoCollectionClient::mAddNewCollectionIds = QList<TMPXItemId>();
-int VideoCollectionClient::mRenameAlbumReturnValue = 0;
+int VideoCollectionClient::mRenameItemReturnValue = 0;
int VideoCollectionClient::mBackReturnValue = 0;
// -----------------------------------------------------------------------------
@@ -158,12 +158,12 @@
}
// -----------------------------------------------------------------------------
-// renameAlbum
+// renameItem
// -----------------------------------------------------------------------------
//
-int VideoCollectionClient::renameAlbum(const TMPXItemId &albumId, const QString &newTitle)
+int VideoCollectionClient::renameItem(const TMPXItemId &itemId, const QString &newTitle)
{
- Q_UNUSED(albumId);
+ Q_UNUSED(itemId);
Q_UNUSED(newTitle);
- return mRenameAlbumReturnValue;
+ return mRenameItemReturnValue;
}
--- a/videocollection/videocollectionwrapper/tsrc/testvideosortfilterproxymodel/stub/src/videothumbnaildata.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideosortfilterproxymodel/stub/src/videothumbnaildata.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -24,6 +24,7 @@
#include "videothumbnaildata.h"
+int VideoThumbnailData::mEnableBackgroundThumbnailFetchingCallCount = 0;
int VideoThumbnailData::mStartFetchingThumbnailsCallCount = 0;
int VideoThumbnailData::mStartFetchingThumbnailsThumbnailCount = 0;
int VideoThumbnailData::mInstanceCallCount = 0;
@@ -78,6 +79,7 @@
void VideoThumbnailData::enableBackgroundFetching(bool enable)
{
mBackgroundThumbnailFetchingEnabled = enable;
+ mEnableBackgroundThumbnailFetchingCallCount++;
}
// -----------------------------------------------------------------------------
--- a/videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata/inc/testvideothumbnaildata.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata/inc/testvideothumbnaildata.h Fri Aug 06 09:43:48 2010 +0300
@@ -42,6 +42,7 @@
void testFreeThumbnailData();
void testStartBackgroundFetching();
void testEnableThumbnailCreation();
+ void testBackgroundFetchingEnabled();
signals:
--- a/videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata/src/testvideothumbnaildata.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata/src/testvideothumbnaildata.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -163,4 +163,20 @@
QCOMPARE(VideoThumbnailDataPrivate::mEnableThumbnailCreationCallCount, 1);
}
+// ---------------------------------------------------------------------------
+// testEnableThumbnailCreation
+// ---------------------------------------------------------------------------
+//
+void TestVideoThumbnailData::testBackgroundFetchingEnabled()
+{
+ VideoThumbnailData &instance = VideoThumbnailData::instance();
+ QCOMPARE(VideoThumbnailDataPrivate::mConstructCallCount, 1);
+
+ VideoThumbnailDataPrivate::mBackgroundThumbnailFetchingEnabled = true;
+ QVERIFY(instance.backgroundFetchingEnabled() == VideoThumbnailDataPrivate::mBackgroundThumbnailFetchingEnabled);
+
+ VideoThumbnailDataPrivate::mBackgroundThumbnailFetchingEnabled = false;
+ QVERIFY(instance.backgroundFetchingEnabled() == VideoThumbnailDataPrivate::mBackgroundThumbnailFetchingEnabled);
+}
+
// End of file
--- a/videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata/stub/inc/videothumbnaildata_p.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata/stub/inc/videothumbnaildata_p.h Fri Aug 06 09:43:48 2010 +0300
@@ -136,6 +136,13 @@
*/
void enableThumbnailCreation(bool enable);
+ /**
+ * Returns background fetching enabled status.
+ *
+ * @return bool: true if background fetching is enabled, otherwise false.
+ */
+ bool backgroundFetchingEnabled();
+
signals:
/**
@@ -144,7 +151,7 @@
* @param mediaIds: media ids of the videos whose thumbnail is ready.
*
*/
- void thumbnailsFetched(QList<TMPXItemId> mediaIds);
+ void thumbnailsFetched(QList<TMPXItemId>& mediaIds);
public: // Data
@@ -155,7 +162,7 @@
static int mGetThumbnailCallCount;
static int mRemoveThumbnailCallCount;
static int mFreeThumbnailDataCallCount;
- static int mBackgroundThumbnailFetchingEnabled;
+ static bool mBackgroundThumbnailFetchingEnabled;
static int mStartBackgroundFetchingCallCount;
static int mEnableThumbnailCreationCallCount;
};
--- a/videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata/stub/src/videothumbnaildata_p.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata/stub/src/videothumbnaildata_p.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -29,7 +29,7 @@
int VideoThumbnailDataPrivate::mStartFetchingThumbnailCallCount = 0;
int VideoThumbnailDataPrivate::mGetThumbnailCallCount = 0;
int VideoThumbnailDataPrivate::mRemoveThumbnailCallCount = 0;
-int VideoThumbnailDataPrivate::mBackgroundThumbnailFetchingEnabled = true;
+bool VideoThumbnailDataPrivate::mBackgroundThumbnailFetchingEnabled = true;
int VideoThumbnailDataPrivate::mFreeThumbnailDataCallCount = 0;
int VideoThumbnailDataPrivate::mStartBackgroundFetchingCallCount = 0;
int VideoThumbnailDataPrivate::mEnableThumbnailCreationCallCount = 0;
@@ -130,4 +130,14 @@
{
mEnableThumbnailCreationCallCount++;
}
+
+// -----------------------------------------------------------------------------
+// VideoThumbnailData::enableThumbnailCreation()
+// -----------------------------------------------------------------------------
+//
+bool VideoThumbnailDataPrivate::backgroundFetchingEnabled()
+{
+ return mBackgroundThumbnailFetchingEnabled;
+}
+
// End of file
--- a/videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata_p/inc/testvideothumbnaildata_p.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata_p/inc/testvideothumbnaildata_p.h Fri Aug 06 09:43:48 2010 +0300
@@ -51,6 +51,7 @@
void testRemoveThumbnail();
void testStartBackgroundFetching();
void testEnableBackgroundFetching();
+ void testBackgroundFetchingEnabled();
void testFreeThumbnailData();
void testAllThumbnailsFetchedSlot();
void testEnableThumbnailCreation();
--- a/videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata_p/inc/videothumbnaildatatester.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata_p/inc/videothumbnaildatatester.h Fri Aug 06 09:43:48 2010 +0300
@@ -55,11 +55,6 @@
void emitReportThumbnailsReady();
/**
- * Emits modelChanged signal to itself.
- */
- void emitModelChanged();
-
- /**
* Emits aboutToQuit signal to itself.
*/
void emitAboutToQuit();
--- a/videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata_p/src/testvideothumbnaildata_p.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata_p/src/testvideothumbnaildata_p.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -123,7 +123,8 @@
VideoSortFilterProxyModel::mReturnInvalidIndexes = false;
VideoSortFilterProxyModel::mRowCountCallCount = 0;
- qRegisterMetaType<QList<TMPXItemId> >("QList<TMPXItemId>");
+
+ qRegisterMetaType<QList<TMPXItemId> >("QList<TMPXItemId>& ");
}
// ---------------------------------------------------------------------------
@@ -249,7 +250,7 @@
init();
VideoSortFilterProxyModel* backupProxyModel = mTestObject->mCurrentModel;
mTestObject->mCurrentModel = NULL;
- spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
+ spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId> &)));
QCOMPARE(mTestObject->startFetchingThumbnail(TMPXItemId(0, 0), TB_PRIORITY), -1);
QVERIFY(checkThumbnailReadyCount(spy, 0));
delete spy;
@@ -261,7 +262,7 @@
init();
VideoThumbnailFetcher* backup = mTestObject->mThumbnailFetcher;
mTestObject->mThumbnailFetcher = NULL;
- spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
+ spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId> &)));
QCOMPARE(mTestObject->startFetchingThumbnail(TMPXItemId(0, 0), TB_PRIORITY), -1);
QVERIFY(checkThumbnailReadyCount(spy, 0));
delete spy;
@@ -271,7 +272,7 @@
// Thumbnail has been already fetched.
init();
- spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
+ spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId> &)));
mTestObject->mThumbnailData.insert(TMPXItemId(10, 0), 0);
QCOMPARE(mTestObject->startFetchingThumbnail(TMPXItemId(10, 0), TB_PRIORITY), 0);
QVERIFY(checkThumbnailReadyCount(spy, 0));
@@ -283,7 +284,7 @@
init();
VideoThumbnailFetcher::mAddFetchFails = true;
mTestObject->mCurrentModel->appendData("testfile");
- spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
+ spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId> &)));
QCOMPARE(mTestObject->startFetchingThumbnail(TMPXItemId(0, 0), TB_PRIORITY), 0);
QVERIFY(checkThumbnailReadyCount(spy, 0));
QCOMPARE(VideoThumbnailFetcher::mRequests.count(), 0);
@@ -293,7 +294,7 @@
// Filename is empty.
init();
mTestObject->mCurrentModel->appendData("");
- spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
+ spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId> &)));
QCOMPARE(mTestObject->startFetchingThumbnail(TMPXItemId(0, 0), TB_PRIORITY), 0);
QVERIFY(checkThumbnailReadyCount(spy, 0));
QCOMPARE(VideoThumbnailFetcher::mRequests.count(), 0);
@@ -303,7 +304,7 @@
// Filename is null.
init();
mTestObject->mCurrentModel->appendData(QString());
- spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
+ spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId> &)));
QCOMPARE(mTestObject->startFetchingThumbnail(TMPXItemId(0, 0), TB_PRIORITY), 0);
QVERIFY(checkThumbnailReadyCount(spy, 0));
QCOMPARE(VideoThumbnailFetcher::mRequests.count(), 0);
@@ -316,7 +317,7 @@
init();
QString fileName("video.mp4");
mTestObject->mCurrentModel->appendData(fileName);
- spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
+ spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId> &)));
QCOMPARE(mTestObject->startFetchingThumbnail(TMPXItemId(0, 0), TB_PRIORITY), 0);
QVERIFY(checkThumbnailReadyCount(spy, 0));
QCOMPARE(VideoThumbnailFetcher::mRequests.count(), 1);
@@ -330,7 +331,7 @@
init();
mTestObject->mCurrentModel->appendData(fileName);
VideoThumbnailFetcher::mRequests.insert(1, VideoThumbnailFetcher::TnRequest("test1", 0, -1, false));
- spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
+ spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId> &)));
QCOMPARE(mTestObject->startFetchingThumbnail(TMPXItemId(0, 0), TB_PRIORITY), 0);
QVERIFY(checkThumbnailReadyCount(spy, 0));
QCOMPARE(VideoThumbnailFetcher::mRequests.count(), 1);
@@ -360,7 +361,7 @@
VideoSortFilterProxyModel* backupProxyModel = mTestObject->mCurrentModel;
mTestObject->mCurrentModel = NULL;
- spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
+ spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId> &)));
QCOMPARE(mTestObject->startFetchingThumbnails(indexes,
BACKGROUND_FETCH_PRIORITY), -1);
QVERIFY(checkThumbnailReadyCount(spy, 0));
@@ -378,7 +379,7 @@
indexes.append(mTestObject->mCurrentModel->index(0, 0, QModelIndex()));
indexes.append(mTestObject->mCurrentModel->index(10, 0, QModelIndex()));
indexes.append(mTestObject->mCurrentModel->index(20, 0, QModelIndex()));
- spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
+ spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId> &)));
QCOMPARE(mTestObject->startFetchingThumbnails(indexes,
BACKGROUND_FETCH_PRIORITY), -1);
QVERIFY(checkThumbnailReadyCount(spy, 0));
@@ -391,7 +392,7 @@
// Tests when parameter array indexes is empty.
init();
indexes.clear();
- spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
+ spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId> &)));
QCOMPARE(mTestObject->startFetchingThumbnails(indexes,
BACKGROUND_FETCH_PRIORITY), 0);
QVERIFY(checkThumbnailReadyCount(spy, 0));
@@ -409,7 +410,7 @@
VideoThumbnailFetcher::mRequests[40] = VideoThumbnailFetcher::TnRequest("test2", 0, -1, false);
VideoThumbnailFetcher::mRequests[30] = VideoThumbnailFetcher::TnRequest("test3", 0, -1, false);
indexes.append(mTestObject->mCurrentModel->index(0, 0, QModelIndex()));
- spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
+ spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId> &)));
QCOMPARE(mTestObject->startFetchingThumbnails(indexes,
BACKGROUND_FETCH_PRIORITY), 1);
QVERIFY(checkThumbnailReadyCount(spy, 0));
@@ -448,7 +449,7 @@
indexes.append(mTestObject->mCurrentModel->index(2, 0, QModelIndex()));
indexes.append(mTestObject->mCurrentModel->index(3, 0, QModelIndex()));
indexes.append(mTestObject->mCurrentModel->index(4, 0, QModelIndex()));
- spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
+ spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId> &)));
QCOMPARE(mTestObject->startFetchingThumbnails(indexes,
BACKGROUND_FETCH_PRIORITY), 3);
QVERIFY(checkThumbnailReadyCount(spy, 0));
@@ -482,7 +483,7 @@
init();
VideoSortFilterProxyModel* backupProxyModel = mTestObject->mCurrentModel;
mTestObject->mCurrentModel = NULL;
- spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
+ spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId> &)));
mTestObject->emitDoBackgroundFetching();
QVERIFY(checkThumbnailReadyCount(spy, 0));
delete spy;
@@ -496,7 +497,7 @@
init();
VideoThumbnailFetcher* backup = mTestObject->mThumbnailFetcher;
mTestObject->mThumbnailFetcher = NULL;
- spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
+ spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId> &)));
mTestObject->emitDoBackgroundFetching();
QVERIFY(checkThumbnailReadyCount(spy, 0));
delete spy;
@@ -511,7 +512,7 @@
{
mTestObject->mCurrentModel->appendData(QString("file") + QString::number(i));
}
- spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
+ spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId> &)));
mTestObject->emitDoBackgroundFetching();
QVERIFY(checkThumbnailReadyCount(spy, 0));
QCOMPARE(VideoThumbnailFetcher::mRequests.count(), THUMBNAIL_BACKGROUND_FETCH_AMOUNT/2);
@@ -559,7 +560,7 @@
{
mTestObject->mCurrentModel->appendData(QString("file") + QString::number(i));
}
- spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
+ spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId> &)));
mTestObject->mCurrentFetchIndex = THUMBNAIL_BACKGROUND_FETCH_AMOUNT/2*-1;
mTestObject->emitDoBackgroundFetching();
QVERIFY(checkThumbnailReadyCount(spy, 0));
@@ -575,7 +576,7 @@
{
mTestObject->mCurrentModel->appendData(QString("file") + QString::number(i));
}
- spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
+ spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId> &)));
mTestObject->mCurrentFetchIndex = THUMBNAIL_BACKGROUND_FETCH_AMOUNT*2;
mTestObject->emitDoBackgroundFetching();
QVERIFY(checkThumbnailReadyCount(spy, 0));
@@ -591,7 +592,7 @@
{
mTestObject->mCurrentModel->appendData(QString("file") + QString::number(i));
}
- spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
+ spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId> &)));
mTestObject->mCurrentFetchIndex = THUMBNAIL_BACKGROUND_FETCH_AMOUNT + THUMBNAIL_BACKGROUND_FETCH_AMOUNT/2;
mTestObject->emitDoBackgroundFetching();
QVERIFY(checkThumbnailReadyCount(spy, 0));
@@ -603,7 +604,7 @@
// no items and fetch index -5
init();
- spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
+ spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId> &)));
mTestObject->mCurrentFetchIndex = -5;
mTestObject->emitDoBackgroundFetching();
QVERIFY(checkThumbnailReadyCount(spy, 0));
@@ -619,7 +620,7 @@
{
mTestObject->mCurrentModel->appendData(QString("file") + QString::number(i));
}
- spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
+ spy = new QSignalSpy(mTestObject, SIGNAL(thumbnailsFetched(QList<TMPXItemId>&)));
VideoSortFilterProxyModel::mReturnInvalidIndexes = true;
mTestObject->mCurrentFetchIndex = THUMBNAIL_BACKGROUND_FETCH_AMOUNT/2;
mTestObject->emitDoBackgroundFetching();
@@ -855,6 +856,22 @@
}
// ---------------------------------------------------------------------------
+// testBackgroundFetchingEnabled
+// ---------------------------------------------------------------------------
+//
+void TestVideoThumbnailData_p::testBackgroundFetchingEnabled()
+{
+ init();
+
+ mTestObject->enableBackgroundFetching(true);
+ QVERIFY(mTestObject->backgroundFetchingEnabled() == true);
+
+ mTestObject->enableBackgroundFetching(false);
+ QVERIFY(mTestObject->backgroundFetchingEnabled() == false);
+
+ cleanup();
+}
+// ---------------------------------------------------------------------------
// testFreeThumbnailData
// ---------------------------------------------------------------------------
//
--- a/videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata_p/src/videothumbnaildatatester.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata_p/src/videothumbnaildatatester.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -29,7 +29,6 @@
VideoThumbnailDataTester::VideoThumbnailDataTester()
{
connect(this, SIGNAL(doBackgroundFetchingSignal()), this, SLOT(doBackgroundFetching()));
- connect(this, SIGNAL(modelChangedSignal()), this, SLOT(modelChangedSlot()));
connect(this, SIGNAL(reportThumbnailsReadySignal()), this, SLOT(reportThumbnailsReadySlot()));
connect(this, SIGNAL(aboutToQuitSignal()), this, SLOT(aboutToQuitSlot()));
}
@@ -41,7 +40,6 @@
VideoThumbnailDataTester::~VideoThumbnailDataTester()
{
disconnect(this, SIGNAL(doBackgroundFetchingSignal()), this, SLOT(doBackgroundFetching()));
- disconnect(this, SIGNAL(modelChangedSignal()), this, SLOT(modelChangedSlot()));
disconnect(this, SIGNAL(reportThumbnailsReadySignal()), this, SLOT(reportThumbnailsReadySlot()));
disconnect(this, SIGNAL(aboutToQuitSignal()), this, SLOT(aboutToQuitSlot()));
}
@@ -65,15 +63,6 @@
}
// -----------------------------------------------------------------------------
-// VideoThumbnailDataTester::emitModelChanged()
-// -----------------------------------------------------------------------------
-//
-void VideoThumbnailDataTester::emitModelChanged()
-{
- emit modelChangedSignal();
-}
-
-// -----------------------------------------------------------------------------
// VideoThumbnailDataTester::emitAboutToQuit()
// -----------------------------------------------------------------------------
//
--- a/videocollection/videofiledetailsview/inc/videofiledetailsviewplugin.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videofiledetailsview/inc/videofiledetailsviewplugin.h Fri Aug 06 09:43:48 2010 +0300
@@ -34,6 +34,7 @@
class VideoServices;
class VideoCollectionWrapper;
class VideoDetailsLabel;
+class ShareUi;
class VideoFileDetailsViewPlugin : public MpxViewPlugin
{
@@ -297,6 +298,11 @@
* Play icon with transparent background.
*/
QPixmap mPlayIcon;
+
+ /**
+ * Share ui object for handling of sharing videos
+ */
+ ShareUi *mShareUi;
};
#endif // VIDEOFILEDETAILSPLUGIN_H
--- a/videocollection/videofiledetailsview/src/videofiledetailsviewplugin.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videofiledetailsview/src/videofiledetailsviewplugin.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 76.1.5 %
+// Version : %version: 76.1.7 %
// INCLUDE FILES
#include <qcoreapplication.h>
@@ -33,6 +33,7 @@
#include <hblistwidgetitem.h>
#include <hblistviewitem.h>
#include <hbparameterlengthlimiter.h>
+#include <hbtextitem.h>
#include <cmath>
#include <thumbnailmanager_qt.h>
#include <shareui.h>
@@ -88,6 +89,7 @@
, mThumbLabel( 0 )
, mThumbnailManager( 0 )
, mCollectionWrapper( VideoCollectionWrapper::instance() )
+ , mShareUi(0)
{
FUNC_LOG;
}
@@ -273,7 +275,7 @@
HbView *currentView = mainWnd->currentView();
if(currentView && mNavKeyBackAction)
{
- if (connect(mNavKeyBackAction, SIGNAL(triggered()), this, SLOT(back())))
+ if (connect(mNavKeyBackAction, SIGNAL(triggered()), this, SLOT(back())), Qt::UniqueConnection)
{
currentView->setNavigationAction(mNavKeyBackAction);
}
@@ -340,12 +342,12 @@
HbIcon icon = HbIcon("qtg_mono_attach");
button->setIcon(icon);
- connect(button, SIGNAL(clicked(bool)), this, SLOT(getFileUri()));
- connect(this, SIGNAL(fileUri(const QString&)), mVideoServices, SLOT(itemSelected(const QString&)));
+ connect(button, SIGNAL(clicked(bool)), this, SLOT(getFileUri()), Qt::UniqueConnection);
+ connect(this, SIGNAL(fileUri(const QString&)), mVideoServices, SLOT(itemSelected(const QString&)), Qt::UniqueConnection);
}
else
{
- connect(button, SIGNAL(clicked(bool)), this, SLOT(sendVideoSlot()));
+ connect(button, SIGNAL(clicked(bool)), this, SLOT(sendVideoSlot()), Qt::UniqueConnection);
HbIcon icon = HbIcon("qtg_mono_share");
button->setIcon(icon);
@@ -353,11 +355,13 @@
connect(mainWnd,
SIGNAL(orientationChanged(Qt::Orientation)),
- this, SLOT(orientationChange(Qt::Orientation)));
+ this, SLOT(orientationChange(Qt::Orientation)),
+ Qt::UniqueConnection);
connect(&mCollectionWrapper,
SIGNAL(asyncStatus(int, QVariant&)),
- this, SLOT(handleErrorSlot(int, QVariant&)));
+ this, SLOT(handleErrorSlot(int, QVariant&)),
+ Qt::UniqueConnection);
// setup title size in order for animation to be enabled if needed
mTitleAnim->setMinimumWidth(hbInstance->allMainWindows().value(0)->width()-50);
@@ -418,6 +422,8 @@
disconnect(button, SIGNAL(clicked(bool)), this, SLOT(sendVideoSlot()));
}
}
+ delete mShareUi;
+ mShareUi = 0;
}
// ---------------------------------------------------------------------------
@@ -518,10 +524,20 @@
if (metadata.contains(VideoDetailLabelKeys[i]))
{
HbListWidgetItem* listWidgetItem = new HbListWidgetItem();
- listWidgetItem->setEnabled(false);
listWidgetItem->setText( hbTrId(VideoDetailLabels[i]));
listWidgetItem->setSecondaryText(metadata[VideoDetailLabelKeys[i]].toString());
list->addItem(listWidgetItem);
+
+ // following is required to change wrapping-mode for the second row
+ HbListViewItem *viewItem = static_cast<HbListViewItem*>(list->viewItem(list->row(listWidgetItem)));
+ if(viewItem)
+ {
+ HbTextItem *secondLine = static_cast<HbTextItem*>(viewItem->primitive("text-2"));
+ if(secondLine)
+ {
+ secondLine->setTextWrapping(Hb::TextWrapAnywhere);
+ }
+ }
}
}
@@ -568,18 +584,20 @@
void VideoFileDetailsViewPlugin::sendVideoSlot()
{
FUNC_LOG;
-// HbMessageBox::information(tr("Not implemented yet"));
if(mVideoId != TMPXItemId::InvalidId())
{
- ShareUi dialog;
+ if(!mShareUi)
+ {
+ mShareUi = new ShareUi();
+ }
QModelIndex modelIndex = mModel->indexOfId(mVideoId);
QVariant variant = mModel->data(modelIndex, VideoCollectionCommon::KeyFilePath);
if(variant.isValid())
{
QStringList fileList;
fileList.append(variant.toString());
- dialog.send(fileList, true);
+ mShareUi->send(fileList, true);
}
}
}
--- a/videocollection/videofiledetailsview/tsrc/testplugin/src/testvideofiledetails.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videofiledetailsview/tsrc/testplugin/src/testvideofiledetails.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -84,7 +84,7 @@
//
void TestVideoFileDetails::cleanupTestCase()
{
- disconnect(this, SIGNAL(shortDetailsReady(int)), mDummyModel, SIGNAL(shortDetailsReady(int)));
+ disconnect(this, SIGNAL(shortDetailsReady(TMPXItemId)), mDummyModel, SIGNAL(shortDetailsReady(TMPXItemId)));
disconnect(this, SIGNAL(fullDetailsReady(QVariant&)),mDummyModel, SIGNAL(fullVideoDetailsReady(QVariant&)));
disconnect(this, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)),
mDummyModel, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)));
@@ -484,24 +484,6 @@
QVERIFY( detail->text().contains(expected) );
}
- // for coverity sake, retest without star-rating
- variant = QVariant(createDummyMetadata());
- emit fullDetailsReady(variant);
-
- int ii = 0;
- for(int i = 0; i<detailCount; i++)
- {
- if(VideoCollectionCommon::VideoDetailLabelKeys[i] != VideoCollectionCommon::MetaKeyStarRating)
- {
- QString expected = tr(VideoCollectionCommon::VideoDetailLabels[i]).arg(
- VideoCollectionCommon::VideoDetailLabelKeys[i]);
- HbListWidgetItem* detail = list->item(ii);
- QVERIFY( detail != 0 );
- QVERIFY( detail->text().contains(expected) );
- }
- ++ii;
- }
-
cleanup();
}
@@ -549,7 +531,6 @@
//
void TestVideoFileDetails::testSendVideoSlot()
{
-// QFAIL("Feature not yet implemented!");
mDummyModel->reset();
init();
@@ -580,6 +561,10 @@
QCOMPARE( ShareUi::mFileList.count(), 1 );
QCOMPARE( ShareUi::mFileList.at(0), filePath );
+ mPlugin->deactivateView();
+
+ QVERIFY(!mPlugin->mShareUi);
+
cleanup();
}
--- a/videocollection/videofiledetailsview/tsrc/testplugin/stub/inc/hbmessagebox.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videofiledetailsview/tsrc/testplugin/stub/inc/hbmessagebox.h Fri Aug 06 09:43:48 2010 +0300
@@ -28,6 +28,7 @@
class HbMessageBox : public QObject
{
Q_OBJECT
+
public:
enum MessageBoxType {
@@ -110,4 +111,6 @@
void finished(int);
};
+Q_DECLARE_OPERATORS_FOR_FLAGS(HbMessageBox::StandardButtons)
+
#endif // HBMESSAGEBOX_H
--- a/videocollection/videofiledetailsview/tsrc/testplugin/stub/inc/videocollectionwrapper.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videocollection/videofiledetailsview/tsrc/testplugin/stub/inc/videocollectionwrapper.h Fri Aug 06 09:43:48 2010 +0300
@@ -76,7 +76,7 @@
signals:
- void error(int errorCode, QVariant &additional);
+ void asyncStatus(int errorCode, QVariant &additional);
private:
--- a/videoplayback/inc/videobaseplaybackview.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayback/inc/videobaseplaybackview.h Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#20 %
+// Version : %version: da1mmcf#21 %
@@ -56,6 +56,8 @@
protected slots:
void handleClosePopupDialog();
+ void handleAppBackground();
+ void handleAppForeground();
public:
--- a/videoplayback/videohelix/inc/mpxvideoplayerutility.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayback/videohelix/inc/mpxvideoplayerutility.h Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,8 @@
*
*/
-// Version : %version: 13 %
+
+// Version : %version: 14 %
#ifndef __MPXVIDEOPLAYERUTILITY__
@@ -103,16 +104,16 @@
void SetPlayVelocityL( TInt aVelocity );
void GetVideoLoadingProgressL( TInt& aPercentageProgress );
-
+
void GetFrameL();
//
// MMMFControllerEventMonitorObserver Implementation
//
void HandleEvent( const TMMFEvent& aEvent );
-
+
CFbsBitmap& GetBitmap();
-
+
void RunL();
void DoCancel();
@@ -124,7 +125,8 @@
TInt VideoSurfaceCreated();
TInt SurfaceParametersChanged();
- TInt RemoveSurface();
+ void RemoveSurface();
+ TInt RemoveSurfaceFromHelix( TSurfaceId aSurfaceId );
void SendSurfaceCommandL( TInt aCmd );
@@ -168,7 +170,7 @@
CMMFControllerEventMonitor* iControllerEventMonitor;
TBool iDirectScreenAccessAbort;
-
+
CFbsBitmap* iPosterFrameBitmap;
};
--- a/videoplayback/videohelix/src/mpxvideoplaybackcontroller.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayback/videohelix/src/mpxvideoplaybackcontroller.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -16,7 +16,7 @@
*/
-// Version : %version: 62 %
+// Version : %version: 65 %
//
@@ -544,7 +544,21 @@
case EPbCmdSetPosterFrame:
{
iState->HandleSetPosterFrame();
- break;
+ break;
+ }
+ case EPbCmdSurfaceRemovedFromWindow:
+ {
+ TSurfaceId surfaceId =
+ aCmd.ValueTObjectL<TSurfaceId>( KMPXMediaVideoDisplayTSurfaceId );
+
+ TInt error = iPlayer->RemoveSurfaceFromHelix( surfaceId );
+
+ if ( error != KErrNone )
+ {
+ MPX_TRAPD( err, iState->SendErrorToViewL( error ) );
+ }
+
+ break;
}
}
}
@@ -770,12 +784,7 @@
}
else if ( aEvent.iEventType == KMMFEventCategoryVideoRemoveSurface )
{
- TInt error = iPlayer->RemoveSurface();
-
- if ( error != KErrNone )
- {
- MPX_TRAPD( err, iState->SendErrorToViewL( error ) );
- }
+ iPlayer->RemoveSurface();
}
#endif // SYMBIAN_BUILD_GCE
else if ( aEvent.iEventType == KMMFEventCategoryVideoPlayerGeneralError )
@@ -868,7 +877,7 @@
_L("CMPXVideoPlaybackController::SetVolumeCenRepL()"),
_L("aVolume = %d"), aVolume );
- if ( iFileDetails && iFileDetails->iAudioEnabled )
+ if ( iFileDetails && iFileDetails->iAudioEnabled && !iAccessoryMonitor->IsTvOutConnected() )
{
TInt volume( 0 );
@@ -891,7 +900,7 @@
// For example, if we get 77, we need to save it as 70 in 10 volume steps
//
volume -= volume % iVolumeNormalizer;
-
+
MPX_DEBUG(
_L("CMPXVideoPlaybackController::SetVolumeCenRepL(): Setting volume = %d"), volume );
@@ -2522,15 +2531,15 @@
#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
-// ------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackController::IsViewActivated()
-// ------------------------------------------------------------------------------------------------
-//
-TBool CMPXVideoPlaybackController::IsViewActivated()
-{
- MPX_DEBUG(_L("CMPXVideoPlaybackController::IsViewActivated"));
- return iViewActivated;
-}
+// ------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackController::IsViewActivated()
+// ------------------------------------------------------------------------------------------------
+//
+TBool CMPXVideoPlaybackController::IsViewActivated()
+{
+ MPX_DEBUG(_L("CMPXVideoPlaybackController::IsViewActivated(%d)"), iViewActivated);
+ return iViewActivated;
+}
// ------------------------------------------------------------------------------------------------
// CMPXVideoPlaybackController::HandleFrameReady()
@@ -2539,7 +2548,7 @@
void CMPXVideoPlaybackController::HandleFrameReady(TInt aError)
{
MPX_DEBUG(_L("CMPXVideoPlaybackController::HandleFrameReady"));
-
+
iPlaybackMode->HandleFrameReady(aError);
}
// End of file
--- a/videoplayback/videohelix/src/mpxvideoplaybackmode.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayback/videohelix/src/mpxvideoplaybackmode.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -16,7 +16,7 @@
*/
-// Version : %version: 33 %
+// Version : %version: 34 %
//
@@ -301,7 +301,7 @@
// ------------------------------------------------------------------------------------------------
// CMPXVideoPlaybackMode::SendErrorToView()
// ------------------------------------------------------------------------------------------------
-TBool CMPXVideoPlaybackMode::SendErrorToView( TInt aError )
+TBool CMPXVideoPlaybackMode::SendErrorToView( TInt /*aError*/ )
{
MPX_DEBUG(_L("CMPXLocalPlaybackMode::SendErrorToView(%d)"), ETrue);
--- a/videoplayback/videohelix/src/mpxvideoplayerutility.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayback/videohelix/src/mpxvideoplayerutility.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -16,7 +16,7 @@
*/
-// Version : %version: 22 %
+// Version : %version: 23 %
#include <AudioPreference.h>
@@ -62,7 +62,7 @@
void CMpxVideoPlayerUtility::ConstructL()
{
OpenControllerL();
-
+
CActiveScheduler::Add( this );
}
@@ -88,17 +88,17 @@
iController.Close();
iDirectScreenAccessAbort = EFalse;
-
+
if ( IsActive() )
{
Cancel();
-
+
if ( iPosterFrameBitmap )
{
delete iPosterFrameBitmap;
- iPosterFrameBitmap = NULL;
+ iPosterFrameBitmap = NULL;
}
- }
+ }
}
void CMpxVideoPlayerUtility::Reset()
@@ -324,18 +324,18 @@
}
void CMpxVideoPlayerUtility::GetFrameL()
-{
+{
MPX_DEBUG(_L("CMpxVideoPlayerUtility::GetFrameL"));
-
+
// dont get another frame if a request is already pending
//
if ( ! IsActive() )
{
iPosterFrameBitmap = new (ELeave) CFbsBitmap;
- User::LeaveIfError(iPosterFrameBitmap->Create(TSize(0,0), EColor16MU));
-
- iVideoPlayControllerCustomCommands.GetFrame( *iPosterFrameBitmap, iStatus );
- SetActive();
+ User::LeaveIfError(iPosterFrameBitmap->Create(TSize(0,0), EColor16MU));
+
+ iVideoPlayControllerCustomCommands.GetFrame( *iPosterFrameBitmap, iStatus );
+ SetActive();
}
}
@@ -343,32 +343,32 @@
void CMpxVideoPlayerUtility::RunL()
{
MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::RunL()"));
-
+
if ( iStatus.Int() == KErrNone )
- {
- iVideoPlaybackController->HandleFrameReady( iStatus.Int() );
- }
+ {
+ iVideoPlaybackController->HandleFrameReady( iStatus.Int() );
+ }
else
{
- // Bitmap ownership will NOT be transferred to thumbnail manager so delete it
+ // Bitmap ownership will NOT be transferred to thumbnail manager so delete it
delete iPosterFrameBitmap;
- iPosterFrameBitmap = NULL;
- }
+ iPosterFrameBitmap = NULL;
+ }
}
void CMpxVideoPlayerUtility::DoCancel()
{
MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::DoCancel()"));
-
- // Bitmap ownership will NOT be transferred to thumbnail manager so delete it
+
+ // Bitmap ownership will NOT be transferred to thumbnail manager so delete it
delete iPosterFrameBitmap;
- iPosterFrameBitmap = NULL;
+ iPosterFrameBitmap = NULL;
}
CFbsBitmap& CMpxVideoPlayerUtility::GetBitmap()
{
MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::GetBitmap()"));
-
+
return *iPosterFrameBitmap;
}
@@ -628,21 +628,32 @@
// CMpxVideoPlayerUtility::RemoveSurface()
// -------------------------------------------------------------------------------------------------
//
-TInt CMpxVideoPlayerUtility::RemoveSurface()
+void CMpxVideoPlayerUtility::RemoveSurface()
{
- TInt error = KErrNone;
+ MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::RemoveSurface()"));
- if ( !iSurfaceId.IsNull() )
+ if ( ! iSurfaceId.IsNull() )
{
//
// Send command to view to remove the surface
//
MPX_TRAPD( err, SendSurfaceCommandL( EPbMsgVideoSurfaceRemoved ) );
- error = iVideoPlaySurfaceSupportCustomCommands.SurfaceRemoved( iSurfaceId );
-
iSurfaceId = TSurfaceId::CreateNullId();
}
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMpxVideoPlayerUtility::RemoveSurfaceFromHelix()
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMpxVideoPlayerUtility::RemoveSurfaceFromHelix( TSurfaceId aSurfaceId )
+{
+ MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::RemoveSurfaceFromHelix()"));
+
+ TInt error = KErrNone;
+
+ error = iVideoPlaySurfaceSupportCustomCommands.SurfaceRemoved( aSurfaceId );
return error;
}
--- a/videoplayback/videohelix/tsrc/ut_videohelixtest/inc/mpxvideoplayerutility_stub.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/inc/mpxvideoplayerutility_stub.h Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 14 %
+// Version : %version: 15 %
#ifndef __MPXVIDEOPLAYERUTILITY__
@@ -25,6 +25,7 @@
// INCLUDES
//
#include <mmf/common/mmfcontroller.h>
+#include <e32base.h>
#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
#include <mmf/common/mmfstandardcustomcommandsimpl.h>
@@ -34,6 +35,10 @@
#include <mmf/common/mmfdrmcustomcommands.h>
+#ifdef SYMBIAN_BUILD_GCE
+#include <mmf/common/mmfvideosurfacecustomcommands.h>
+#endif
+
#include "videohelixtest.h"
typedef CArrayPtrFlat<TMMFEvent> CMmfCallbackArray;
@@ -113,7 +118,7 @@
void SetVolumeSteps( TInt aVolumeSteps );
void SurfaceRemovedFromView();
-
+
void GetFrameL();
CFbsBitmap& GetBitmap();
@@ -125,7 +130,8 @@
TInt VideoSurfaceCreated();
TInt SurfaceParametersChanged();
- TInt RemoveSurface();
+ void RemoveSurface();
+ TInt RemoveSurfaceFromHelix( TSurfaceId aSurfaceId );;
void SendSurfaceCreatedCommand();
#endif
@@ -184,7 +190,7 @@
TTimeIntervalMicroSeconds iPosition;
TTimeIntervalMicroSeconds iDuration;
-
+
CFbsBitmap* iPosterFrameBitmap;
};
--- a/videoplayback/videohelix/tsrc/ut_videohelixtest/src/mpxvideoplayerutility_stub.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/src/mpxvideoplayerutility_stub.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 17 %
+// Version : %version: 18 %
#include <audiopreference.h>
#include <mmf/server/mmffile.h>
@@ -427,8 +427,8 @@
void CMpxVideoPlayerUtility::GetFrameL()
{
- MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::GetFrameL()"));
-
+ MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::GetFrameL()"));
+
if ( iStifObserver )
{
TCallbackEvent* event = new TCallbackEvent;
@@ -436,16 +436,16 @@
event->iData = 0;
event->iError = KErrNone;
iStifObserver->HandleUtilityEvent( event );
- }
-
- iVideoPlaybackController->HandleFrameReady( KErrGeneral );
+ }
+
+ iVideoPlaybackController->HandleFrameReady( KErrGeneral );
}
-
+
CFbsBitmap& CMpxVideoPlayerUtility::GetBitmap()
{
MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::GetBitmap()"));
-
- iPosterFrameBitmap = new (ELeave) CFbsBitmap;
+
+ iPosterFrameBitmap = new (ELeave) CFbsBitmap;
return *iPosterFrameBitmap;
}
@@ -681,7 +681,7 @@
iTitle = value.AllocL();
}
else if ( ! aItem.Compare(_L8("Description")) ||
- ! aItem.Compare(_L8("Abstract")) )
+ ! aItem.Compare(_L8("Abstract")) )
{
if ( ! iDescription )
{
@@ -771,14 +771,18 @@
return KErrNone;
}
-TInt CMpxVideoPlayerUtility::RemoveSurface()
+void CMpxVideoPlayerUtility::RemoveSurface()
+{
+}
+
+TInt CMpxVideoPlayerUtility::RemoveSurfaceFromHelix( TSurfaceId aSurfaceId )
{
return KErrNone;
}
-void CMpxVideoPlayerUtility::SendSurfaceCreatedCommand()
-{
- MPX_DEBUG(_L("CMpxVideoPlayerUtility::SendSurfaceCreatedCommand()"));
+void CMpxVideoPlayerUtility::SendSurfaceCreatedCommand()
+{
+ MPX_DEBUG(_L("CMpxVideoPlayerUtility::SendSurfaceCreatedCommand()"));
}
#endif
--- a/videoplayback/videoplaybackview/controlinc/videoplaybackcontrol.hrh Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayback/videoplaybackview/controlinc/videoplaybackcontrol.hrh Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 8 %
+// Version : %version: 9 %
#ifndef VIDEOPLAYBACKCONTROL_HRH_
@@ -88,7 +88,9 @@
EControlCmdFullScreenViewOpened,
EControlCmdDetailsViewOpened,
EControlCmdAudionOnlyViewOpened,
- EControlCmdRemoveRNLogo
+ EControlCmdRemoveRNLogo,
+ EControlCmdSurfaceAttached,
+ EControlCmdSurfaceDetached
};
enum TVideoUserInputType
--- a/videoplayback/videoplaybackview/controlinc/videoplaybackcontrolconfiguration.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayback/videoplaybackview/controlinc/videoplaybackcontrolconfiguration.h Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#8 %
+// Version : %version: da1mmcf#9 %
@@ -67,7 +67,7 @@
* Create control list
*/
void createControlList();
-
+
private:
/**
@@ -86,6 +86,7 @@
private:
VideoPlaybackControlsController *mControlsController;
QList<TVideoPlaybackControls> mControlsList;
+ bool mSurfaceAttached;
};
#endif /*VIDEOPLAYBACKCONTROLCONFIGURATION_H_*/
--- a/videoplayback/videoplaybackview/controlsrc/videoplaybackcontrolconfiguration.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayback/videoplaybackview/controlsrc/videoplaybackcontrolconfiguration.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#23 %
+// Version : %version: da1mmcf#24 %
@@ -39,6 +39,7 @@
VideoPlaybackControlConfiguration::VideoPlaybackControlConfiguration(
VideoPlaybackControlsController* controller)
: mControlsController( controller )
+ , mSurfaceAttached( false )
{
}
@@ -102,7 +103,7 @@
{
MPX_DEBUG(_L("VideoPlaybackControlConfiguration::updateControlList(%d)"), event);
- QGraphicsWidget *widget =
+ QGraphicsWidget *widget =
mControlsController->layoutLoader()->findWidget( QString( "transparentWindow" ) );
switch ( event )
@@ -111,7 +112,10 @@
{
MPX_DEBUG(_L("VideoPlaybackControlConfiguration::updateControlList() full screen view"));
- widget->setVisible( true );
+ if ( mSurfaceAttached )
+ {
+ widget->setVisible( true );
+ }
deleteControlFromList( EDetailsViewPlaybackWindow );
deleteControlFromList( EFileDetailsWidget );
@@ -155,6 +159,26 @@
break;
}
+ case EControlCmdSurfaceAttached:
+ {
+ MPX_DEBUG(_L("VideoPlaybackControlConfiguration::updateControlList() surface added"));
+
+ mSurfaceAttached = true;
+
+ widget->setVisible( true );
+
+ break;
+ }
+ case EControlCmdSurfaceDetached:
+ {
+ MPX_DEBUG(_L("VideoPlaybackControlConfiguration::updateControlList() surface removed"));
+
+ mSurfaceAttached = false;
+
+ widget->setVisible( false );
+
+ break;
+ }
default:
{
break;
@@ -200,15 +224,6 @@
addControlToList( EControlBar );
- if ( mControlsController->fileDetails()->mVideoEnabled )
- {
- MPX_DEBUG(_L("VideoPlaybackControlConfiguration::updateControlsWithFileDetails() video enabled"));
-
- QGraphicsWidget *widget =
- mControlsController->layoutLoader()->findWidget( QString( "transparentWindow" ) );
- widget->setVisible( true );
- }
-
emit controlListUpdated();
}
--- a/videoplayback/videoplaybackview/controlsrc/videoplaybackcontrolscontroller.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayback/videoplaybackview/controlsrc/videoplaybackcontrolscontroller.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#48 %
+// Version : %version: da1mmcf#50 %
@@ -399,6 +399,8 @@
updateDownloadPosition( value );
break;
}
+ case EControlCmdSurfaceAttached:
+ case EControlCmdSurfaceDetached:
case EControlCmdSetDownloadPaused:
case EControlCmdClearDownloadPaused:
{
@@ -460,6 +462,7 @@
case EPbStateBuffering:
case EPbStatePaused:
case EPbStateNotInitialised:
+ case EPbStatePluginSeeking:
{
//
// Show all the controls
--- a/videoplayback/videoplaybackview/controlsrc/videoplaybackprogressbar.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayback/videoplaybackview/controlsrc/videoplaybackprogressbar.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#30 %
+// Version : %version: da1mmcf#31 %
@@ -406,6 +406,10 @@
break;
}
+ case EPbStatePluginSeeking:
+ {
+ break;
+ }
default:
{
setEnableProgressSlider( false );
--- a/videoplayback/videoplaybackview/controlsrc/videoplaybacktoolbar.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayback/videoplaybackview/controlsrc/videoplaybacktoolbar.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 10 %
+// Version : %version: 11 %
@@ -379,9 +379,9 @@
//
// non-pausable stream, disable 'E3rdButton' action (for 'Pause' button)
//
- mButtonActions[E3rdButton]->setEnabled( false );
- }
-
+ mButtonActions[E3rdButton]->setEnabled( false );
+ }
+
break;
}
case EPbStatePaused:
@@ -393,11 +393,15 @@
if ( ! mButtonActions[E3rdButton]->isEnabled() )
{
//
- // enable 'E3rdButton' action (for 'Play' button) in 'Paused' state
+ // enable 'E3rdButton' action (for 'Play' button) in 'Paused' state
//
- mButtonActions[E3rdButton]->setEnabled( true );
- }
-
+ mButtonActions[E3rdButton]->setEnabled( true );
+ }
+
+ break;
+ }
+ case EPbStatePluginSeeking:
+ {
break;
}
default:
@@ -623,7 +627,7 @@
// The logic to enable or disable 'E3rdButton' will depend on the current playback state.
//
updateState( mController->state() );
-
+
//
// toolbar creates button once it gets visible, so we don't know exact timing when toolbar
// creates button, so start timer to get layout information once the toolbar gets visible.
--- a/videoplayback/videoplaybackview/tsrc/testcontrolconfiguration/src/testcontrolconfiguration.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolconfiguration/src/testcontrolconfiguration.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -1,5 +1,5 @@
/**
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -12,10 +12,10 @@
* Contributors:
*
* Description: tester for methods in videoplaybackcontrolconfiguration
-*
+*
*/
-// Version : %version: 5 %
+// Version : %version: 6 %
#include <hbapplication.h>
#include <hbinstance.h>
@@ -47,14 +47,14 @@
HbApplication app(argc, argv);
HbMainWindow window;
-
+
TestControlConfiguration tv;
char *pass[3];
pass[0] = argv[0];
pass[1] = "-o";
pass[2] = "c:\\data\\testcontrolconfiguration.txt";
-
+
int res = QTest::qExec(&tv, 3, pass);
return res;
@@ -77,10 +77,10 @@
{
MPX_ENTER_EXIT(_L("TestControlConfiguration::setup()"));
- mFileDetails = new VideoPlaybackViewFileDetails();
-
+ mFileDetails = new VideoPlaybackViewFileDetails();
+
mControlsController = new VideoPlaybackControlsController( mFileDetails );
-
+
mControlConfig = new VideoPlaybackControlConfiguration( mControlsController );
}
@@ -95,19 +95,19 @@
if ( mFileDetails )
{
delete mFileDetails;
- mFileDetails = NULL;
+ mFileDetails = NULL;
}
-
+
if ( mControlsController )
{
delete mControlsController;
- mControlsController = NULL;
+ mControlsController = NULL;
}
-
+
if ( mControlConfig )
{
delete mControlConfig;
- mControlConfig = NULL;
+ mControlConfig = NULL;
}
}
@@ -185,23 +185,23 @@
// 1. test with mVideoEnabled = false
//
mControlsController->mFileDetails->mVideoEnabled = false;
-
+
mControlConfig->updateControlsWithFileDetails();
-
+
QList<TVideoPlaybackControls> controlsList = mControlConfig->controlList();
-
+
QVERIFY( controlsList.contains( EControlBar ) );
//
// 2. test with mVideoEnabled = true
//
mControlsController->mFileDetails->mVideoEnabled = false;
-
- mControlConfig->updateControlsWithFileDetails();
-
+
+ mControlConfig->updateControlsWithFileDetails();
+
QVERIFY( controlsList.contains( EControlBar ) );
-
- QGraphicsWidget *widget =
+
+ QGraphicsWidget *widget =
mControlsController->layoutLoader()->findWidget( QString( "transparentWindow" ) );
QVERIFY( widget->isVisible() );
@@ -217,28 +217,44 @@
{
MPX_ENTER_EXIT(_L("TestControlConfiguration::testUpdateControlList()"));
- setup();
+ setup();
mControlConfig->createControlList();
+ QGraphicsWidget *widget =
+ mControlConfig->mControlsController->layoutLoader()->findWidget( QString( "transparentWindow" ) );
//
// 1. Test for Details View
//
mControlConfig->updateControlList( EControlCmdDetailsViewOpened );
QList<TVideoPlaybackControls> controlsList = mControlConfig->controlList();
- QVERIFY( controlsList.contains( EFileDetailsWidget ) );
+ QVERIFY( ! widget->isVisible() );
+ QVERIFY( controlsList.contains( EFileDetailsWidget ) );
QVERIFY( controlsList.contains( EDetailsViewPlaybackWindow ) );
- QVERIFY( ! controlsList.contains( EIndicatorBitmap ) );
-
+ QVERIFY( ! controlsList.contains( EIndicatorBitmap ) );
//
- // 2. Test for Fullscreen View
+ // 2-1. Test for Fullscreen View
//
+ mControlConfig->mSurfaceAttached = false;
mControlConfig->updateControlList( EControlCmdFullScreenViewOpened );
controlsList = mControlConfig->controlList();
-
- QVERIFY( ! controlsList.contains( EFileDetailsWidget ) );
- QVERIFY( ! controlsList.contains( EDetailsViewPlaybackWindow ) );
+
+ QVERIFY( ! widget->isVisible() );
+ QVERIFY( ! controlsList.contains( EFileDetailsWidget ) );
+ QVERIFY( ! controlsList.contains( EDetailsViewPlaybackWindow ) );
+ QVERIFY( ! controlsList.contains( EIndicatorBitmap ) );
+
+ //
+ // 2-2. Test for Fullscreen View
+ //
+ mControlConfig->mSurfaceAttached = true;
+ mControlConfig->updateControlList( EControlCmdFullScreenViewOpened );
+ controlsList = mControlConfig->controlList();
+
+ QVERIFY( widget->isVisible() );
+ QVERIFY( ! controlsList.contains( EFileDetailsWidget ) );
+ QVERIFY( ! controlsList.contains( EDetailsViewPlaybackWindow ) );
QVERIFY( ! controlsList.contains( EIndicatorBitmap ) );
//
@@ -246,8 +262,9 @@
//
mControlConfig->updateControlList( EControlCmdAudionOnlyViewOpened );
controlsList = mControlConfig->controlList();
-
- QVERIFY( ! controlsList.contains( EDetailsViewPlaybackWindow ) );
+
+ QVERIFY( ! widget->isVisible() );
+ QVERIFY( ! controlsList.contains( EDetailsViewPlaybackWindow ) );
QVERIFY( controlsList.contains( EIndicatorBitmap ) );
QVERIFY( controlsList.contains( EFileDetailsWidget ) );
@@ -257,8 +274,23 @@
mControlConfig->updateControlList( EControlCmdAudionOnlyViewOpened );
controlsList = mControlConfig->controlList();
- QVERIFY( ! controlsList.contains( ERealLogoBitmap ) );
+ QVERIFY( ! controlsList.contains( ERealLogoBitmap ) );
+
+ //
+ // 5. Surface attached
+ //
+ mControlConfig->updateControlList( EControlCmdSurfaceAttached );
+ controlsList = mControlConfig->controlList();
+ QVERIFY( widget->isVisible() );
+
+ //
+ // 6. Surface detached
+ //
+ mControlConfig->updateControlList( EControlCmdSurfaceDetached );
+ controlsList = mControlConfig->controlList();
+
+ QVERIFY( ! widget->isVisible() );
cleanup();
}
--- a/videoplayback/videoplaybackview/tsrc/testcontrolscontroller/stub/inc/videoplaybackcontrol.hrh Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolscontroller/stub/inc/videoplaybackcontrol.hrh Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 3 %
+// Version : %version: 4 %
#ifndef VIDEOPLAYBACKCONTROL_HRH_
@@ -88,7 +88,9 @@
EControlCmdFullScreenViewOpened,
EControlCmdDetailsViewOpened,
EControlCmdAudionOnlyViewOpened,
- EControlCmdRemoveRNLogo
+ EControlCmdRemoveRNLogo,
+ EControlCmdSurfaceAttached,
+ EControlCmdSurfaceDetached
};
enum TVideoSeekingType
--- a/videoplayback/videoplaybackview/tsrc/testmpxvideoviewwrapper/inc/testmpxvideoviewwrapper.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayback/videoplaybackview/tsrc/testmpxvideoviewwrapper/inc/testmpxvideoviewwrapper.h Fri Aug 06 09:43:48 2010 +0300
@@ -1,5 +1,5 @@
/**
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -12,7 +12,7 @@
* Contributors:
*
* Description: tester for methods in Video Playback View Plugin
-*
+*
*/
#ifndef __TESTMPXVIDEOVIEWWRAPPER_H__
@@ -35,14 +35,14 @@
* will be called before each testfunction is executed.
*
*/
- void init();
-
+ void init();
+
/**
* will be called after every testfunction.
*
*/
void cleanup();
-
+
private slots:
// the order in which these testXX methods are declared is important
// changing this order will affect the test results
@@ -58,7 +58,6 @@
void testActivateClosePlayerActiveObject();
void testDoClosePlayer();
void testSetAspectRatio();
- void testIsAppInFront();
void testClosePlaybackView();
void testHandleVolumeCmd();
void testHandleShortPressBackward();
@@ -71,13 +70,14 @@
void testHandleVideoPlaybackMessage();
void testHandlePlaybackCommandComplete();
void testHandleMedia();
+ void testSurfacedAttached();
signals:
void commandSignal(int);
-
+
private:
CMPXVideoViewWrapper *mVideoViewWrapper;
- VideoBasePlaybackView *mBaseVideoView;
+ VideoBasePlaybackView *mBaseVideoView;
};
#endif // __TESTMPXVIDEOVIEWWRAPPER_H__
--- a/videoplayback/videoplaybackview/tsrc/testmpxvideoviewwrapper/src/testmpxvideoviewwrapper.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayback/videoplaybackview/tsrc/testmpxvideoviewwrapper/src/testmpxvideoviewwrapper.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 13 %
+// Version : %version: 15 %
#include <e32err.h>
#include <w32std.h>
@@ -579,21 +579,6 @@
cleanup();
}
-void TestMPXVideoViewWrapper::testIsAppInFront()
-{
- init();
-
- TRAPD(errReqMedia, mVideoViewWrapper->RequestMediaL());
- QVERIFY( errReqMedia == KErrNone );
-
- bool front = false;
- TRAPD( errIsAppInFrnt, front = mVideoViewWrapper->IsAppInFrontL() );
-
- QVERIFY( errIsAppInFrnt == KErrNone );
-
- cleanup();
-}
-
void TestMPXVideoViewWrapper::testClosePlaybackView()
{
init();
@@ -663,14 +648,14 @@
//
// test foreground
//
- TRAPD( errIssueVidAppFGCmd, mVideoViewWrapper->IssueVideoAppForegroundCmdL( ETrue ) );
+ TRAPD( errIssueVidAppFGCmd, mVideoViewWrapper->IssueVideoAppForegroundCmdL( ETrue, ETrue ) );
QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdHandleForeground );
QVERIFY( errIssueVidAppFGCmd == KErrNone );
//
// test background
//
- TRAP( errIssueVidAppFGCmd, mVideoViewWrapper->IssueVideoAppForegroundCmdL( EFalse ) );
+ TRAP( errIssueVidAppFGCmd, mVideoViewWrapper->IssueVideoAppForegroundCmdL( EFalse, EFalse ) );
QVERIFY( mVideoViewWrapper->iPlaybackUtility->iCommand == EPbCmdHandleBackground );
QVERIFY( errIssueVidAppFGCmd == KErrNone );
@@ -858,7 +843,7 @@
}
//
- // working case - re-play after previous termination
+ // working case - re-play after previous termination
//
TRAP_IGNORE(
RArray<TInt> suppIds;
@@ -890,8 +875,8 @@
{
delete media;
media = NULL;
- }
-
+ }
+
//
// Handle playback media - working case - RN logo is visible
//
@@ -959,4 +944,20 @@
cleanup();
}
+void TestMPXVideoViewWrapper::testSurfacedAttached()
+{
+ init();
+
+ TRAPD(err, mVideoViewWrapper->CreateControlsL());
+ QVERIFY( err == KErrNone );
+
+ mVideoViewWrapper->SurfacedAttached( ETrue );
+ QVERIFY( mVideoViewWrapper->iControlsController->mReceivedEvent == EControlCmdSurfaceAttached );
+
+ mVideoViewWrapper->SurfacedAttached( EFalse );
+ QVERIFY( mVideoViewWrapper->iControlsController->mReceivedEvent == EControlCmdSurfaceDetached );
+
+ cleanup();
+}
+
// End of file
--- a/videoplayback/videoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxcollectionutility.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayback/videoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxcollectionutility.h Fri Aug 06 09:43:48 2010 +0300
@@ -21,6 +21,7 @@
#include <e32cmn.h>
+class CMPXCollectionPath;
class MMPXCollectionObserver;
class MMPXCollection
@@ -28,6 +29,8 @@
public:
virtual TUid UidL() const = 0;
+ virtual CMPXCollectionPath* PathL() = 0;
+
public:
TUid iUid;
};
@@ -61,6 +64,8 @@
void Close();
TUid UidL() const;
+
+ CMPXCollectionPath* PathL();
};
#endif //MMPXCOLLECTIONUTILITY_H
--- a/videoplayback/videoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/videoplaybackcontrol.hrh Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayback/videoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/videoplaybackcontrol.hrh Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 2 %
+// Version : %version: 3 %
#ifndef VIDEOPLAYBACKCONTROL_HRH_
@@ -88,7 +88,9 @@
EControlCmdFullScreenViewOpened,
EControlCmdDetailsViewOpened,
EControlCmdAudionOnlyViewOpened,
- EControlCmdRemoveRNLogo
+ EControlCmdRemoveRNLogo,
+ EControlCmdSurfaceAttached,
+ EControlCmdSurfaceDetached
};
#endif /*VIDEOPLAYBACKCONTROL_HRH_*/
--- a/videoplayback/videoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxcollectionutility.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayback/videoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxcollectionutility.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -16,6 +16,7 @@
*/
#include <e32base.h>
+#include <mpxcollectionpath.h>
#include "mpxcollectionutility.h"
@@ -94,4 +95,13 @@
return iUid;
}
+// -------------------------------------------------------------------------------------------------
+// CMPXCollectionUtility::PathL
+// -------------------------------------------------------------------------------------------------
+//
+CMPXCollectionPath* CMPXCollectionUtility::PathL()
+{
+ return NULL;
+}
+
// End of file
--- a/videoplayback/videoplaybackview/tsrc/testprogressbar/src/testprogressbar.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayback/videoplaybackview/tsrc/testprogressbar/src/testprogressbar.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 9 %
+// Version : %version: 10 %
#include <qdebug>
@@ -313,6 +313,12 @@
//
// test for 2nd block of cases
//
+ mProgBar->updateState( EPbStatePluginSeeking );
+ QVERIFY( mProgBar->mProgressSlider->isEnabled() );
+
+ //
+ // test for 3rd block of cases
+ //
mProgBar->updateState( EPbStateBuffering );
QVERIFY( ! mProgBar->mProgressSlider->isEnabled() );
--- a/videoplayback/videoplaybackview/tsrc/testtoolbar/src/testtoolbar.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayback/videoplaybackview/tsrc/testtoolbar/src/testtoolbar.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 6 %
+// Version : %version: 7 %
#include <qdebug>
@@ -340,6 +340,15 @@
QVERIFY( mVideoToolBar->mButtons[E3rdButton]->isEnabled() == true );
//
+ // Seeking
+ //
+ state = EPbStatePluginSeeking;
+ mVideoToolBar->updateState( state );
+
+ QVERIFY( mVideoToolBar->mToolBar->mEnabled == true );
+ QVERIFY( mVideoToolBar->mButtons[E3rdButton]->isEnabled() == true );
+
+ //
// Not initialized
//
state = EPbStateNotInitialised;
--- a/videoplayback/videoplaybackview/tsrc/testvideodisplayhandler/src/testvideodisplayhandler.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayback/videoplaybackview/tsrc/testvideodisplayhandler/src/testvideodisplayhandler.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -151,6 +151,7 @@
mDispHdlr->HandleVideoDisplayMessageL( message );
QVERIFY( ! mDispHdlr->iSurfaceId.IsNull() );
+ QVERIFY( mDispHdlr->iViewWrapper->iAttatched );
mDispHdlr->RemoveDisplayWindow();
cleanup();
@@ -191,6 +192,7 @@
mDispHdlr->HandleVideoDisplayMessageL( message );
QVERIFY( mDispHdlr->iSurfaceId.IsNull() );
+ QVERIFY( ! mDispHdlr->iViewWrapper->iAttatched );
mDispHdlr->RemoveDisplayWindow();
cleanup();
--- a/videoplayback/videoplaybackview/tsrc/testvideodisplayhandler/stub/inc/mpxvideocontainer.h Fri Jul 23 11:10:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-// Version : %version: 1 %
-
-
-#ifndef CMPXVIDEOCONTAINER_H
-#define CMPXVIDEOCONTAINER_H
-
-#include <coecntrl.h>
-
-
-class CMPXVideoContainer : public CCoeControl
-{
-
- public:
- CMPXVideoContainer();
- virtual ~CMPXVideoContainer();
-
- void ConstructL();
-
- protected:
- void Draw(const TRect& aRect) const;
-};
-
-#endif // CMPXVIDEOCONTAINER_H
-
-// End of file
\ No newline at end of file
--- a/videoplayback/videoplaybackview/tsrc/testvideodisplayhandler/stub/inc/mpxvideoviewwrapper.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayback/videoplaybackview/tsrc/testvideodisplayhandler/stub/inc/mpxvideoviewwrapper.h Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 3 %
+// Version : %version: 4 %
@@ -48,39 +48,40 @@
virtual ~CMPXVideoViewWrapper();
private:
- CMPXVideoViewWrapper( VideoBasePlaybackView* aView );
+ CMPXVideoViewWrapper( VideoBasePlaybackView* aView );
void ConstructL();
-
+
void SetFileDetails(TBool aDefault);
public:
void HandleCommandL( TInt aCommand );
-
+
TBool IsLive();
-
+
TBool IsPlaylist();
-
+
TBool IsMultiItemPlaylist();
-
- void RequestMediaL();
-
+
+ void RequestMediaL();
+
void CreateGeneralPlaybackCommandL( int aCmd );
-
+
void ActivateClosePlayerActiveObject();
-
+
void IssueVideoAppForegroundCmdL( TBool aForeground );
-
+
void UpdateVideoRectDone();
+ void SurfacedAttached( TBool aAttached );
public: // data
- VideoBasePlaybackView* iView;
- TBool iMediaRequested;
- VideoPlaybackViewFileDetails* iFileDetails;
- TBool iClosePlayerAO;
- TBool iForeground;
-
+ VideoBasePlaybackView* iView;
+ VideoPlaybackViewFileDetails* iFileDetails;
+ TBool iMediaRequested;
+ TBool iClosePlayerAO;
+ TBool iForeground;
+ TBool iAttatched;
};
#endif // __MPXVIDEOVIEWWRAPPER_H__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testvideodisplayhandler/stub/inc/videocontainer.h Fri Aug 06 09:43:48 2010 +0300
@@ -0,0 +1,39 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+// Version : %version: 2 %
+
+
+#ifndef CVIDEOCONTAINER_H
+#define CVIDEOCONTAINER_H
+
+#include <coecntrl.h>
+
+
+class CVideoContainer : public CCoeControl
+{
+
+ public:
+ CVideoContainer();
+ virtual ~CVideoContainer();
+
+ void ConstructL();
+};
+
+#endif // CVIDEOCONTAINER_H
+
+// End of file
\ No newline at end of file
--- a/videoplayback/videoplaybackview/tsrc/testvideodisplayhandler/stub/src/mpxvideocontainer.cpp Fri Jul 23 11:10:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-#include "mpxvideocontainer.h"
-
-
-CMPXVideoContainer::CMPXVideoContainer()
-{
-}
-
-CMPXVideoContainer::~CMPXVideoContainer()
-{
- CloseWindow();
-}
-
-void CMPXVideoContainer::ConstructL()
-{
- CreateWindowL();
- ActivateL();
-}
-
-void CMPXVideoContainer::Draw( const TRect& /*aRect*/ ) const
-{
- CWindowGc& gc = SystemGc();
- gc.SetPenStyle( CGraphicsContext::ENullPen );
- gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha );
- gc.SetBrushColor( TRgb::Color16MA( 0 ) );
- gc.SetBrushStyle( CGraphicsContext::ESolidBrush );
- gc.DrawRect( Rect() );
-}
-
-// End of file
--- a/videoplayback/videoplaybackview/tsrc/testvideodisplayhandler/stub/src/mpxvideoviewwrapper.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayback/videoplaybackview/tsrc/testvideodisplayhandler/stub/src/mpxvideoviewwrapper.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 6 %
+// Version : %version: 7 %
@@ -33,7 +33,7 @@
// -------------------------------------------------------------------------------------------------
//
CMPXVideoViewWrapper::CMPXVideoViewWrapper( VideoBasePlaybackView* aView )
- : iView( aView )
+ : iView( aView )
{
}
@@ -58,7 +58,7 @@
//
void CMPXVideoViewWrapper::ConstructL()
{
- iMediaRequested = EFalse;
+ iMediaRequested = EFalse;
}
// -------------------------------------------------------------------------------------------------
@@ -84,7 +84,7 @@
//
TBool CMPXVideoViewWrapper::IsPlaylist()
{
- return EFalse;
+ return EFalse;
}
// -------------------------------------------------------------------------------------------------
@@ -106,14 +106,14 @@
{
case EMPXPbvCmdNextListItem:
{
- SetFileDetails( EFalse );
- break;
+ SetFileDetails( EFalse );
+ break;
}
-
+
case EMPXPbvCmdPreviousListItem:
{
- SetFileDetails( ETrue );
- break;
+ SetFileDetails( ETrue );
+ break;
}
}
@@ -126,9 +126,9 @@
void CMPXVideoViewWrapper::RequestMediaL()
{
iMediaRequested = ETrue;
-
+
SetFileDetails( ETrue );
-
+
}
@@ -161,16 +161,16 @@
delete iFileDetails;
iFileDetails = NULL;
}
-
- iFileDetails = new VideoPlaybackViewFileDetails();
-
- _LIT(KTestMimeType, "video/3gp");
+
+ iFileDetails = new VideoPlaybackViewFileDetails();
+
+ _LIT(KTestMimeType, "video/3gp");
const QString qMimeType( (QChar*)KTestMimeType().Ptr(), KTestMimeType().Length() );
- iFileDetails->mMimeType = qMimeType;
+ iFileDetails->mMimeType = qMimeType;
_LIT(KTestTitle, "Test Video Title");
const QString qTitle( (QChar*)KTestTitle().Ptr(), KTestTitle().Length() );
- iFileDetails->mTitle = qTitle;
+ iFileDetails->mTitle = qTitle;
_LIT(KTestArtist, "TestArtist");
const QString qArtist( (QChar*)KTestArtist().Ptr(), KTestArtist().Length() );
@@ -200,16 +200,16 @@
{
_LIT(KTestClipName, "testClip.3gp");
const QString qClipname( (QChar*)KTestClipName().Ptr(), KTestClipName().Length() );
- iFileDetails->mClipName = qClipname;
+ iFileDetails->mClipName = qClipname;
}
else
{
_LIT(KTestClipName, "nextClip.3gp");
const QString qClipname( (QChar*)KTestClipName().Ptr(), KTestClipName().Length() );
- iFileDetails->mClipName = qClipname;
+ iFileDetails->mClipName = qClipname;
}
-
-
+
+
iFileDetails->mPlaybackMode = EMPXVideoLocal;
iFileDetails->mSeekable = true;
iFileDetails->mPausableStream = true;
@@ -223,7 +223,7 @@
iFileDetails->mMultiItemPlaylist = false;
iFileDetails->mVideoHeight = 320;
iFileDetails->mVideoWidth = 240;
- iFileDetails->mBitRate = 16000;
+ iFileDetails->mBitRate = 16000;
}
// -------------------------------------------------------------------------------------------------
@@ -243,4 +243,14 @@
void CMPXVideoViewWrapper::UpdateVideoRectDone()
{
}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::SurfacedAttached()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::SurfacedAttached( TBool aAttached )
+{
+ iAttatched = aAttached;
+}
+
// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testvideodisplayhandler/stub/src/videocontainer.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -0,0 +1,40 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+// Version : %version: 2 %
+
+
+
+#include "videocontainer.h"
+
+
+CVideoContainer::CVideoContainer()
+{
+}
+
+CVideoContainer::~CVideoContainer()
+{
+ CloseWindow();
+}
+
+void CVideoContainer::ConstructL()
+{
+ CreateWindowL();
+ ActivateL();
+}
+
+// End of file
--- a/videoplayback/videoplaybackview/tsrc/testvideodisplayhandler/testvideodisplayhandler.pro Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayback/videoplaybackview/tsrc/testvideodisplayhandler/testvideodisplayhandler.pro Fri Aug 06 09:43:48 2010 +0300
@@ -14,7 +14,7 @@
# Description: Project file for building Videoplayer components
#
#
-# Version : %version: 4 %
+# Version : %version: 5 %
TEMPLATE = app
TARGET = testvideodisplayhandler
@@ -41,16 +41,16 @@
HEADERS += mpxvideoviewwrapper.h \
videobaseplaybackview.h \
videoplaybackviewfiledetails.h \
- mpxvideocontainer.h \
+ videocontainer.h \
alfcompositionutility.h \
mediaclientvideodisplay.h \
testvideodisplayhandler.h \
../../viewinc/mpxvideoplaybackdisplayhandler.h
-SOURCES += mpxvideoviewwrapper.cpp \
+SOURCES += mpxvideoviewwrapper.cpp \
videobaseplaybackview.cpp \
videoplaybackviewfiledetails.cpp \
- mpxvideocontainer.cpp \
+ videocontainer.cpp \
alfcompositionutility.cpp \
mediaclientvideodisplay.cpp \
testvideodisplayhandler.cpp \
--- a/videoplayback/videoplaybackview/tsrc/testvideoplaybackview/inc/testvideoplaybackview.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayback/videoplaybackview/tsrc/testvideoplaybackview/inc/testvideoplaybackview.h Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 9 %
+// Version : %version: 10 %
#ifndef __TESTVIDEOPLAYBACKVIEW_H__
#define __TESTVIDEOPLAYBACKVIEW_H__
@@ -73,6 +73,8 @@
void testDoClosePlayer();
void testGestureEvent();
void testReactivationAfterPriorTermination();
+ void testHandleAppBackground();
+ void testHandleAppForeground();
signals:
void commandSignal();
--- a/videoplayback/videoplaybackview/tsrc/testvideoplaybackview/src/testvideoplaybackview.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayback/videoplaybackview/tsrc/testvideoplaybackview/src/testvideoplaybackview.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 13 %
+// Version : %version: 14 %
#include <e32err.h>
#include <w32std.h>
@@ -239,7 +239,7 @@
//
// ensure default foreground is false
//
- QCOMPARE( mVideoView->mVideoMpxWrapper->iForeground, 0 );
+ QCOMPARE( mVideoView->mVideoMpxWrapper->iViewForeground, 0 );
//
// declare foreground/background event
@@ -256,7 +256,7 @@
//
// verify view is in foreground
//
- QCOMPARE( mVideoView->mVideoMpxWrapper->iForeground, 1 );
+ QCOMPARE( mVideoView->mVideoMpxWrapper->iViewForeground, 1 );
//
// verify the returned value (consumed) of VideoBasePlaybackView::event()
@@ -267,7 +267,7 @@
//
// verify view is in background
//
- QCOMPARE( mVideoView->mVideoMpxWrapper->iForeground, 0 );
+ QCOMPARE( mVideoView->mVideoMpxWrapper->iViewForeground, 0 );
//
// clean up
@@ -649,20 +649,60 @@
{
QVariant data = int( 10 );
VideoActivityState::instance().setActivityData(data, KEY_LAST_PLAY_POSITION_ID);
-
+
data = int ( MpxHbVideoCommon::PlaybackView );
- VideoActivityState::instance().setActivityData(data, KEY_VIEWPLUGIN_TYPE);
-
+ VideoActivityState::instance().setActivityData(data, KEY_VIEWPLUGIN_TYPE);
+
init();
mVideoView->handleActivateView();
QVERIFY( mVideoView->mVideoMpxWrapper->iMediaRequested == true );
QCOMPARE( mVideoView->mVideoMpxWrapper->iFileDetails->mBitRate, 16000 );
QCOMPARE( mVideoView->mVideoMpxWrapper->iFileDetails->mTitle, QString("Test Video Title") );
-
+
QCOMPARE( mVideoView->mLastPlayPosition, 10);
- cleanup();
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestVideoPlaybackView::testHandleAppBackground()
+// -------------------------------------------------------------------------------------------------
+//
+void TestVideoPlaybackView::testHandleAppBackground()
+{
+ setup();
+
+ mVideoView->mActivated = true;
+
+ connect( this, SIGNAL( commandSignal() ), mVideoView, SLOT( handleAppBackground() ) );
+ emit commandSignal();
+
+ QVERIFY( ! mVideoView->mVideoMpxWrapper->iViewForeground );
+ QVERIFY( ! mVideoView->mVideoMpxWrapper->iAppForeground );
+
+ disconnect( this, SIGNAL( commandSignal() ), mVideoView, SLOT( handleAppBackground() ) );
+
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// TestVideoPlaybackView::testHandleAppForeground()
+// -------------------------------------------------------------------------------------------------
+//
+void TestVideoPlaybackView::testHandleAppForeground()
+{
+ setup();
+
+ connect( this, SIGNAL( commandSignal() ), mVideoView, SLOT( handleAppForeground() ) );
+ emit commandSignal();
+
+ QVERIFY( mVideoView->mVideoMpxWrapper->iViewForeground );
+ QVERIFY( mVideoView->mVideoMpxWrapper->iAppForeground );
+
+ disconnect( this, SIGNAL( commandSignal() ), mVideoView, SLOT( handleAppForeground() ) );
+
+ cleanup();
}
// End of file
--- a/videoplayback/videoplaybackview/tsrc/testvideoplaybackview/stub/inc/mpxvideoviewwrapper.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayback/videoplaybackview/tsrc/testvideoplaybackview/stub/inc/mpxvideoviewwrapper.h Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 8 %
+// Version : %version: 9 %
@@ -28,7 +28,6 @@
#include <e32base.h> // CBase
#include <e32std.h> // TBuf
-#include <mpxcollectionobserver.h>
#include "videoplaybackcontrol.hrh"
@@ -38,15 +37,11 @@
// Forward Declarations
class VideoBasePlaybackView;
class VideoPlaybackViewFileDetails;
-class CMPXCollectionUtility;
-class CMPXMedia;
-class CMPXCollectionPlaylist;
// Class Definitions
-class CMPXVideoViewWrapper : public CBase,
- public MMPXCollectionObserver
+class CMPXVideoViewWrapper : public CBase
{
public:
static CMPXVideoViewWrapper* NewL( VideoBasePlaybackView* aView );
@@ -73,27 +68,18 @@
void ActivateClosePlayerActiveObject();
- void IssueVideoAppForegroundCmdL( TBool aForeground );
-
- inline void HandleOpenL( const CMPXMedia& /*aEntries*/,
- TInt /*aIndex*/,
- TBool /*aComplete*/,
- TInt /*aError*/ ) {}
+ void IssueVideoAppForegroundCmdL( TBool aViewForeground, TBool aAppForeground );
- inline void HandleOpenL( const CMPXCollectionPlaylist& /*aPlaylist*/, TInt /*aError*/ ) {}
-
- inline void HandleCollectionMediaL( const CMPXMedia& /*aMedia*/, TInt /*aError*/ ) {}
-
TInt GetMediaId();
-
public: // data
VideoBasePlaybackView* iView;
TBool iMediaRequested;
VideoPlaybackViewFileDetails* iFileDetails;
TBool iClosePlayerAO;
- TBool iForeground;
+ TBool iAppForeground;
+ TBool iViewForeground;
TInt iCommand;
TInt iPlayPosition;
};
--- a/videoplayback/videoplaybackview/tsrc/testvideoplaybackview/stub/src/mpxvideoviewwrapper.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayback/videoplaybackview/tsrc/testvideoplaybackview/stub/src/mpxvideoviewwrapper.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 10 %
+// Version : %version: 11 %
@@ -214,9 +214,10 @@
// CMPXVideoViewWrapper::IssueVideoAppForegroundCmd()
// -------------------------------------------------------------------------------------------------
//
-void CMPXVideoViewWrapper::IssueVideoAppForegroundCmdL( TBool aForeground )
+void CMPXVideoViewWrapper::IssueVideoAppForegroundCmdL( TBool aViewForeground, TBool aAppForeground )
{
- iForeground = aForeground;
+ iViewForeground = aViewForeground;
+ iAppForeground = aAppForeground;
}
// -------------------------------------------------------------------------------------------------
--- a/videoplayback/videoplaybackview/videoplaybackview.pro Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayback/videoplaybackview/videoplaybackview.pro Fri Aug 06 09:43:48 2010 +0300
@@ -14,7 +14,7 @@
# Description: Project file for building Videoplayer components
#
#
-# Version : %version: da1mmcf#29 %
+# Version : %version: da1mmcf#30 %
TEMPLATE = lib
@@ -83,7 +83,7 @@
videoplaybackfiledetailswidget.h \
mpxvideoplaybackuserinputhandler.h \
videoplaybackdetailsplaybackwindow.h \
- mpxvideocontainer.h
+ videocontainer.h
SOURCES += videobaseplaybackview.cpp \
videoplaybackview.cpp \
@@ -102,6 +102,6 @@
videoplaybackfiledetailswidget.cpp \
mpxvideoplaybackuserinputhandler.cpp \
videoplaybackdetailsplaybackwindow.cpp \
- mpxvideocontainer.cpp
+ videocontainer.cpp
RESOURCES += resources/videoplaybackview.qrc
--- a/videoplayback/videoplaybackview/viewinc/mpxvideocontainer.h Fri Jul 23 11:10:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: CCoeControl to provide RWindow for videoplayback
-*
-*/
-
-// Version : %version: 2 %
-
-
-#ifndef CMPXVIDEOCONTAINER_H
-#define CMPXVIDEOCONTAINER_H
-
-#include <coecntrl.h>
-
-
-class CMPXVideoContainer : public CCoeControl
-{
-
- public:
- CMPXVideoContainer();
- virtual ~CMPXVideoContainer();
-
- void ConstructL();
-};
-
-#endif // CMPXVIDEOCONTAINER_H
-
-// End of file
\ No newline at end of file
--- a/videoplayback/videoplaybackview/viewinc/mpxvideoplaybackdisplayhandler.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayback/videoplaybackview/viewinc/mpxvideoplaybackdisplayhandler.h Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 10 %
+// Version : %version: 11 %
#ifndef __VIDEOPLAYBACKDISPLAYHANDLER_H__
@@ -32,7 +32,7 @@
//
// CLASS DECLARATION
//
-class CMPXVideoContainer;
+class CVideoContainer;
class MMPXPlaybackUtility;
class CMPXVideoViewWrapper;
class VideoPlaybackViewFileDetails;
@@ -135,7 +135,7 @@
TInt iVerticalPosition;
TVideoRotation iRotation;
TAutoScaleType iAutoScale;
- CMPXVideoContainer* iVideoContainer;
+ CVideoContainer* iVideoContainer;
};
#endif // __VIDEOPLAYBACKDISPLAYHANDLER_H__
--- a/videoplayback/videoplaybackview/viewinc/mpxvideoviewwrapper.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayback/videoplaybackview/viewinc/mpxvideoviewwrapper.h Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#21 %
+// Version : %version: da1mmcf#23 %
@@ -168,18 +168,12 @@
TBool IsPlaylist();
- void IssueVideoAppForegroundCmdL(TBool aForeground);
+ void IssueVideoAppForegroundCmdL( TBool aViewForeground, TBool aAppForegournd );
void RequestMediaL();
void CreateGeneralPlaybackCommandL( TMPXPlaybackCommand aCmd, TBool aDoSync = ETrue );
- TBool IsAppInFrontL();
-
- /*
- * Activates an active object to close the player
- * @since 5.0
- */
void ActivateClosePlayerActiveObject();
void CreateControlsL();
@@ -213,9 +207,11 @@
void DoClosePlayer();
void HandleVideoPlaybackMessage( CMPXMessage* aMessage );
-
+
TBool IsResumingPlaybackAfterTermination();
+ void SurfacedAttached( TBool aAttached );
+
private:
/**
@@ -265,9 +261,9 @@
TBool IsInMemoryPlugin();
void UpdatePbPluginMediaL( TBool aSeek );
-
+
TInt GetMediaId();
-
+
protected: // data
MMPXPlaybackUtility* iPlaybackUtility;
MMPXCollectionUtility* iCollectionUtility;
@@ -285,9 +281,9 @@
TBool iCollectionMediaRequested;
TBool iPlaylistView;
int iPlayPosition;
-
+
public:
- friend class VideoBasePlaybackView;
+ friend class VideoBasePlaybackView;
};
#endif // __MPXVIDEOVIEWWRAPPER_H__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/viewinc/videocontainer.h Fri Aug 06 09:43:48 2010 +0300
@@ -0,0 +1,39 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: CCoeControl to provide RWindow for videoplayback
+*
+*/
+
+// Version : %version: 3 %
+
+
+#ifndef CVIDEOCONTAINER_H
+#define CVIDEOCONTAINER_H
+
+#include <coecntrl.h>
+
+
+class CVideoContainer : public CCoeControl
+{
+
+ public:
+ CVideoContainer();
+ virtual ~CVideoContainer();
+
+ void ConstructL();
+};
+
+#endif // CVIDEOCONTAINER_H
+
+// End of file
\ No newline at end of file
--- a/videoplayback/videoplaybackview/viewsrc/mpxvideocontainer.cpp Fri Jul 23 11:10:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: CCoeControl to provide RWindow for videoplayback
-*
-*/
-
-// Version : %version: 2 %
-
-
-
-#include "mpxvideocontainer.h"
-#include "mpxvideo_debug.h"
-
-CMPXVideoContainer::CMPXVideoContainer()
-{
- MPX_ENTER_EXIT( _L("CMPXVideoContainer::CMPXVideoContainer()") );
-}
-
-CMPXVideoContainer::~CMPXVideoContainer()
-{
- MPX_ENTER_EXIT( _L("CMPXVideoContainer::~CMPXVideoContainer()") );
-
- CloseWindow();
-}
-
-void CMPXVideoContainer::ConstructL()
-{
- MPX_ENTER_EXIT( _L("CMPXVideoContainer::ConstructL()") );
-
- CreateWindowL();
- ActivateL();
-}
-
-// End of file
--- a/videoplayback/videoplaybackview/viewsrc/mpxvideoplaybackdisplayhandler.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayback/videoplaybackview/viewsrc/mpxvideoplaybackdisplayhandler.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: ou1cpsw#27 %
+// Version : %version: 28 %
#include <sysutil.h>
#include <s32file.h>
@@ -24,7 +24,7 @@
#include <mpxplaybackutility.h>
#include <mpxvideoplaybackdefs.h>
-#include "mpxvideocontainer.h"
+#include "videocontainer.h"
#include "mpxvideoviewwrapper.h"
#include "mpxvideoplaybackdisplayhandler.h"
#include "mpxvideoregion.h"
@@ -119,13 +119,11 @@
if ( ! iVideoContainer )
{
- iVideoContainer = new ( ELeave ) CMPXVideoContainer();
+ iVideoContainer = new ( ELeave ) CVideoContainer();
iVideoContainer->ConstructL();
iVideoContainer->SetRect( aDisplayRect );
}
- aWin.SetSurfaceTransparency( ETrue );
-
RWindowBase *videoWindow = iVideoContainer->DrawableWindow();
videoWindow->SetOrdinalPosition( -1 );
(&aWin)->SetOrdinalPosition( 0 );
@@ -551,6 +549,11 @@
iVideoDisplay->SurfaceCreated( iSurfaceId, iCropRect, iAspectRatio, iCropRect );
iSurfaceCached = EFalse;
+
+ //
+ // Let ControlsController know that we get the surface.
+ //
+ iViewWrapper->SurfacedAttached( true );
}
}
@@ -585,6 +588,11 @@
// Add new surface
//
iVideoDisplay->SurfaceCreated( iSurfaceId, iCropRect, iAspectRatio, iCropRect );
+
+ //
+ // Let ControlsController know that we get the surface.
+ //
+ iViewWrapper->SurfacedAttached( true );
}
else
{
@@ -630,6 +638,11 @@
{
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::SurfaceRemoved()"));
+ //
+ // Let ControlsController know that we get the surface.
+ //
+ iViewWrapper->SurfacedAttached( false );
+
if ( iVideoDisplay )
{
iVideoDisplay->RemoveSurface();
--- a/videoplayback/videoplaybackview/viewsrc/mpxvideoviewwrapper.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayback/videoplaybackview/viewsrc/mpxvideoviewwrapper.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#42 %
+// Version : %version: da1mmcf#44 %
@@ -1201,43 +1201,6 @@
}
// -------------------------------------------------------------------------------------------------
-// CMPXVideoViewWrapper::IsAppInFrontL()
-// Returns true if app is foreground. Uses windowgroup id
-// -------------------------------------------------------------------------------------------------
-//
-TBool CMPXVideoViewWrapper::IsAppInFrontL()
-{
- TBool ret = EFalse;
- RWsSession wsSession;
-
- User::LeaveIfError( wsSession.Connect() );
-
- if( wsSession.Handle() )
- {
- CArrayFixFlat<TInt>* wgList =
- new (ELeave) CArrayFixFlat<TInt>( wsSession.NumWindowGroups() );
-
- // check if our window is front or not
- if ( wsSession.WindowGroupList( 0, wgList ) == KErrNone )
- {
- ret = ( CEikonEnv::Static()->RootWin().Identifier() == wgList->At(0) );
- }
- else
- {
- ret = EFalse;
- }
-
- delete wgList;
- }
-
- wsSession.Close();
-
- MPX_DEBUG(_L("CMPXVideoViewWrapper::IsAppInFrontL (%d)" ), ret);
-
- return ret;
-}
-
-// -------------------------------------------------------------------------------------------------
// CMPXVideoViewWrapper::ClosePlaybackViewL()
// -------------------------------------------------------------------------------------------------
//
@@ -1303,14 +1266,14 @@
// CMPXVideoViewWrapper::IssueVideoAppForegroundCmd()
// -------------------------------------------------------------------------------------------------
//
-void CMPXVideoViewWrapper::IssueVideoAppForegroundCmdL( TBool aForeground )
+void CMPXVideoViewWrapper::IssueVideoAppForegroundCmdL( TBool aViewForeground, TBool aAppForegournd )
{
MPX_ENTER_EXIT(_L("CMPXVideoViewWrapper::IssueVideoAppForegroundCmdL()"),
- _L("aForeground = %d"), aForeground );
+ _L("aViewForeground = %d, aAppForegournd = %d"), aViewForeground, aAppForegournd );
TMPXVideoPlaybackCommand videoCmd = EPbCmdHandleBackground;
- if ( aForeground )
+ if ( aViewForeground )
{
videoCmd = EPbCmdHandleForeground;
}
@@ -1324,7 +1287,7 @@
cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
cmd->SetTObjectValueL<TInt>( KMPXCommandGeneralId, KMPXMediaIdVideoPlayback );
cmd->SetTObjectValueL<TMPXVideoPlaybackCommand>( KMPXMediaVideoPlaybackCommand, videoCmd );
- cmd->SetTObjectValueL<TBool>( KMPXMediaVideoAppForeground, IsAppInFrontL() );
+ cmd->SetTObjectValueL<TBool>( KMPXMediaVideoAppForeground, aAppForegournd );
iPlaybackUtility->CommandL( *cmd );
CleanupStack::PopAndDestroy( cmd );
@@ -1507,16 +1470,16 @@
// happen when app is on background, in which case Video Player is paused
// by default
if ( IsResumingPlaybackAfterTermination() )
- {
- CreateGeneralPlaybackCommandL( EPbCmdPause );
- SetPropertyL( EPbPropertyPosition, iView->mLastPlayPosition );
+ {
+ CreateGeneralPlaybackCommandL( EPbCmdPause );
+ SetPropertyL( EPbPropertyPosition, iView->mLastPlayPosition );
iView->mStayPaused = false;
}
else
{
CreateGeneralPlaybackCommandL( EPbCmdPlay );
}
-
+
}
}
@@ -1661,7 +1624,7 @@
TBool CMPXVideoViewWrapper::IsResumingPlaybackAfterTermination()
{
MPX_DEBUG(_L("CMPXVideoViewWrapper::IsResumingPlaybackAfterTermination()"));
-
+
return iView->mStayPaused;
}
@@ -1672,11 +1635,29 @@
TInt CMPXVideoViewWrapper::GetMediaId()
{
MPX_DEBUG(_L("CMPXVideoViewWrapper::GetItemId()"));
-
+
CMPXCollectionPath* path = iCollectionUtility->Collection().PathL();
TInt itemId = path->Id().iId1;
-
+
return itemId;
}
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::SurfacedAttached()
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoViewWrapper::SurfacedAttached( TBool aAttached )
+{
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::SurfacedAttached() attached = %d"), aAttached);
+
+ TVideoPlaybackControlCommandIds event = EControlCmdSurfaceDetached;
+
+ if ( aAttached )
+ {
+ event = EControlCmdSurfaceAttached;
+ }
+
+ iControlsController->handleEvent( event );
+}
+
// EOF
--- a/videoplayback/videoplaybackview/viewsrc/videobaseplaybackview.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayback/videoplaybackview/viewsrc/videobaseplaybackview.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#47 %
+// Version : %version: da1mmcf#48 %
@@ -142,6 +142,9 @@
MPX_TRAPD( err, mVideoMpxWrapper = CMPXVideoViewWrapper::NewL( this ) );
+ connect( hbInstance->allMainWindows()[0], SIGNAL( obscured() ), this, SLOT( handleAppBackground() ) );
+ connect( hbInstance->allMainWindows()[0], SIGNAL( revealed() ), this, SLOT( handleAppForeground() ) );
+
QCoreApplication::instance()->installEventFilter( this );
//
@@ -175,6 +178,9 @@
QCoreApplication::instance()->removeEventFilter( this );
+ disconnect( hbInstance->allMainWindows()[0], SIGNAL( obscured() ), this, SLOT( handleAppBackground() ) );
+ disconnect( hbInstance->allMainWindows()[0], SIGNAL( revealed() ), this, SLOT( handleAppForeground() ) );
+
//
// Close the playback plugin to release all references to previous clip
//
@@ -382,9 +388,9 @@
mTimerForClosingView->start( 0 );
}
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// VideoBasePlaybackView::eventFilter
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
bool VideoBasePlaybackView::eventFilter( QObject *object, QEvent *event )
{
@@ -397,7 +403,8 @@
if ( mActivated )
{
MPX_DEBUG(_L("VideoBasePlaybackView::eventFilter foreground()") );
- TRAP_IGNORE( mVideoMpxWrapper->IssueVideoAppForegroundCmdL( true ) );
+ TRAP_IGNORE( mVideoMpxWrapper->IssueVideoAppForegroundCmdL(
+ true, ! hbInstance->allMainWindows()[0]->isObscured() ) );
}
break;
}
@@ -406,7 +413,8 @@
if ( mActivated )
{
MPX_DEBUG(_L("VideoBasePlaybackView::eventFilter background()") );
- TRAP_IGNORE( mVideoMpxWrapper->IssueVideoAppForegroundCmdL( false ) );
+ TRAP_IGNORE( mVideoMpxWrapper->IssueVideoAppForegroundCmdL(
+ false, ! hbInstance->allMainWindows()[0]->isObscured() ) );
}
break;
}
@@ -472,4 +480,32 @@
}
}
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::handleAppBackground()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::handleAppBackground()
+{
+ MPX_ENTER_EXIT(_L("VideoBasePlaybackView::handleAppBackground()") );
+
+ if ( mActivated )
+ {
+ TRAP_IGNORE( mVideoMpxWrapper->IssueVideoAppForegroundCmdL( false, false ) );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoBasePlaybackView::handleAppForeground()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoBasePlaybackView::handleAppForeground()
+{
+ MPX_ENTER_EXIT(_L("VideoBasePlaybackView::handleAppForeground()") );
+
+ if ( mActivated )
+ {
+ TRAP_IGNORE( mVideoMpxWrapper->IssueVideoAppForegroundCmdL( true, true ) );
+ }
+}
+
// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/viewsrc/videocontainer.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -0,0 +1,45 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: CCoeControl to provide RWindow for videoplayback
+*
+*/
+
+// Version : %version: 3 %
+
+
+
+#include "videocontainer.h"
+#include "mpxvideo_debug.h"
+
+CVideoContainer::CVideoContainer()
+{
+ MPX_ENTER_EXIT( _L("CVideoContainer::CVideoContainer()") );
+}
+
+CVideoContainer::~CVideoContainer()
+{
+ MPX_ENTER_EXIT( _L("CVideoContainer::~CVideoContainer()") );
+
+ CloseWindow();
+}
+
+void CVideoContainer::ConstructL()
+{
+ MPX_ENTER_EXIT( _L("CVideoContainer::ConstructL()") );
+
+ CreateWindowL();
+ ActivateL();
+}
+
+// End of file
--- a/videoplayerapp/bwins/videoplayerengineu.def Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayerapp/bwins/videoplayerengineu.def Fri Aug 06 09:43:48 2010 +0300
@@ -62,4 +62,6 @@
??_EVideoPlayerEngine@@UAE@I@Z @ 61 NONAME ; VideoPlayerEngine::~VideoPlayerEngine(unsigned int)
?applicationReady@VideoPlayerEngine@@IAEXXZ @ 62 NONAME ; void VideoPlayerEngine::applicationReady(void)
?viewReadySlot@VideoPlayerEngine@@QAEXXZ @ 63 NONAME ; void VideoPlayerEngine::viewReadySlot(void)
+ ?handlePlaybackFailure@VideoPlayerEngine@@AAEXH@Z @ 64 NONAME ; void VideoPlayerEngine::handlePlaybackFailure(int)
+ ?playURI@VideoPlayerEngine@@QAEXVQString@@@Z @ 65 NONAME ; void VideoPlayerEngine::playURI(class QString)
--- a/videoplayerapp/eabi/videoplayerengineu.def Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayerapp/eabi/videoplayerengineu.def Fri Aug 06 09:43:48 2010 +0300
@@ -66,4 +66,6 @@
_ZTV18VideoActivityState @ 65 NONAME
_ZN17VideoPlayerEngine13viewReadySlotEv @ 66 NONAME
_ZN17VideoPlayerEngine16applicationReadyEv @ 67 NONAME
+ _ZN17VideoPlayerEngine21handlePlaybackFailureEi @ 68 NONAME
+ _ZN17VideoPlayerEngine7playURIE7QString @ 69 NONAME
--- a/videoplayerapp/inc/videoplayerengine.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayerapp/inc/videoplayerengine.h Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 16 %
+// Version : %version: 19 %
#ifndef VIDEOPLAYERENGINE_H
#define VIDEOPLAYERENGINE_H
@@ -56,6 +56,7 @@
public:
void initialize();
void playMedia( QString filePath );
+ void playURI( QString uri );
void playMedia( RFile file );
void setEmbedded();
signals:
@@ -91,6 +92,8 @@
bool shouldExit();
bool shouldActivateCollectionView();
+
+ void handlePlaybackFailure(int errorCode);
private:
bool mIsService;
--- a/videoplayerapp/videoplayer/resources/service_conf.xml Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayerapp/videoplayer/resources/service_conf.xml Fri Aug 06 09:43:48 2010 +0300
@@ -40,5 +40,11 @@
<name>com.nokia.symbian.IFileView</name>
<version>1.0</version>
<description>Interface for playing video given a QFile</description>
- </interface>
+ </interface>
+ <interface>
+ <name>com.nokia.symbian.IUriView</name>
+ <version>1.0</version>
+ <description>Interface for playing RSTP and MMS</description>
+ <customproperty key="schemes">rtsp, rtspt, rtspu, mms, mmst</customproperty>
+ </interface>
</service>
\ No newline at end of file
--- a/videoplayerapp/videoplayerengine/inc/mpxvideoplayerappuiengine.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayerapp/videoplayerengine/inc/mpxvideoplayerappuiengine.h Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 7 %
+// Version : %version: 8 %
@@ -202,6 +202,13 @@
void LateInitL();
TInt ReplayAfterPriorTermination(const TDesC& aFileName);
+
+ /*
+ * converts provided error code to a string
+ * @since 10.1
+ * @param aErrorCode error code to be converted
+ */
+ const TDesC& ResolveErrorStringL(TInt aErrorCode);
private:
/**
--- a/videoplayerapp/videoplayerengine/inc/videoplaybackwrapper.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayerapp/videoplayerengine/inc/videoplaybackwrapper.h Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 7 %
+// Version : %version: 9 %
@@ -39,14 +39,17 @@
virtual ~VideoPlaybackWrapper();
int playMedia( QString aFileName );
+ int playURI( QString aUri );
int playMedia( RFile aFile );
void openPlaybackView() ;
void lateInit();
int replayMedia( QString aFilename );
+ const QString resloveErrorString( int errorCode );
private:
void initializePlugins();
int openFileWithNativePath(const TDesC& aFileName);
+ int openURI(const TDesC& aUri);
signals:
void handlePlaybackView( int viewId );
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayerengine/inc/videoserviceuri.h Fri Aug 06 09:43:48 2010 +0300
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Declaration of VideoServiceUri and VideoServiceUriMms
+*
+*/
+
+// Version : %version: 1 %
+
+#ifndef __VIDEOSERVICEURI_H__
+#define __VIDEOSERVICEURI_H__
+
+#include <xqserviceprovider.h>
+#include <QObject>
+
+// FORWARD DECLARATIONS
+class VideoServices;
+class VideoPlayerEngine;
+class QLatin1String;
+
+class VideoServiceUri : public XQServiceProvider
+ {
+ Q_OBJECT
+
+ public:
+ VideoServiceUri( VideoServices *parent, VideoPlayerEngine* engine, QLatin1String service );
+ virtual ~VideoServiceUri();
+
+ void setEngine( VideoPlayerEngine* engine );
+
+ public slots:
+ bool view( QString uri );
+
+ private:
+ VideoPlayerEngine* mEngine;
+ VideoServices* mServiceApp;
+ };
+
+#endif //__VIDEOSERVICEURI_H__
--- a/videoplayerapp/videoplayerengine/src/mpxvideoplayerappuiengine.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayerapp/videoplayerengine/src/mpxvideoplayerappuiengine.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 11 %
+// Version : %version: 12 %
@@ -37,6 +37,7 @@
#include <mmf/common/mmfcontrollerframeworkbase.h>
#include <coeutils.h>
+#include <textresolver.h>
#include <videoplaylistutility.h>
#include <mpxvideoplaybackdefs.h>
#include <mpxmediacontainerdefs.h>
@@ -787,6 +788,22 @@
}
+// -------------------------------------------------------------------------------------------------
+// CMpxVideoPlayerAppUiEngine::ResolveErrorStringL()
+// -------------------------------------------------------------------------------------------------
+//
+const TDesC& CMpxVideoPlayerAppUiEngine::ResolveErrorStringL(TInt aErrorCode)
+{
+ MPX_DEBUG(_L("CMpxVideoPlayerAppUiEngine::ResolveErrorStringL()"));
+
+ CTextResolver* textresolver = CTextResolver::NewL();
+
+ const TDesC& text = textresolver->ResolveErrorString( aErrorCode );
+
+ delete textresolver;
+
+ return text;
+}
// EOF
--- a/videoplayerapp/videoplayerengine/src/videoplaybackwrapper.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayerapp/videoplayerengine/src/videoplaybackwrapper.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 7 %
+// Version : %version: 9 %
#include "mpxvideo_debug.h"
@@ -181,5 +181,50 @@
return err;
}
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackWrapper::resloveErrorString()
+// -------------------------------------------------------------------------------------------------
+//
+const QString VideoPlaybackWrapper::resloveErrorString( int errorCode )
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackWrapper::resloveErrorString()"));
+
+ TPtrC text;
+ TRAP_IGNORE( text.Set(mUiEngine->ResolveErrorStringL(errorCode)) );
+
+ const QString qString( (QChar*)text.Ptr(), text.Length() );
+
+ return qString;
+}
+// -------------------------------------------------------------------------------------------------
+// QMpxVideoPlaybackWrapper::playMedia()
+// -------------------------------------------------------------------------------------------------
+//
+int VideoPlaybackWrapper::playURI( QString aUri )
+{
+ MPX_ENTER_EXIT(_L("QMpxVideoPlaybackWrapper::playURI"));
+
+ TBuf<KMaxFileName> uri( aUri.utf16() );
+ int error = openURI( uri );
+
+ MPX_DEBUG(_L("QMpxVideoPlaybackWrapper::playURI err = %d"), error);
+
+ return error;
+}
+
+// -------------------------------------------------------------------------------------------------
+// QMpxVideoPlaybackWrapper::openURI()
+// -------------------------------------------------------------------------------------------------
+//
+int VideoPlaybackWrapper::openURI(const TDesC& aUri)
+{
+ MPX_DEBUG(_L("QMpxVideoPlaybackWrapper::openURI()"));
+
+ int err = KErrNone;
+
+ TRAP( err, mUiEngine->OpenFileL( aUri ) );
+
+ return err;
+}
// End of File
--- a/videoplayerapp/videoplayerengine/src/videoplayerengine.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayerapp/videoplayerengine/src/videoplayerengine.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 40 %
+// Version : %version: da1mmcf#42 %
#include <QApplication>
@@ -27,6 +27,7 @@
#include <hbview.h>
#include <hbapplication.h>
#include <hbactivitymanager.h>
+#include <hbdevicenotificationdialog.h>
#include "videoplayerengine.h"
#include "videoactivitystate.h"
@@ -543,7 +544,29 @@
MPX_ENTER_EXIT(_L("VideoPlayerEngine::playMedia()"),
_L("filePath = %s"), filePath.data() );
- mPlaybackWrapper->playMedia( filePath );
+ int result = mPlaybackWrapper->playMedia( filePath );
+
+ if ( result != KErrNone )
+ {
+ handlePlaybackFailure(result);
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// playURI()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlayerEngine::playURI( QString uri )
+{
+ MPX_ENTER_EXIT(_L("VideoPlayerEngine::playURI()"),
+ _L("uri = %s"), uri.data() );
+
+ int result = mPlaybackWrapper->playURI( uri );
+
+ if ( result != KErrNone )
+ {
+ handlePlaybackFailure(result);
+ }
}
// -------------------------------------------------------------------------------------------------
@@ -554,7 +577,12 @@
{
MPX_ENTER_EXIT(_L("VideoPlayerEngine::playMedia( RFile )"));
- mPlaybackWrapper->playMedia( file );
+ int result = mPlaybackWrapper->playMedia( file );
+
+ if ( result != KErrNone )
+ {
+ handlePlaybackFailure(result);
+ }
}
// -------------------------------------------------------------------------------------------------
@@ -612,7 +640,8 @@
MPX_DEBUG(_L("VideoPlayerEngine::isPlayServiceInvoked() : interfaceName(%s)"), intface.data() );
if ( intface.contains("IVideoView") ||
- intface.contains("IFileView") )
+ intface.contains("IFileView") ||
+ intface.contains("IUriView"))
{
result = true;
mIsPlayService = true;
@@ -667,4 +696,53 @@
return result;
}
+
+// -------------------------------------------------------------------------------------------------
+// handlePlaybackFailure()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlayerEngine::handlePlaybackFailure(int errorCode)
+{
+ MPX_DEBUG(_L("VideoPlayerEngine::handlePlaybackFailure()"));
+
+ if ( mIsPlayService )
+ {
+ HbDeviceNotificationDialog* dlg = new HbDeviceNotificationDialog();
+
+ switch ( errorCode )
+ {
+ case KErrNotSupported:
+ case KErrUnknown:
+ case KErrCorrupt:
+ case KErrTooBig:
+ {
+ dlg->setTitle( hbTrId( "txt_videos_info_invalid_clip_operation_canceled" ) );
+ break;
+ }
+ case KErrArgument:
+ case KErrBadName:
+ {
+ dlg->setTitle( hbTrId( "txt_videos_info_unable_to_connect_invalid_url" ) );
+ break;
+ }
+ case KErrNotFound:
+ {
+ dlg->setTitle( hbTrId( "txt_videos_info_file_not_found" ) );
+ break;
+ }
+ default:
+ {
+ const QString textToShow = mPlaybackWrapper->resloveErrorString(errorCode);
+ dlg->setTitle(textToShow);
+ break;
+ }
+ }
+
+ dlg->show();
+
+
+ qApp->quit();
+ XQServiceUtil::toBackground( false );
+ }
+}
// End of file
--- a/videoplayerapp/videoplayerengine/src/videoservices.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayerapp/videoplayerengine/src/videoservices.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#9 %
+// Version : %version: da1mmcf#10 %
#include "videoplayerengine.h"
#include "videoservices.h"
@@ -23,6 +23,7 @@
#include "videoserviceplay.h"
#include "videoserviceview.h"
#include "videoservicebrowse.h"
+#include "videoserviceuri.h"
#include "mpxvideo_debug.h"
#include <xqaiwdecl.h>
#include <xqserviceutil.h>
@@ -87,6 +88,12 @@
mEngine = engine;
mServiceView->setEngine(engine);
}
+
+ if ( mServiceUriView )
+ {
+ mEngine = engine;
+ mServiceUriView->setEngine(engine);
+ }
}
@@ -160,6 +167,11 @@
// Old service, old interface
mServiceBrowseDeprecatedOldService = new VideoServiceBrowse( this,
QLatin1String("com.nokia.Videos.IVideoBrowse") );
+
+ // new service, new interface
+ mServiceUriView = new VideoServiceUri( this, engine, QLatin1String("videoplayer.com.nokia.symbian.IUriView"));
+
+
}
// -------------------------------------------------------------------------------------------------
@@ -182,6 +194,7 @@
delete mServiceUriFetchDeprecatedNewService;
delete mServiceBrowseDeprecatedOldService;
delete mServiceUriFetchDeprecatedOldService;
+ delete mServiceUriView;
}
// -------------------------------------------------------------------------------------------------
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayerengine/src/videoserviceuri.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -0,0 +1,75 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of VideoServiceUri
+*
+*/
+
+// Version : %version: 1 %
+
+#include "videoservices.h"
+#include "videoserviceuri.h"
+#include "videoplayerengine.h"
+#include "mpxvideo_debug.h"
+
+// -------------------------------------------------------------------------------------------------
+// VideoServiceUri()
+// -------------------------------------------------------------------------------------------------
+//
+VideoServiceUri::VideoServiceUri( VideoServices* parent,
+ VideoPlayerEngine* engine,
+ QLatin1String service )
+ : XQServiceProvider( service, parent )
+ , mEngine( engine )
+ , mServiceApp( parent )
+{
+ MPX_ENTER_EXIT(_L("VideoServiceUri::VideoServiceUri()"));
+ publishAll();
+}
+
+// -------------------------------------------------------------------------------------------------
+// ~VideoServiceUri()
+// -------------------------------------------------------------------------------------------------
+//
+VideoServiceUri::~VideoServiceUri()
+{
+ MPX_ENTER_EXIT(_L("VideoServiceUri::~VideoServiceUri()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// setEngine()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoServiceUri::setEngine( VideoPlayerEngine* engine )
+{
+ MPX_ENTER_EXIT(_L("VideoServiceUri::setEngine()"));
+ mEngine = engine;
+}
+
+// -------------------------------------------------------------------------------------------------
+// view( QString )
+// -------------------------------------------------------------------------------------------------
+//
+bool VideoServiceUri::view( QString uri )
+{
+ MPX_ENTER_EXIT(_L("VideoServiceUri::view( QString ) "),
+ _L("uri = %s"), uri.data() );
+
+ if(mEngine)
+ {
+ mServiceApp->setCurrentService(VideoServices::EUriView);
+ mEngine->playURI( uri );
+ }
+
+ return true;
+}
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/inc/videoplaybackwrapper.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/inc/videoplaybackwrapper.h Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#7 %
+// Version : %version: da1mmcf#9 %
@@ -39,11 +39,13 @@
int playMedia( QString aFileName );
int playMedia( RFile aFile );
int replayMedia( QString aFileName );
+ int playURI( QString aUri );
public:
void openPlaybackView() ;
static int GetInstanceCount();
void lateInit();
+ const QString resloveErrorString( int errorCode );
signals:
void handlePlaybackView( int viewId );
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/src/videoplaybackwrapper.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/src/videoplaybackwrapper.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#8 %
+// Version : %version: da1mmcf#10 %
#include "videoplaybackwrapper.h"
@@ -93,4 +93,25 @@
MPX_DEBUG(_L("VideoPlaybackWrapper::lateInit()"));
}
+const QString VideoPlaybackWrapper::resloveErrorString( int errorCode )
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackWrapper::resloveErrorString()"));
+
+ Q_UNUSED( errorCode );
+
+ const QString string("No Supported");
+
+ return string;
+
+}
+
+int VideoPlaybackWrapper::playURI( QString aUri )
+{
+ MPX_ENTER_EXIT(_L("QMpxVideoPlaybackWrapper::playURI"));
+
+ Q_UNUSED( aUri );
+
+ return 0;
+}
+
// End of File
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoservices/src/testvideoservices.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoservices/src/testvideoservices.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#4 %
+// Version : %version: da1mmcf#5 %
// INCLUDES
#include <QtTest/QtTest>
@@ -31,6 +31,7 @@
#include "videoservices.h"
#include "videoserviceurifetch.h"
#include "videoserviceplay.h"
+#include "videoserviceuri.h"
#undef private
// ---------------------------------------------------------------------------
@@ -100,6 +101,7 @@
QVERIFY( mTestObject->mServicePlay );
QVERIFY( mTestObject->mServiceUriFetch );
QVERIFY( mTestObject->mServiceView );
+ QVERIFY( mTestObject->mServiceUriView );
QVERIFY( mTestObject->mEngine == 0 );
QVERIFY( mTestObject->mCurrentService == VideoServices::ENoService );
}
@@ -115,6 +117,7 @@
QVERIFY( mTestObject->mServicePlay );
QVERIFY( mTestObject->mServiceUriFetch );
QVERIFY( mTestObject->mServiceView );
+ QVERIFY( mTestObject->mServiceUriView );
QVERIFY( mTestObject->mEngine == mEngine );
QVERIFY( mTestObject->mCurrentService == VideoServices::ENoService );
}
@@ -130,6 +133,7 @@
QVERIFY( mTestObject->mServicePlay );
QVERIFY( mTestObject->mServiceUriFetch );
QVERIFY( mTestObject->mServiceView );
+ QVERIFY( mTestObject->mServiceUriView );
QVERIFY( mTestObject->mEngine == 0 );
QVERIFY( mTestObject->mCurrentService == VideoServices::ENoService );
@@ -159,6 +163,9 @@
mTestObject->mServicePlay->playMedia( QString() );
QVERIFY( mTestObject->mCurrentService == VideoServices::EPlayback );
+
+ mTestObject->mServiceUriView->view( QString() );
+ QVERIFY( mTestObject->mCurrentService == VideoServices::EUriView );
}
void TestVideoServices::cleanupTestCase()
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoservices/stub/inc/videoplayerengine.h Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoservices/stub/inc/videoplayerengine.h Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#3 %
+// Version : %version: da1mmcf#4 %
#ifndef VIDEOPLAYERENGINE_H
#define VIDEOPLAYERENGINE_H
@@ -49,6 +49,7 @@
void playMedia( QString filePath );
void playMedia( RFile file );
void setEmbedded();
+ void playURI( QString uri );
public slots:
void handleCommand( int commandCode );
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoservices/stub/src/videoplayerengine.cpp Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoservices/stub/src/videoplayerengine.cpp Fri Aug 06 09:43:48 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#4 %
+// Version : %version: da1mmcf#5 %
#include <qapplication>
@@ -110,4 +110,10 @@
Q_UNUSED( file );
}
+void VideoPlayerEngine::playURI( QString uri )
+{
+ MPX_DEBUG(_L("VideoPlayerEngine::playURI( uri )"));
+ Q_UNUSED( uri );
+}
+
// End of file
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoservices/testvideoservices.pro Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoservices/testvideoservices.pro Fri Aug 06 09:43:48 2010 +0300
@@ -42,7 +42,8 @@
../../inc/videoserviceurifetch.h \
../../inc/videoserviceplay.h \
../../inc/videoserviceview.h \
- ../../inc/videoservicebrowse.h
+ ../../inc/videoservicebrowse.h \
+ ../../inc/videoserviceuri.h
SOURCES += stub/src/videoplayerengine.cpp \
#stub/src/xqserviceprovider.cpp \
@@ -51,5 +52,6 @@
../../src/videoserviceurifetch.cpp \
../../src/videoserviceplay.cpp \
../../src/videoserviceview.cpp \
- ../../src/videoservicebrowse.cpp
+ ../../src/videoservicebrowse.cpp \
+ ../../src/videoserviceuri.cpp
--- a/videoplayerapp/videoplayerengine/videoplayerengine.pro Fri Jul 23 11:10:06 2010 +0300
+++ b/videoplayerapp/videoplayerengine/videoplayerengine.pro Fri Aug 06 09:43:48 2010 +0300
@@ -14,7 +14,7 @@
# Description: Project file for building Videoplayer components
#
#
-# Version : %version: 29 %
+# Version : %version: da1mmcf#31 %
TEMPLATE = lib
@@ -55,7 +55,8 @@
-lxqservice.dll \
-lxqserviceutil.dll \
-lflogger.dll \
- -lefsrv
+ -lefsrv \
+ -lcommonengine.dll
DEPENDPATH += ../../inc ../inc inc
VPATH += src
@@ -68,7 +69,8 @@
videoserviceurifetch.h \
videoserviceview.h \
videoservicebrowse.h \
- videoactivitystate.h
+ videoactivitystate.h \
+ videoserviceuri.h
SOURCES += videoplayerengine.cpp \
videoplaybackwrapper.cpp \
@@ -78,5 +80,6 @@
videoserviceurifetch.cpp \
videoserviceview.cpp \
videoservicebrowse.cpp \
- videoactivitystate.cpp
+ videoactivitystate.cpp \
+ videoserviceuri.cpp