videocollection/videocollectionwrapper/tsrc/testvideoproxymodelcollections/stub/src/videolistdatamodel.cpp
changeset 62 0e1e938beb1a
equal deleted inserted replaced
59:a76e86df7ccd 62:0e1e938beb1a
       
     1 /**
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: Stub model to be used when unit testing the proxy model. 
       
    15 * 
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDES
       
    20 #include "videolistdatamodel.h"
       
    21 
       
    22 QList<TMPXItemId> VideoListDataModel::mMediaIdAtIndexReturnValues;
       
    23 int VideoListDataModel::mMediaIdAtIndexCallCount = 0;
       
    24 int VideoListDataModel::mRowCountReturnValue = 0;
       
    25 
       
    26 // ---------------------------------------------------------------------------
       
    27 // VideoListDataModel
       
    28 // ---------------------------------------------------------------------------
       
    29 //
       
    30 VideoListDataModel::VideoListDataModel(QObject *parent)
       
    31 {
       
    32     Q_UNUSED(parent);
       
    33 }
       
    34 
       
    35 // ---------------------------------------------------------------------------
       
    36 // ~VideoListDataModel
       
    37 // ---------------------------------------------------------------------------
       
    38 //
       
    39 VideoListDataModel::~VideoListDataModel()
       
    40 {
       
    41 
       
    42 }
       
    43 
       
    44 // ---------------------------------------------------------------------------
       
    45 // mediaIdAtIndex
       
    46 // ---------------------------------------------------------------------------
       
    47 //
       
    48 TMPXItemId VideoListDataModel::mediaIdAtIndex(int index)
       
    49 {
       
    50     Q_UNUSED(index);
       
    51     mMediaIdAtIndexCallCount++;
       
    52     if(!mMediaIdAtIndexReturnValues.isEmpty())
       
    53     {
       
    54         return mMediaIdAtIndexReturnValues.takeFirst();
       
    55     }
       
    56     TMPXItemId::InvalidId();
       
    57 }
       
    58 
       
    59 // ---------------------------------------------------------------------------
       
    60 // rowCount
       
    61 // ---------------------------------------------------------------------------
       
    62 //
       
    63 const int VideoListDataModel::rowCount() const
       
    64 {
       
    65     return mRowCountReturnValue;
       
    66 }
       
    67 
       
    68 
       
    69 // End of file
       
    70     
       
    71 
       
    72