ui/views/detailsview/src/glxdetailsview.cpp
changeset 52 a3a4c0de738e
parent 50 a0f57508af73
child 54 0f0f3f26f787
equal deleted inserted replaced
50:a0f57508af73 52:a3a4c0de738e
    42 #include "glxmediamodel.h"
    42 #include "glxmediamodel.h"
    43 #include "glxdetailsview.h"
    43 #include "glxdetailsview.h"
    44 #include "glxfavmediamodel.h"
    44 #include "glxfavmediamodel.h"
    45 #include "glxdocloaderdefs.h"
    45 #include "glxdocloaderdefs.h"
    46 #include <glxcommandhandlers.hrh>
    46 #include <glxcommandhandlers.hrh>
    47 #include "glxdetailsdescriptionedit.h"
    47 
    48 #include "glxdetailsnamelabel.h"
    48 #include "glxdetailstextedit.h"
       
    49 #include "glxdetailsicon.h"
    49 
    50 
    50 
    51 
    51 #include "glxviewdocloader.h"
    52 #include "glxviewdocloader.h"
    52 #include <glxcollectionpluginalbums.hrh>
    53 #include <glxcollectionpluginalbums.hrh>
    53 
    54 
    59 #ifdef OST_TRACE_COMPILER_IN_USE
    60 #ifdef OST_TRACE_COMPILER_IN_USE
    60 #include "glxdetailsviewTraces.h"
    61 #include "glxdetailsviewTraces.h"
    61 #endif
    62 #endif
    62 
    63 
    63 //SIZE OF THE IMAGE , LAYOUTS TEAM NEED TO GIVER THE SIZE IN UNITS
    64 //SIZE OF THE IMAGE , LAYOUTS TEAM NEED TO GIVER THE SIZE IN UNITS
    64 #define GLX_IMAGE_SIZE 215 
    65 #define GLX_IMAGE_WIDTH 333
       
    66 #define GLX_IMAGE_HEIGHT 215 
    65 const int KBytesInKB = 1024;
    67 const int KBytesInKB = 1024;
    66 const int KBytesInMB = 1024 * 1024;
    68 const int KBytesInMB = 1024 * 1024;
    67 const int KBytesInGB = 1024 * 1024 * 1024;
    69 const int KBytesInGB = 1024 * 1024 * 1024;
    68 
    70 
    69 //--------------------------------------------------------------------------------------------------------------------------------------------
    71 //--------------------------------------------------------------------------------------------------------------------------------------------
    70 //GlxDetailsView
    72 //GlxDetailsView
    71 //--------------------------------------------------------------------------------------------------------------------------------------------
    73 //--------------------------------------------------------------------------------------------------------------------------------------------
    72 GlxDetailsView::GlxDetailsView(HbMainWindow *window) :
    74 GlxDetailsView::GlxDetailsView(HbMainWindow *window) 
    73 GlxView(GLX_DETAILSVIEW_ID), mDetailsIcon(NULL), mFavIcon(NULL), mModel(
    75     : GlxView( GLX_DETAILSVIEW_ID ),
    74         NULL), mFavModel(NULL), mWindow(window),
    76       mDetailsIcon( NULL ),
    75         mSelIndex(0),mDocLoader(NULL),mImageName(NULL),mDescriptions(NULL),mDateLabel(NULL),mSizeLabel(NULL),mTimeLabel(NULL)
    77       mFavIcon( NULL ), 
    76    {
    78       mModel( NULL ), 
       
    79       mFavModel( NULL ),
       
    80       mWindow( window ),
       
    81       mSelIndex( 0 ),
       
    82       mDocLoader( NULL ),
       
    83       mImageName( NULL ),
       
    84       mDescriptions( NULL ),
       
    85       mDateLabel( NULL ),
       
    86       mSizeLabel( NULL ),
       
    87       mTimeLabel( NULL )
       
    88 {
    77     GLX_LOG_INFO("GlxDetailsView::GlxDetailsView");
    89     GLX_LOG_INFO("GlxDetailsView::GlxDetailsView");
    78     OstTraceFunctionEntry0( GLXDETAILSVIEW_GLXDETAILSVIEW_ENTRY );
    90     OstTraceFunctionEntry0( GLXDETAILSVIEW_GLXDETAILSVIEW_ENTRY );
    79     setContentFullScreen(true);//for smooth transtion between grid to full screen and vice versa
    91     setContentFullScreen(true);//for smooth transtion between grid to full screen and vice versa
    80     OstTraceFunctionExit0( GLXDETAILSVIEW_GLXDETAILSVIEW_EXIT );
    92     OstTraceFunctionExit0( GLXDETAILSVIEW_GLXDETAILSVIEW_EXIT );
    81    }
    93 }
    82 
    94 
    83 //--------------------------------------------------------------------------------------------------------------------------------------------
    95 //--------------------------------------------------------------------------------------------------------------------------------------------
    84 //~GlxDetailsView
    96 //~GlxDetailsView
    85 //--------------------------------------------------------------------------------------------------------------------------------------------
    97 //--------------------------------------------------------------------------------------------------------------------------------------------
    86 GlxDetailsView::~GlxDetailsView()
    98 GlxDetailsView::~GlxDetailsView()
    87     {
    99 {
    88     OstTrace0( TRACE_IMPORTANT, GLXDETAILSVIEW_GLXDETAILSVIEW, "GlxDetailsView::~GlxDetailsView" );
   100     OstTrace0( TRACE_IMPORTANT, GLXDETAILSVIEW_GLXDETAILSVIEW, "GlxDetailsView::~GlxDetailsView" );
    89     
   101     
    90     delete mDocLoader;
   102     delete mDocLoader;
    91     mDocLoader = NULL;
   103     mDocLoader = NULL;
    92     
   104     
    93     cleanUp();
   105     cleanUp();
    94     }
   106 }
    95 
   107 
    96 //--------------------------------------------------------------------------------------------------------------------------------------------
   108 //--------------------------------------------------------------------------------------------------------------------------------------------
    97 //activate
   109 //activate
    98 //--------------------------------------------------------------------------------------------------------------------------------------------
   110 //--------------------------------------------------------------------------------------------------------------------------------------------
    99 void GlxDetailsView::activate()
   111 void GlxDetailsView::activate()
   137     mDocLoader->load(GLX_DETAILSVIEW_DOCMLPATH, &loaded);     
   149     mDocLoader->load(GLX_DETAILSVIEW_DOCMLPATH, &loaded);     
   138 
   150 
   139     HbView *mView = static_cast<HbView*> (mDocLoader->findWidget(
   151     HbView *mView = static_cast<HbView*> (mDocLoader->findWidget(
   140             GLX_DETAILSVIEW_VIEW));
   152             GLX_DETAILSVIEW_VIEW));
   141     
   153     
   142     HbWidget *mwidget = static_cast<HbWidget*> (mDocLoader->findWidget(
       
   143             "MainWidget"));
       
   144 
       
   145     mDetailsIcon = static_cast<HbLabel*> (mDocLoader->findWidget(
   154     mDetailsIcon = static_cast<HbLabel*> (mDocLoader->findWidget(
   146             GLX_DETAILSVIEW_IMAGE));
   155             GLX_DETAILSVIEW_IMAGE));
   147     mFavIcon = static_cast<HbPushButton*> (mDocLoader->findWidget(
   156     mFavIcon = static_cast<GlxDetailsIcon*> (mDocLoader->findWidget(
   148             GLX_DETAILSVIEW_FAVICON));
   157             GLX_DETAILSVIEW_FAVICON));
   149 
   158 
   150 
   159 
   151     mDescriptions = static_cast<GlxDetailsDescriptionEdit*> (mDocLoader->findWidget(
   160     mDescriptions = static_cast<GlxDetailsTextEdit*> (mDocLoader->findWidget(
   152             GLX_DETAILSVIEW_DESCRPTIONTEXT));
   161             GLX_DETAILSVIEW_DESCRPTIONTEXT));
   153     
   162     
   154     mImageName = static_cast<GlxDetailsNameLabel*> (mDocLoader->findWidget(
   163     mImageName = static_cast<GlxDetailsTextEdit*> (mDocLoader->findWidget(
   155             GLX_DETAILSVIEW_IMGNAME));
   164             GLX_DETAILSVIEW_IMGNAME));
   156     
   165     
   157     mDateLabel = static_cast<HbLabel*> (mDocLoader->findWidget(
   166     mDateLabel = static_cast<HbLabel*> (mDocLoader->findWidget(
   158             GLX_DETAILSVIEW_DATETEXT));
   167             GLX_DETAILSVIEW_DATETEXT));
   159     
   168     
   161             GLX_DETAILSVIEW_TIMETEXT));
   170             GLX_DETAILSVIEW_TIMETEXT));
   162     
   171     
   163     mSizeLabel = static_cast<HbLabel*> (mDocLoader->findWidget(
   172     mSizeLabel = static_cast<HbLabel*> (mDocLoader->findWidget(
   164             GLX_DETAILSVIEW_SIZETEXT));
   173             GLX_DETAILSVIEW_SIZETEXT));
   165 
   174 
   166     
   175     mFavIconEnabled  =  HbIcon(GLXICON_ADD_TO_FAV);
   167         //Set the Model
   176     mFavIconDisabled =  HbIcon(GLXICON_REMOVE_FAV);   
       
   177         
       
   178     //Set the Model
   168     mModel = model;  
   179     mModel = model;  
   169    if(getSubState() == IMAGEVIEWER_DETAIL_S) {
   180    if(getSubState() == IMAGEVIEWER_DETAIL_S) {
   170        mFavIcon->hide();
   181        mFavIcon->hide();
   171     }
   182     }
   172     else
   183     else
   173     {
   184     {
   174         //set the frame graphics to the background of the fav icon
   185        mFavIcon->setItemIcon(HbIcon(GLXICON_REMOVE_FAV));
   175         HbFrameItem* frame = new HbFrameItem(this);
       
   176         frame->frameDrawer().setFrameType(HbFrameDrawer::NinePieces);
       
   177         frame->frameDrawer().setFrameGraphicsName("qtg_fr_multimedia_trans");
       
   178         frame->graphicsItem()->setOpacity(0.2);
       
   179         mFavIcon->setBackgroundItem(frame->graphicsItem(), -1);
       
   180         mFavIcon->setBackground(HbIcon("qtg_fr_multimedia_trans"));
       
   181         mFavIcon->setIcon(HbIcon(GLXICON_REMOVE_FAV));
       
   182      }	
   186      }	
   183 	 
   187 	 
   184 	setWidget(mView);
   188 	setWidget(mView);
   185 	
   189 	
   186     //Set the Layout Correspondingly.
   190     //Set the Layout Correspondingly.
   187     updateLayout(mWindow->orientation());
   191     updateLayout(mWindow->orientation());
   188 
   192 
   189     //Shows the Image 
       
   190     showImage();
       
   191     OstTraceFunctionExit0( GLXDETAILSVIEW_INITIALIZEVIEW_EXIT );
   193     OstTraceFunctionExit0( GLXDETAILSVIEW_INITIALIZEVIEW_EXIT );
   192     }
   194     }
   193 
   195 
   194 //--------------------------------------------------------------------------------------------------------------------------------------------
   196 //--------------------------------------------------------------------------------------------------------------------------------------------
   195 //resetView
   197 //resetView
   227     
   229     
   228     clearCurrentModel();
   230     clearCurrentModel();
   229 
   231 
   230     delete mFavModel;
   232     delete mFavModel;
   231     mFavModel = NULL;
   233     mFavModel = NULL;
   232 
   234        
   233     delete mFavIcon;
   235     delete mFavIcon;
   234     mFavIcon = NULL;
   236     mFavIcon = NULL;
   235 
   237 
   236     delete mDetailsIcon;
   238     delete mDetailsIcon;
   237     mDetailsIcon = NULL;
   239     mDetailsIcon = NULL;
   260     GlxModelParm modelParm;
   262     GlxModelParm modelParm;
   261     QString imagePath = (mModel->data(mModel->index(mModel->data(
   263     QString imagePath = (mModel->data(mModel->index(mModel->data(
   262             mModel->index(0, 0), GlxFocusIndexRole).value<int> (), 0),
   264             mModel->index(0, 0), GlxFocusIndexRole).value<int> (), 0),
   263             GlxUriRole)).value<QString> ();
   265             GlxUriRole)).value<QString> ();
   264 
   266 
   265     if (mFavModel == NULL)
   267     if (mFavModel == NULL) {
   266         {
       
   267         modelParm.setCollection(KGlxCollectionPluginFavoritesAlbumId);
   268         modelParm.setCollection(KGlxCollectionPluginFavoritesAlbumId);
   268         modelParm.setContextMode(GlxContextFavorite);
   269         modelParm.setContextMode(GlxContextFavorite);
   269         modelParm.setPath(imagePath);
   270         modelParm.setPath(imagePath);
   270         mFavModel = new GlxFavMediaModel(modelParm);
   271         mFavModel = new GlxFavMediaModel(modelParm);
   271         }
   272     }
   272 }
   273 }
   273 
   274 
   274 //--------------------------------------------------------------------------------------------------------------------------------------------
   275 //--------------------------------------------------------------------------------------------------------------------------------------------
   275 //initializeNewModel
   276 //initializeNewModel
   276 //--------------------------------------------------------------------------------------------------------------------------------------------
   277 //--------------------------------------------------------------------------------------------------------------------------------------------
   277 void GlxDetailsView::initializeNewModel()
   278 void GlxDetailsView::initializeNewModel()
   278     {
   279 {
   279     OstTrace0( TRACE_NORMAL, GLXDETAILSVIEW_INITIALIZENEWMODEL, "GlxDetailsView::initializeNewModel" );
   280     OstTrace0( TRACE_NORMAL, GLXDETAILSVIEW_INITIALIZENEWMODEL, "GlxDetailsView::initializeNewModel" );
   280 
   281     
   281     if (mModel)
   282     if (mModel) {
   282         {
   283         connect( mModel, SIGNAL(rowsRemoved(QModelIndex,int,int)), this, SLOT(rowsRemoved(QModelIndex,int,int)));
   283     connect(mModel, SIGNAL(rowsRemoved(QModelIndex,int,int)), this,
   284         connect( mModel, SIGNAL( updateDetailsView() ), this, SLOT( FillDetails() ));
   284             SLOT(rowsRemoved(QModelIndex,int,int)));
   285         connect( mModel, SIGNAL( destroyed() ), this, SLOT( modelDestroyed() ) );
   285         }
   286     }
   286     }
   287 }
   287 
   288 
   288 //--------------------------------------------------------------------------------------------------------------------------------------------
   289 //--------------------------------------------------------------------------------------------------------------------------------------------
   289 //clearCurrentModel
   290 //clearCurrentModel
   290 //--------------------------------------------------------------------------------------------------------------------------------------------
   291 //--------------------------------------------------------------------------------------------------------------------------------------------
   291 void GlxDetailsView::clearCurrentModel()
   292 void GlxDetailsView::clearCurrentModel()
   292     {
   293 {
   293     OstTrace0( TRACE_NORMAL, GLXDETAILSVIEW_CLEARCURRENTMODEL, "GlxDetailsView::clearCurrentModel" );
   294     OstTrace0( TRACE_NORMAL, GLXDETAILSVIEW_CLEARCURRENTMODEL, "GlxDetailsView::clearCurrentModel" );
   294 
   295 
   295     if (mModel)
   296     if (mModel) {
   296         {
   297         disconnect(mModel, SIGNAL(rowsRemoved(QModelIndex,int,int)), this, SLOT(rowsRemoved(QModelIndex,int,int)));
   297         disconnect(mModel, SIGNAL(rowsRemoved(QModelIndex,int,int)), this,
   298         disconnect(mModel, SIGNAL( updateDetailsView() ), this, SLOT( FillDetails() ));
   298                 SLOT(rowsRemoved(QModelIndex,int,int)));
   299         disconnect( mModel, SIGNAL( destroyed() ), this, SLOT( modelDestroyed() ) );
   299         mModel = NULL;
   300         mModel = NULL;
   300         }
   301     }
   301     }
   302 }
   302 
   303 
   303 //--------------------------------------------------------------------------------------------------------------------------------------------
   304 //--------------------------------------------------------------------------------------------------------------------------------------------
   304 //setConnections
   305 //setConnections
   305 //--------------------------------------------------------------------------------------------------------------------------------------------
   306 //--------------------------------------------------------------------------------------------------------------------------------------------
   306 void GlxDetailsView::setConnections()
   307 void GlxDetailsView::setConnections()
   307     {
   308 {
   308     connect(mWindow, SIGNAL(orientationChanged(Qt::Orientation)), this,
   309     connect(mWindow, SIGNAL(orientationChanged(Qt::Orientation)), this,
   309             SLOT(updateLayout(Qt::Orientation)));
   310             SLOT(updateLayout(Qt::Orientation)));
   310     
   311     
   311     
       
   312     if(getSubState() != IMAGEVIEWER_DETAIL_S) {    
   312     if(getSubState() != IMAGEVIEWER_DETAIL_S) {    
   313     connect(mFavIcon, SIGNAL(clicked()), this, SLOT(updateFavourites()));
   313     connect(mFavIcon, SIGNAL(updateFavourites()), this, SLOT(updateFavourites()));
   314     
   314     
   315     connect(mDescriptions, SIGNAL(labelPressed()), this,
   315     connect(mDescriptions, SIGNAL(labelPressed()), this,
   316             SLOT(UpdateDescription()));
   316             SLOT(UpdateDescription()));
   317     
   317     
   318     connect(mFavModel, SIGNAL( dataChanged(QModelIndex,QModelIndex) ),
   318     connect(mFavModel, SIGNAL( dataChanged(QModelIndex,QModelIndex) ),
   319                    this, SLOT( dataChanged(QModelIndex,QModelIndex) ));
   319                    this, SLOT( dataChanged(QModelIndex,QModelIndex) ));
   320     }
   320     }
   321     
   321 }
   322     connect(mModel, SIGNAL( updateDetailsView() ), this, SLOT( FillDetails() ));
       
   323     
       
   324         
       
   325     }
       
   326 
   322 
   327 //--------------------------------------------------------------------------------------------------------------------------------------------
   323 //--------------------------------------------------------------------------------------------------------------------------------------------
   328 //clearConnections
   324 //clearConnections
   329 //--------------------------------------------------------------------------------------------------------------------------------------------
   325 //--------------------------------------------------------------------------------------------------------------------------------------------
   330 void GlxDetailsView::clearConnections()
   326 void GlxDetailsView::clearConnections()
   331     {
   327 {
   332     
   328     
   333     qDebug("GlxDetailsView:: clearConnections");
   329     qDebug("GlxDetailsView:: clearConnections");
   334     disconnect(mWindow, SIGNAL(orientationChanged(Qt::Orientation)), this,
   330     disconnect(mWindow, SIGNAL(orientationChanged(Qt::Orientation)), this,
   335             SLOT(updateLayout(Qt::Orientation)));
   331             SLOT(updateLayout(Qt::Orientation)));
   336            
   332            
   337     if(mModel && getSubState() != IMAGEVIEWER_DETAIL_S) {
   333     if(mModel && getSubState() != IMAGEVIEWER_DETAIL_S) {
   338     disconnect(mFavIcon, SIGNAL(clicked()), this, SLOT(updateFavourites()));
   334     disconnect(mFavIcon, SIGNAL(updateFavourites()), this, SLOT(updateFavourites()));
   339     disconnect(mDescriptions, SIGNAL(labelPressed()), this,
   335     disconnect(mDescriptions, SIGNAL(labelPressed()), this,
   340             SLOT(UpdateDescription()));
   336             SLOT(UpdateDescription()));
   341     disconnect(mFavModel, SIGNAL( dataChanged(QModelIndex,QModelIndex) ),
   337     disconnect(mFavModel, SIGNAL( dataChanged(QModelIndex,QModelIndex) ),
   342                     this, SLOT( dataChanged(QModelIndex,QModelIndex) ));
   338                     this, SLOT( dataChanged(QModelIndex,QModelIndex) ));
   343     }
   339     }
   344     
   340 }
   345     disconnect(mModel, SIGNAL( updateDetailsView() ), this, SLOT( FillDetails() ));
       
   346     
       
   347     
       
   348     }
       
   349 
   341 
   350 //--------------------------------------------------------------------------------------------------------------------------------------------
   342 //--------------------------------------------------------------------------------------------------------------------------------------------
   351 //getAnimationItem
   343 //getAnimationItem
   352 //--------------------------------------------------------------------------------------------------------------------------------------------
   344 //--------------------------------------------------------------------------------------------------------------------------------------------
   353 QGraphicsItem * GlxDetailsView::getAnimationItem(GlxEffect transtionEffect)
   345 QGraphicsItem * GlxDetailsView::getAnimationItem(GlxEffect transtionEffect)
   382         }
   374         }
   383 
   375 
   384     //Load the Sections
   376     //Load the Sections
   385     mDocLoader->load(GLX_DETAILSVIEW_DOCMLPATH, section, &loaded);
   377     mDocLoader->load(GLX_DETAILSVIEW_DOCMLPATH, section, &loaded);
   386 
   378 
   387     //This is just to over come the bug in docloader,once that is fixed we can remove the 
   379     showImage();
       
   380 	//This is just to over come the bug in docloader,once that is fixed we can remove the 
   388     //below lines of code
   381     //below lines of code
   389      setImageName();
   382     FillDetails();
   390      setDate();
   383     
   391 
       
   392     GLX_LOG_INFO1("GlxDetailsView::updateLayout =%d\n",loaded);
   384     GLX_LOG_INFO1("GlxDetailsView::updateLayout =%d\n",loaded);
   393     }
   385     }
   394 
   386 
   395 //--------------------------------------------------------------------------------------------------------------------------------------------
   387 //--------------------------------------------------------------------------------------------------------------------------------------------
   396 //rowsRemoved
   388 //rowsRemoved
   412         {
   404         {
   413         return emit actionTriggered(EGlxCmdBack);
   405         return emit actionTriggered(EGlxCmdBack);
   414         }
   406         }
   415     }
   407     }
   416 
   408 
       
   409 void GlxDetailsView::modelDestroyed()
       
   410 {
       
   411     mModel = NULL;
       
   412 }
       
   413 
   417 //--------------------------------------------------------------------------------------------------------------------------------------------
   414 //--------------------------------------------------------------------------------------------------------------------------------------------
   418 //FillData
   415 //FillData
   419 //--------------------------------------------------------------------------------------------------------------------------------------------
   416 //--------------------------------------------------------------------------------------------------------------------------------------------
   420 void GlxDetailsView::FillDetails()
   417 void GlxDetailsView::FillDetails()
   421     {
   418     {
   440     }
   437     }
   441 //--------------------------------------------------------------------------------------------------------------------------------------------
   438 //--------------------------------------------------------------------------------------------------------------------------------------------
   442 //showImage
   439 //showImage
   443 //--------------------------------------------------------------------------------------------------------------------------------------------
   440 //--------------------------------------------------------------------------------------------------------------------------------------------
   444 void GlxDetailsView::showImage()
   441 void GlxDetailsView::showImage()
   445     {
   442  {
   446     OstTrace0( TRACE_NORMAL, GLXDETAILSVIEW_SHOWIMAGE, "GlxDetailsView::showImage" );
   443     OstTrace0( TRACE_NORMAL, GLXDETAILSVIEW_SHOWIMAGE, "GlxDetailsView::showImage" );
   447 
   444 
   448     QVariant variant = mModel->data(mModel->index(0, 0), GlxFocusIndexRole);
   445     QVariant variant = mModel->data(mModel->index(0, 0), GlxFocusIndexRole);
   449     if (variant.isValid() && variant.canConvert<int> ())
   446     if (variant.isValid() && variant.canConvert<int> ())
   450         {
   447         {
   451         mSelIndex = variant.value<int> ();
   448         mSelIndex = variant.value<int> ();
   452         }
   449         }
   453 
   450 
   454     variant = mModel->data(mModel->index(mSelIndex, 0), GlxFsImageRole);
   451     variant = mModel->data(mModel->index(mSelIndex, 0), GlxFsImageRole);
       
   452     
   455     if (variant.isValid() && variant.canConvert<HbIcon> ())
   453     if (variant.isValid() && variant.canConvert<HbIcon> ())
   456         {
   454         {
   457         QIcon itemIcon = variant.value<HbIcon> ().qicon();
   455          mDetailsIcon->setIcon(variant.value<HbIcon> ());
   458         QPixmap itemPixmap = itemIcon.pixmap(GLX_IMAGE_SIZE, GLX_IMAGE_SIZE);
   456         }
   459         QSize sz(GLX_IMAGE_SIZE, GLX_IMAGE_SIZE);
   457    }
   460         itemPixmap = itemPixmap.scaled(sz, Qt::IgnoreAspectRatio);
       
   461 
       
   462         HbIcon tmp = HbIcon(QIcon(itemPixmap));
       
   463         mDetailsIcon->setIcon(tmp);
       
   464         }
       
   465     }
       
   466 
   458 
   467 //--------------------------------------------------------------------------------------------------------------------------------------------
   459 //--------------------------------------------------------------------------------------------------------------------------------------------
   468 //setImageName
   460 //setImageName
   469 //--------------------------------------------------------------------------------------------------------------------------------------------
   461 //--------------------------------------------------------------------------------------------------------------------------------------------
   470 void GlxDetailsView::setImageName()
   462 void GlxDetailsView::setImageName()
   471     {
   463     {
   472     OstTraceFunctionEntry0( GLXDETAILSVIEW_SETIMAGENAME_ENTRY );
   464     OstTraceFunctionEntry0( GLXDETAILSVIEW_SETIMAGENAME_ENTRY );
   473     QString temp = "<u>";
       
   474     QString imagePath = (mModel->data(mModel->index(mModel->data(
   465     QString imagePath = (mModel->data(mModel->index(mModel->data(
   475             mModel->index(0, 0), GlxFocusIndexRole).value<int> (), 0),
   466             mModel->index(0, 0), GlxFocusIndexRole).value<int> (), 0),
   476             GlxUriRole)).value<QString> ();
   467             GlxUriRole)).value<QString> ();
   477     QString imageName = imagePath.section('\\', -1);
   468     QString imageName = imagePath.section('\\', -1);
   478     
   469     
   479     temp.append(imageName);
   470     mImageName->setItemText(imageName);    
   480     temp.append("</u>");
       
   481     mImageName->setItemText(temp);    
       
   482     OstTraceFunctionExit0( GLXDETAILSVIEW_SETIMAGENAME_EXIT );
   471     OstTraceFunctionExit0( GLXDETAILSVIEW_SETIMAGENAME_EXIT );
   483     }
   472     }
   484 
   473 
   485 //--------------------------------------------------------------------------------------------------------------------------------------------
   474 //--------------------------------------------------------------------------------------------------------------------------------------------
   486 //setImageName
   475 //setImageName
   487 //--------------------------------------------------------------------------------------------------------------------------------------------
   476 //--------------------------------------------------------------------------------------------------------------------------------------------
   488 void GlxDetailsView::setDesc()
   477 void GlxDetailsView::setDesc()
   489     {
   478     {
       
   479     
       
   480     //This is a hack , Initialize to some characters and then set the text
       
   481     //as of know if the description text is Null , we cant see the Description edit box
       
   482     //The issue has been informed to Application designer team.
       
   483     mDescriptions->setItemText("a");
   490     QString description = (mModel->data(mModel->index(mModel->data(
   484     QString description = (mModel->data(mModel->index(mModel->data(
   491             mModel->index(0, 0), GlxFocusIndexRole).value<int> (), 0),
   485             mModel->index(0, 0), GlxFocusIndexRole).value<int> (), 0),
   492             GlxDescRole)).value<QString> ();
   486             GlxDescRole)).value<QString> ();
   493     mDescriptions->setItemText(description);
   487      mDescriptions->setItemText(description);       
   494     }
   488     }
   495 
   489 
   496 //--------------------------------------------------------------------------------------------------------------------------------------------
   490 //--------------------------------------------------------------------------------------------------------------------------------------------
   497 //setDate
   491 //setDate
   498 //--------------------------------------------------------------------------------------------------------------------------------------------
   492 //--------------------------------------------------------------------------------------------------------------------------------------------
   564     QVariant variant = mFavModel->data(startIndex, GlxFavorites);
   558     QVariant variant = mFavModel->data(startIndex, GlxFavorites);
   565     if (variant.isValid() && variant.canConvert<bool> ())
   559     if (variant.isValid() && variant.canConvert<bool> ())
   566         {
   560         {
   567         if (variant.value<bool> ())
   561         if (variant.value<bool> ())
   568             {
   562             {
   569             mFavIcon->setIcon(HbIcon(GLXICON_ADD_TO_FAV));
   563             mFavIcon->setItemIcon(mFavIconEnabled);
   570             }
   564             }
   571         else
   565         else
   572             {
   566             {
   573             mFavIcon->setIcon(HbIcon(GLXICON_REMOVE_FAV));
   567             mFavIcon->setItemIcon(mFavIconDisabled);
   574             }
   568             }
   575         }
   569         }
   576     }
   570     }
   577 
   571 
   578 //--------------------------------------------------------------------------------------------------------------------------------------------
   572 //--------------------------------------------------------------------------------------------------------------------------------------------