videocollection/hgmyvideos/src/vcxhgmyvideosmainview.cpp
branchRCL_3
changeset 16 67eb01668b0e
parent 15 8f0df5c82986
child 18 baf439b22ddd
--- a/videocollection/hgmyvideos/src/vcxhgmyvideosmainview.cpp	Tue May 25 12:44:54 2010 +0300
+++ b/videocollection/hgmyvideos/src/vcxhgmyvideosmainview.cpp	Wed Jun 09 09:44:23 2010 +0300
@@ -15,7 +15,7 @@
 */
 
 
-// Version : %version: 45 %
+// Version : %version: 46 %
 
 // INCLUDE FILES
 #include <bldvariant.hrh>
@@ -58,6 +58,10 @@
 
 _LIT( KBrowserProtocol, "4 " );
 
+// URL to Ovi Store videos. If Ovi Store Launcher is not installed, this
+// address will be opened to web browser.
+_LIT( KOviVideoStoreURL, "http://lr.ovi.mobi/store/video" );
+
 // ============================ MEMBER FUNCTIONS ===============================
 
 // -----------------------------------------------------------------------------
@@ -863,3 +867,36 @@
     
     CleanupStack::PopAndDestroy( param );
     }
+
+// ------------------------------------------------------------------------------
+// CVcxHgMyVideosMainView::LaunchOviStoreL()
+// ------------------------------------------------------------------------------
+//
+void CVcxHgMyVideosMainView::LaunchOviStoreL( const TUid aAppUid, const TDesC& aArgs )
+    {
+    IPTVLOGSTRING_LOW_LEVEL( "CVcxHgMyVideosMainView::LaunchOviStoreL() enter" );
+    RApaLsSession appArcSession;
+    User::LeaveIfError( appArcSession.Connect() );
+    CleanupClosePushL<RApaLsSession>( appArcSession );
+
+    TApaAppInfo appInfo;
+    TInt err = appArcSession.GetAppInfo( appInfo, aAppUid );
+    IPTVLOGSTRING2_LOW_LEVEL( "CVcxHgMyVideosMainView::LaunchOviStoreL() GetAppInfo() error = %d", err );
+
+    if ( KErrNone == err )
+        {
+        IPTVLOGSTRING3_LOW_LEVEL( "CVcxHgMyVideosMainView::LaunchOviStoreL() launch '%S' with arguments '%S'", &appInfo.iFullName, &aArgs );
+        RProcess process;
+        User::LeaveIfError( process.Create( appInfo.iFullName, aArgs ) );
+        process.Resume();
+        process.Close();
+        }
+    else
+        {
+        // Launcher not found, use browser until launcher is available
+        IPTVLOGSTRING_LOW_LEVEL( "CVcxHgMyVideosMainView::LaunchOviStoreL() launcher not found, launch browser" );
+        LaunchBrowserL( KOviVideoStoreURL );
+        }
+
+    CleanupStack::PopAndDestroy( &appArcSession );
+    }