ui/views/detailsview/src/glxdetailsviewmodelwrapper.cpp
changeset 71 27f2d7aec52a
parent 62 36d93b4dc635
equal deleted inserted replaced
69:45459746d5e8 71:27f2d7aec52a
    20 #include <QModelIndex>
    20 #include <QModelIndex>
    21 #include <qdatetime.h>
    21 #include <qdatetime.h>
    22 #include <hbparameterlengthlimiter.h>
    22 #include <hbparameterlengthlimiter.h>
    23 
    23 
    24 //User Includes
    24 //User Includes
       
    25 #include "glxviewids.h"
    25 #include "glxmodelroles.h"  //Contains the declaration of the roles used to retrieve the data from model
    26 #include "glxmodelroles.h"  //Contains the declaration of the roles used to retrieve the data from model
    26 #include "glxlocalisationstrings.h" //contains the localisation strings
    27 #include "glxlocalisationstrings.h" //contains the localisation strings
    27 #include "glxdetailsviewmodelwrapper.h" //contains the declaration of this file/class
    28 #include "glxdetailsviewmodelwrapper.h" //contains the declaration of this file/class
    28 //Constants
    29 //Constants
    29 const int KBytesInKB = 1024;
    30 const int KBytesInKB = 1024;
    52 //rowCount
    53 //rowCount
    53 //--------------------------------------------------------------------------------------------------------------------------------------------
    54 //--------------------------------------------------------------------------------------------------------------------------------------------
    54 int GlxDetailsViewModelWrapper::rowCount(const QModelIndex &parent) const
    55 int GlxDetailsViewModelWrapper::rowCount(const QModelIndex &parent) const
    55 {
    56 {
    56     Q_UNUSED(parent);
    57     Q_UNUSED(parent);
    57     return TOTAL_NO_FIELDS_LIST;
    58     int substate = 0;
       
    59 
       
    60     if (mModel) {
       
    61         QVariant variant = mModel->data(mModel->index(0, 0), GlxSubStateRole);
       
    62 
       
    63         if (variant.isValid() && variant.canConvert<int> ()) {
       
    64             substate = variant.value<int> ();
       
    65         }
       
    66     }
       
    67     //If photos app, then show the Description field, from imageviewer app - hide description field
       
    68     return (substate != IMAGEVIEWER_DETAIL_S)?TOTAL_NO_FIELDS_LIST:(TOTAL_NO_FIELDS_LIST - 1);
    58 }
    69 }
    59 
    70 
    60 //--------------------------------------------------------------------------------------------------------------------------------------------
    71 //--------------------------------------------------------------------------------------------------------------------------------------------
    61 //columnCount
    72 //columnCount
    62 //--------------------------------------------------------------------------------------------------------------------------------------------
    73 //--------------------------------------------------------------------------------------------------------------------------------------------