47
|
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: MpMpxCollectionData stub for testing MpCollectionDataModel
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#include "mptrace.h"
|
|
19 |
#include "stub/inc/mpmpxcollectiondata.h"
|
|
20 |
|
|
21 |
/*!
|
|
22 |
Stub function.
|
|
23 |
*/
|
|
24 |
MpMpxCollectionData::MpMpxCollectionData( QObject *parent )
|
|
25 |
: QObject(parent),
|
|
26 |
mContext(ECollectionContextUnknown),
|
|
27 |
mCount(0),
|
|
28 |
mItemDataReturn(true)
|
|
29 |
{
|
|
30 |
}
|
|
31 |
|
|
32 |
/*!
|
|
33 |
Stub function.
|
|
34 |
*/
|
|
35 |
MpMpxCollectionData::~MpMpxCollectionData()
|
|
36 |
{
|
|
37 |
}
|
|
38 |
|
|
39 |
/*!
|
|
40 |
Stub function.
|
|
41 |
*/
|
|
42 |
TCollectionContext MpMpxCollectionData::context() const
|
|
43 |
{
|
|
44 |
return mContext;
|
|
45 |
}
|
|
46 |
|
|
47 |
/*!
|
|
48 |
Stub function.
|
|
49 |
*/
|
|
50 |
int MpMpxCollectionData::count() const
|
|
51 |
{
|
|
52 |
return mCount;
|
|
53 |
}
|
|
54 |
|
|
55 |
/*!
|
|
56 |
Stub function.
|
|
57 |
*/
|
|
58 |
QString MpMpxCollectionData::itemData( int index, MpMpxCollectionData::DataType type ) const
|
|
59 |
{
|
|
60 |
if ( index < 0 || index > mCount ) {
|
|
61 |
TX_LOG_ARGS("index=" << index);
|
|
62 |
qFatal("MpMpxCollectionData::itemData called with index out of range");
|
|
63 |
}
|
|
64 |
QString data;
|
|
65 |
if ( !mItemDataReturn && (type != MpMpxCollectionData::Count) ) {
|
|
66 |
return data;
|
|
67 |
}
|
|
68 |
switch ( type ) {
|
|
69 |
case MpMpxCollectionData::Title:
|
|
70 |
data = QString("Title");
|
|
71 |
break;
|
|
72 |
case MpMpxCollectionData::Artist:
|
|
73 |
data = QString("Artist");
|
|
74 |
break;
|
|
75 |
case MpMpxCollectionData::Count:
|
|
76 |
data = QString("Count");
|
|
77 |
break;
|
|
78 |
case MpMpxCollectionData::AlbumArtUri:
|
|
79 |
data = QString("AlbumArtUri");
|
|
80 |
break;
|
|
81 |
default:
|
|
82 |
qFatal("MpMpxCollectionData::itemData called with unknown type");
|
|
83 |
break;
|
|
84 |
}
|
|
85 |
return data;
|
|
86 |
}
|