videoplayerapp/videoplayerengine/src/videoserviceurifetch.cpp
changeset 38 ff53afa8ad05
parent 36 8aed59de29f9
child 66 adb51f74b890
equal deleted inserted replaced
37:4eb2df7f7cbe 38:ff53afa8ad05
    13 *
    13 *
    14 * Description:  Implementation of VideoServiceUriFetch
    14 * Description:  Implementation of VideoServiceUriFetch
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 // Version : %version: %
    18 // Version : %version: 5 %
    19 
    19 
    20 #include <hbapplication.h>
    20 #include <hbapplication.h>
    21 
    21 
    22 #include "videoservices.h"
    22 #include "videoservices.h"
    23 #include "videoserviceurifetch.h"
    23 #include "videoserviceurifetch.h"
    24 #include "mpxhbvideocommondefs.h"
    24 #include "mpxhbvideocommondefs.h"
    25 #include "mpxvideo_debug.h"
    25 #include "mpxvideo_debug.h"
       
    26 #include <xqaiwdecl.h>
    26 
    27 
    27 
    28 
    28 // ----------------------------------------------------------------------------
    29 // ----------------------------------------------------------------------------
    29 // VideoServiceUriFetch()
    30 // VideoServiceUriFetch()
    30 // ----------------------------------------------------------------------------
    31 // ----------------------------------------------------------------------------
    31 //
    32 //
    32 VideoServiceUriFetch::VideoServiceUriFetch(VideoServices* parent)
    33 VideoServiceUriFetch::VideoServiceUriFetch(VideoServices* parent, QLatin1String service)
    33     : XQServiceProvider( QLatin1String("com.nokia.Videos.IVideoFetch"), parent )
    34     : XQServiceProvider( service, parent )
    34     , mRequestIndex( 0 )
    35     , mRequestIndex( 0 )
    35     , mServiceApp( parent )
    36     , mServiceApp( parent )
    36 {
    37 {
    37     MPX_ENTER_EXIT(_L("VideoServiceUriFetch::VideoServiceUriFetch()"));
    38     MPX_ENTER_EXIT(_L("VideoServiceUriFetch::VideoServiceUriFetch()"));
    38 	publishAll();
    39 	publishAll();
   123 
   124 
   124 // ----------------------------------------------------------------------------
   125 // ----------------------------------------------------------------------------
   125 // fetch()
   126 // fetch()
   126 // ----------------------------------------------------------------------------
   127 // ----------------------------------------------------------------------------
   127 //
   128 //
       
   129 void VideoServiceUriFetch::fetch()
       
   130 {
       
   131 	MPX_ENTER_EXIT(_L("VideoServiceUriFetch::fetch()"));
       
   132 
       
   133 	emit mServiceApp->activated(MpxHbVideoCommon::ActivateCollectionView);
       
   134     
       
   135     XQRequestInfo info = requestInfo();
       
   136     
       
   137     QVariant variant = info.info("WindowTitle");
       
   138     
       
   139     if(variant.isValid())
       
   140     {
       
   141     	mTitle = variant.toString();
       
   142     }
       
   143     
       
   144     if (mTitle.isEmpty())
       
   145     {
       
   146     	mTitle = hbTrId("txt_videos_title_videos");
       
   147     }
       
   148 
       
   149 	emit mServiceApp->titleReady(mTitle);
       
   150     mServiceApp->setCurrentService(VideoServices::EUriFetcher);
       
   151 
       
   152     mRequestIndex = setCurrentRequestAsync();
       
   153     MPX_DEBUG(_L("VideoServiceUriFetch::fetch() : mRequestIndex(%d)"), mRequestIndex );
       
   154 }
       
   155 
       
   156 // ----------------------------------------------------------------------------
       
   157 // fetch()
       
   158 // ----------------------------------------------------------------------------
       
   159 //
   128 void VideoServiceUriFetch::fetch(const QString& title)
   160 void VideoServiceUriFetch::fetch(const QString& title)
   129 {
   161 {
   130     MPX_ENTER_EXIT(_L("VideoServiceUriFetch::fetch()"),
   162 	MPX_ENTER_EXIT(_L("VideoServiceUriFetch::fetch()"),
   131                    _L("title = %s"), title.data() );
   163                    _L("title = %s"), title.data() );
   132     
   164     
       
   165     emit mServiceApp->activated(MpxHbVideoCommon::ActivateCollectionView);
       
   166 
   133     mTitle = title;
   167     mTitle = title;
   134     emit mServiceApp->activated(MpxHbVideoCommon::ActivateCollectionView);
   168 
   135     emit mServiceApp->titleReady(title);
   169     if (mTitle.isEmpty())
       
   170     {
       
   171     	mTitle = hbTrId("txt_videos_title_videos");
       
   172     }
       
   173 
       
   174    	emit mServiceApp->titleReady(mTitle);
   136 
   175 
   137     mServiceApp->setCurrentService(VideoServices::EUriFetcher);
   176     mServiceApp->setCurrentService(VideoServices::EUriFetcher);
   138 
   177 
   139     mRequestIndex = setCurrentRequestAsync();
   178     mRequestIndex = setCurrentRequestAsync();
   140     MPX_DEBUG(_L("VideoServiceUriFetch::fetch() : mRequestIndex(%d)"), mRequestIndex );
   179     MPX_DEBUG(_L("VideoServiceUriFetch::fetch() : mRequestIndex(%d)"), mRequestIndex );