videocollection/tsrc/stubs/src/videocollectionwrapper.cpp
changeset 36 8aed59de29f9
parent 34 bbb98528c666
child 58 d2b028fd1f7d
equal deleted inserted replaced
35:3738fe97f027 36:8aed59de29f9
    39 VideoCollectionWrapper::~VideoCollectionWrapper()
    39 VideoCollectionWrapper::~VideoCollectionWrapper()
    40 {
    40 {
    41     VideoCollectionWrapperData::reset();
    41     VideoCollectionWrapperData::reset();
    42 }
    42 }
    43 
    43 
    44 VideoSortFilterProxyModel* VideoCollectionWrapper::getModel(int type)
    44 VideoSortFilterProxyModel* VideoCollectionWrapper::getModel(VideoCollectionCommon::TModelType type)
    45 {
    45 {
    46     VideoSortFilterProxyModel *model = 0;
    46     VideoSortFilterProxyModel *model = 0;
    47     if (!VideoCollectionWrapperData::mGetModelFails)
    47     if (!VideoCollectionWrapperData::mGetModelFails)
    48     {
    48     {
    49         VideoListDataModel *sourceModel = VideoCollectionWrapperData::mSourceModel;
    49         VideoListDataModel *sourceModel = VideoCollectionWrapperData::mSourceModel;
    57             }
    57             }
    58         }
    58         }
    59         
    59         
    60         switch (type)
    60         switch (type)
    61         {
    61         {
    62             case EAllVideos:
    62             case VideoCollectionCommon::EModelTypeAllVideos:
    63             {
    63             {
    64                 model = VideoCollectionWrapperData::mAllVideosModel;
    64                 model = VideoCollectionWrapperData::mAllVideosModel;
    65                 if (!model)
    65                 if (!model)
    66                 {
    66                 {
    67                     model = new VideoSortFilterProxyModel(type);
    67                     model = new VideoSortFilterProxyModel(type);
    71                         VideoCollectionWrapperData::mAllVideosModel = model;
    71                         VideoCollectionWrapperData::mAllVideosModel = model;
    72                     }
    72                     }
    73                 }
    73                 }
    74                 break;
    74                 break;
    75             }
    75             }
    76             case ECollections:
    76             case VideoCollectionCommon::EModelTypeCollections:
    77             {
    77             {
    78                 model = VideoCollectionWrapperData::mCollectionsModel;
    78                 model = VideoCollectionWrapperData::mCollectionsModel;
    79                 if (!model)
    79                 if (!model)
    80                 {
    80                 {
    81                     model = new VideoSortFilterProxyModel(type);
    81                     model = new VideoSortFilterProxyModel(type);
    85                         VideoCollectionWrapperData::mCollectionsModel = model;
    85                         VideoCollectionWrapperData::mCollectionsModel = model;
    86                     }
    86                     }
    87                 }
    87                 }
    88                 break;
    88                 break;
    89             }
    89             }
    90             case ECollectionContent:
    90             case VideoCollectionCommon::EModelTypeCollectionContent:
    91             {
    91             {
    92                 model = VideoCollectionWrapperData::mCollectionContentModel;
    92                 model = VideoCollectionWrapperData::mCollectionContentModel;
    93                 if (!model)
    93                 if (!model)
    94                 {
    94                 {
    95                     model = new VideoSortFilterProxyModel(type);
    95                     model = new VideoSortFilterProxyModel(type);
    99                         VideoCollectionWrapperData::mCollectionContentModel = model;
    99                         VideoCollectionWrapperData::mCollectionContentModel = model;
   100                     }
   100                     }
   101                 }
   101                 }
   102                 break;
   102                 break;
   103             }
   103             }
   104             case EGeneric:
   104             case VideoCollectionCommon::EModelTypeGeneric:
   105             {
   105             {
   106                 model = VideoCollectionWrapperData::mGenericModel;
   106                 model = VideoCollectionWrapperData::mGenericModel;
   107                 if (!model)
   107                 if (!model)
   108                 {
   108                 {
   109                     model = new VideoSortFilterProxyModel(type);
   109                     model = new VideoSortFilterProxyModel(type);