diff -r 7d93ee07fb27 -r c48470be1ba7 videocollection/videocollectionview/src/videocollectionviewutils.cpp --- a/videocollection/videocollectionview/src/videocollectionviewutils.cpp Thu May 27 12:53:14 2010 +0300 +++ b/videocollection/videocollectionview/src/videocollectionviewutils.cpp Fri Jun 11 13:39:54 2010 +0300 @@ -18,6 +18,8 @@ // Version : %version: 39 % // INCLUDE FILES +#include +#include #include #include #include @@ -49,6 +51,8 @@ const int KAddToCollectionCountIndex(0); const int KAddToCollectionNameIndex(1); +static const char* ACTIVITY_VIDEOS_MAINVIEW = "VideosMainView"; + // --------------------------------------------------------------------------- // instance // --------------------------------------------------------------------------- @@ -311,6 +315,53 @@ } // --------------------------------------------------------------------------- +// saveWidgetLevel +// --------------------------------------------------------------------------- +// +void VideoCollectionViewUtils::saveWidgetLevel(VideoCollectionCommon::TCollectionLevels &level) +{ + FUNC_LOG; + HbActivityManager* activityManager = qobject_cast(qApp)->activityManager(); + if(!activityManager) + { + return; + } + // clean up any previous versions of this activity from the activity manager. + activityManager->removeActivity(ACTIVITY_VIDEOS_MAINVIEW); + + QVariant data = int(level); + + activityManager->addActivity(ACTIVITY_VIDEOS_MAINVIEW, data, QVariantHash()); + + +} + +// --------------------------------------------------------------------------- +// loadWidgetLevel +// --------------------------------------------------------------------------- +// +VideoCollectionCommon::TCollectionLevels VideoCollectionViewUtils::loadWidgetLevel() +{ + FUNC_LOG; + // all videos view is the default value to be returned in case nothing can be read + // from the activity manager + VideoCollectionCommon::TCollectionLevels level(VideoCollectionCommon::ELevelVideos); + + HbActivityManager* activityManager = qobject_cast(qApp)->activityManager(); + if(!activityManager) + { + return level; + } + QVariant data =activityManager->activityData(ACTIVITY_VIDEOS_MAINVIEW); + if(data.toInt() == VideoCollectionCommon::ELevelCategory) + { + level = VideoCollectionCommon::ELevelCategory; + } + return level; + +} + +// --------------------------------------------------------------------------- // showStatusMsgSlot // --------------------------------------------------------------------------- //