tvout/tvoutwrapper/src/glxtvoutwrapper_p.cpp
changeset 29 2c833fc9e98f
parent 26 c499df2dbb33
child 33 1ee2af37811f
--- a/tvout/tvoutwrapper/src/glxtvoutwrapper_p.cpp	Mon May 03 12:31:32 2010 +0300
+++ b/tvout/tvoutwrapper/src/glxtvoutwrapper_p.cpp	Fri May 14 15:52:22 2010 +0300
@@ -20,6 +20,7 @@
 #include "glxtvconnectionobserver.h"
 #include "glxhdmicontroller.h"
 #include "glxmodelparm.h"
+#include "glxviewids.h"
 
 // -----------------------------------------------------------------------------
 // Static method to create the private wrapper instance 
@@ -89,7 +90,7 @@
     iHdmiConnected = aConnected;
     // if Connection state positive and uri/bmp are not passed to HDMI already
     // then it is a new image - Set it.
-    if (!isImageSetToHdmi && iHdmiConnected)
+    if (!isImageSetToHdmi && iHdmiConnected && getSubState() !=IMAGEVIEWER_S)
         {
         SetNewImage();
         }
@@ -123,7 +124,14 @@
 // -----------------------------------------------------------------------------
 void GlxTvOutWrapperPrivate::SetNewImage()
     {
-    int focusIndex = (iModel->data(iModel->index(0,0),GlxFocusIndexRole).value<int>());
+    QVariant focusVariant =(iModel->data(iModel->index(0,0),GlxFocusIndexRole)); 
+    int focusIndex;
+    if (focusVariant.isValid() && focusVariant.canConvert<int>()) {
+        focusIndex = (focusVariant.value<int>());
+	}
+	else{
+		return ;
+	}
     
     // Get the image uri
     QString imagePath = (iModel->data(iModel->index(focusIndex,0),GlxUriRole)).value<QString>();
@@ -188,4 +196,17 @@
     }
     }
 
+// -----------------------------------------------------------------------------
+// getSubState 
+// -----------------------------------------------------------------------------
+int GlxTvOutWrapperPrivate::getSubState()
+{
+    int substate = NO_FULLSCREEN_S;
+    QVariant variant = iModel->data( iModel->index(0,0), GlxSubStateRole );    
+    if ( variant.isValid() &&  variant.canConvert<int> ()  ) {
+        substate = variant.value<int>();
+    }
+    return substate;
+}
+
 // End of file