diff -r c499df2dbb33 -r 2c833fc9e98f tvout/tvoutwrapper/src/glxtvoutwrapper_p.cpp --- 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()); + QVariant focusVariant =(iModel->data(iModel->index(0,0),GlxFocusIndexRole)); + int focusIndex; + if (focusVariant.isValid() && focusVariant.canConvert()) { + focusIndex = (focusVariant.value()); + } + else{ + return ; + } // Get the image uri QString imagePath = (iModel->data(iModel->index(focusIndex,0),GlxUriRole)).value(); @@ -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 () ) { + substate = variant.value(); + } + return substate; +} + // End of file