|
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: VideoProxyModelGeneric implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 // Version : |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include <qstringlist.h> |
|
22 #include <qset.h> |
|
23 #include <qtimer.h> |
|
24 #include <qdatetime.h> |
|
25 #include <vcxmyvideosdefs.h> |
|
26 |
|
27 #include "videolistdatamodel.h" |
|
28 #include "videocollectioncommon.h" |
|
29 #include "videoproxymodelgeneric.h" |
|
30 |
|
31 const TMPXItemId INVALID_ID = TMPXItemId::InvalidId(); |
|
32 |
|
33 int VideoProxyModelGeneric::mOpenItemCallCount = 0; |
|
34 int VideoProxyModelGeneric::mGetOpenItemCallCount = 0; |
|
35 int VideoProxyModelGeneric::mLessThanCallCount = 0; |
|
36 int VideoProxyModelGeneric::mFilterAcceptsRowCallCount = 0; |
|
37 int VideoProxyModelGeneric::mConnectSignalsCallCount = 0; |
|
38 int VideoProxyModelGeneric::mDisconnectSignalsCallCount = 0; |
|
39 int VideoProxyModelGeneric::mProcessSortingCallCount = 0; |
|
40 int VideoProxyModelGeneric::mInvalidateFilterCallCount = 0; |
|
41 Qt::SortOrder VideoProxyModelGeneric::mLastSortedOrder = Qt::AscendingOrder; |
|
42 int VideoProxyModelGeneric::mLastSortRole = 0; |
|
43 bool VideoProxyModelGeneric::mConnectSignalsReturnValue = true; |
|
44 |
|
45 // ----------------------------------------------------------------------------- |
|
46 // VideoProxyModelGeneric::VideoProxyModelGeneric |
|
47 // ----------------------------------------------------------------------------- |
|
48 // |
|
49 VideoProxyModelGeneric::VideoProxyModelGeneric(QObject *parent) : |
|
50 mModel(0), |
|
51 mCollectionClient(0), |
|
52 mWantedSortOrder(Qt::AscendingOrder), |
|
53 mWantedSortRole(0), |
|
54 mDefaultSortRole(0) |
|
55 { |
|
56 Q_UNUSED(parent); |
|
57 } |
|
58 |
|
59 // ----------------------------------------------------------------------------- |
|
60 // VideoProxyModelGeneric::~VideoProxyModelGeneric |
|
61 // ----------------------------------------------------------------------------- |
|
62 // |
|
63 VideoProxyModelGeneric::~VideoProxyModelGeneric() |
|
64 { |
|
65 delete mModel; |
|
66 mModel = 0; |
|
67 } |
|
68 |
|
69 // ----------------------------------------------------------------------------- |
|
70 // VideoProxyModelGeneric::openItem |
|
71 // ----------------------------------------------------------------------------- |
|
72 // |
|
73 int VideoProxyModelGeneric::openItem(TMPXItemId mediaId) |
|
74 { |
|
75 Q_UNUSED(mediaId); |
|
76 mOpenItemCallCount++; |
|
77 return -1; |
|
78 } |
|
79 |
|
80 // ----------------------------------------------------------------------------- |
|
81 // VideoProxyModelGeneric::getOpenItem() |
|
82 // ----------------------------------------------------------------------------- |
|
83 // |
|
84 TMPXItemId VideoProxyModelGeneric::getOpenItem() const |
|
85 { |
|
86 mGetOpenItemCallCount++; |
|
87 TMPXItemId itemId = TMPXItemId::InvalidId(); |
|
88 return itemId; |
|
89 } |
|
90 |
|
91 // ----------------------------------------------------------------------------- |
|
92 // VideoProxyModelGeneric::lessThan |
|
93 // ----------------------------------------------------------------------------- |
|
94 // |
|
95 bool VideoProxyModelGeneric::lessThan(const QModelIndex &left, |
|
96 const QModelIndex &right) const |
|
97 { |
|
98 Q_UNUSED(left); |
|
99 Q_UNUSED(right); |
|
100 mLessThanCallCount++; |
|
101 return false; |
|
102 } |
|
103 |
|
104 // ----------------------------------------------------------------------------- |
|
105 // VideoProxyModelGeneric::filterAcceptsRow |
|
106 // ----------------------------------------------------------------------------- |
|
107 // |
|
108 bool VideoProxyModelGeneric::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const |
|
109 { |
|
110 Q_UNUSED(source_row); |
|
111 Q_UNUSED(source_parent); |
|
112 mFilterAcceptsRowCallCount++; |
|
113 return false; |
|
114 } |
|
115 |
|
116 // ----------------------------------------------------------------------------- |
|
117 // VideoProxyModelGeneric::connectSignals |
|
118 // ----------------------------------------------------------------------------- |
|
119 // |
|
120 bool VideoProxyModelGeneric::connectSignals() |
|
121 { |
|
122 mConnectSignalsCallCount++; |
|
123 return mConnectSignalsReturnValue; |
|
124 } |
|
125 |
|
126 // ----------------------------------------------------------------------------- |
|
127 // VideoProxyModelGeneric::disconnectSignals |
|
128 // ----------------------------------------------------------------------------- |
|
129 // |
|
130 void VideoProxyModelGeneric::disconnectSignals() |
|
131 { |
|
132 mDisconnectSignalsCallCount++; |
|
133 } |
|
134 |
|
135 // ----------------------------------------------------------------------------- |
|
136 // VideoProxyModelGeneric::processSorting |
|
137 // ----------------------------------------------------------------------------- |
|
138 // |
|
139 void VideoProxyModelGeneric::processSorting() |
|
140 { |
|
141 mProcessSortingCallCount++; |
|
142 } |
|
143 |
|
144 // ----------------------------------------------------------------------------- |
|
145 // VideoProxyModelGeneric::processSorting |
|
146 // ----------------------------------------------------------------------------- |
|
147 // |
|
148 const VideoListDataModel *VideoProxyModelGeneric::sourceModel() const |
|
149 { |
|
150 return mModel; |
|
151 } |
|
152 |
|
153 // ----------------------------------------------------------------------------- |
|
154 // VideoProxyModelGeneric::processSorting |
|
155 // ----------------------------------------------------------------------------- |
|
156 // |
|
157 void VideoProxyModelGeneric::invalidateFilter() |
|
158 { |
|
159 mInvalidateFilterCallCount++; |
|
160 } |
|
161 |
|
162 // ----------------------------------------------------------------------------- |
|
163 // VideoProxyModelGeneric::processSorting |
|
164 // ----------------------------------------------------------------------------- |
|
165 // |
|
166 void VideoProxyModelGeneric::sort(int column, Qt::SortOrder order) |
|
167 { |
|
168 Q_UNUSED(column); |
|
169 mLastSortedOrder = order; |
|
170 } |
|
171 |
|
172 // ----------------------------------------------------------------------------- |
|
173 // VideoProxyModelGeneric::processSorting |
|
174 // ----------------------------------------------------------------------------- |
|
175 // |
|
176 void VideoProxyModelGeneric::setSortRole(int sortRole) |
|
177 { |
|
178 mLastSortRole = sortRole; |
|
179 } |
|
180 |
|
181 // End of file |