58
|
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: VideoProxyModelAllVideos implementation
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
// Version :
|
|
19 |
|
|
20 |
// INCLUDE FILES
|
|
21 |
#include <vcxmyvideosdefs.h>
|
|
22 |
#include "videoproxymodelgeneric.h"
|
|
23 |
#include "videoproxymodelallvideos.h"
|
|
24 |
#include "videolistdatamodel.h"
|
|
25 |
#include "videocollectiontrace.h"
|
|
26 |
|
|
27 |
// -----------------------------------------------------------------------------
|
|
28 |
// VideoProxyModelAllVideos::VideoProxyModelGeneric
|
|
29 |
// -----------------------------------------------------------------------------
|
|
30 |
//
|
|
31 |
VideoProxyModelAllVideos::VideoProxyModelAllVideos(QObject *parent) :
|
|
32 |
VideoProxyModelGeneric(parent)
|
|
33 |
{
|
|
34 |
FUNC_LOG_ADDR(this);
|
|
35 |
}
|
|
36 |
|
|
37 |
// -----------------------------------------------------------------------------
|
|
38 |
// VideoProxyModelAllVideos::~VideoProxyModelAllVideos
|
|
39 |
// -----------------------------------------------------------------------------
|
|
40 |
//
|
|
41 |
VideoProxyModelAllVideos::~VideoProxyModelAllVideos()
|
|
42 |
{
|
|
43 |
FUNC_LOG_ADDR(this);
|
|
44 |
}
|
|
45 |
|
|
46 |
// -----------------------------------------------------------------------------
|
|
47 |
// VideoProxyModelAllVideos::filterAcceptsRow
|
|
48 |
// -----------------------------------------------------------------------------
|
|
49 |
//
|
|
50 |
bool VideoProxyModelAllVideos::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const
|
|
51 |
{
|
|
52 |
Q_UNUSED(source_parent);
|
|
53 |
|
|
54 |
if(!sourceModel())
|
|
55 |
{
|
|
56 |
return false;
|
|
57 |
}
|
|
58 |
|
|
59 |
if(source_row < 0 || source_row >= sourceModel()->rowCount())
|
|
60 |
{
|
|
61 |
return false;
|
|
62 |
}
|
|
63 |
|
|
64 |
TMPXItemId id = mModel->mediaIdAtIndex(source_row);
|
|
65 |
|
|
66 |
if(id.iId2 == KVcxMvcMediaTypeVideo)
|
|
67 |
{
|
|
68 |
return true;
|
|
69 |
}
|
|
70 |
|
|
71 |
return false;
|
|
72 |
}
|
|
73 |
|
|
74 |
// -----------------------------------------------------------------------------
|
|
75 |
// VideoProxyModelAllVideos::getOpenItem()
|
|
76 |
// -----------------------------------------------------------------------------
|
|
77 |
//
|
|
78 |
TMPXItemId VideoProxyModelAllVideos::getOpenItem() const
|
|
79 |
{
|
|
80 |
FUNC_LOG_ADDR(this);
|
|
81 |
TMPXItemId itemId = TMPXItemId::InvalidId();
|
|
82 |
|
|
83 |
if(mModel && mCollectionClient)
|
|
84 |
{
|
|
85 |
INFO_1("VideoProxyModelAllVideos::getOpenItem() [0x%x] all videos is open.", this);
|
|
86 |
itemId.iId1 = KVcxMvcCategoryIdAll;
|
|
87 |
itemId.iId2 = KVcxMvcMediaTypeCategory;
|
|
88 |
}
|
|
89 |
|
|
90 |
return itemId;
|
|
91 |
}
|
|
92 |
|
|
93 |
// End of file
|