34
|
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: video collection view plugin's ui utils class
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#include "videocollectionviewutils.h"
|
|
19 |
#include "videocollectionviewutilsdata.h"
|
|
20 |
|
|
21 |
int VideoCollectionViewUtilsData::mLastError = 0;
|
|
22 |
bool VideoCollectionViewUtilsData::mLoadSortingValuesFails = false;
|
|
23 |
bool VideoCollectionViewUtilsData::mGetServiceIconStringsFails = false;
|
|
24 |
int VideoCollectionViewUtilsData::mSortRole = 0;
|
|
25 |
Qt::SortOrder VideoCollectionViewUtilsData::mSortOrder = Qt::AscendingOrder;
|
|
26 |
QString VideoCollectionViewUtilsData::mIconString = "";
|
|
27 |
QString VideoCollectionViewUtilsData::mPressedString = "";
|
35
|
28 |
QVariant VideoCollectionViewUtilsData::mLastStatusAdditional = QVariant();
|
34
|
29 |
|
|
30 |
VideoCollectionViewUtils& VideoCollectionViewUtils::instance()
|
|
31 |
{
|
|
32 |
static VideoCollectionViewUtils _popupInstance;
|
|
33 |
return _popupInstance;
|
|
34 |
}
|
|
35 |
|
|
36 |
VideoCollectionViewUtils::VideoCollectionViewUtils():
|
|
37 |
mSortRole(-1),
|
|
38 |
mSortOrder(Qt::AscendingOrder)
|
|
39 |
{
|
|
40 |
// not stubbed
|
|
41 |
}
|
|
42 |
|
|
43 |
VideoCollectionViewUtils::~VideoCollectionViewUtils()
|
|
44 |
{
|
|
45 |
VideoCollectionViewUtilsData::reset();
|
|
46 |
}
|
|
47 |
|
|
48 |
int VideoCollectionViewUtils::saveSortingValues(int role, Qt::SortOrder order)
|
|
49 |
{
|
|
50 |
VideoCollectionViewUtilsData::mSortRole = role;
|
|
51 |
VideoCollectionViewUtilsData::mSortOrder = order;
|
|
52 |
return 0;
|
|
53 |
}
|
|
54 |
|
|
55 |
int VideoCollectionViewUtils::loadSortingValues(int &role, Qt::SortOrder &order)
|
|
56 |
{
|
|
57 |
if (VideoCollectionViewUtilsData::mLoadSortingValuesFails)
|
|
58 |
{
|
|
59 |
return -1;
|
|
60 |
}
|
|
61 |
|
|
62 |
role = VideoCollectionViewUtilsData::mSortRole;
|
|
63 |
order = VideoCollectionViewUtilsData::mSortOrder;
|
|
64 |
|
|
65 |
return 0;
|
|
66 |
}
|
|
67 |
|
|
68 |
int VideoCollectionViewUtils::getServiceIconStrings(QString& icon,
|
|
69 |
QString& iconPressed)
|
|
70 |
{
|
|
71 |
if (VideoCollectionViewUtilsData::mGetServiceIconStringsFails)
|
|
72 |
{
|
|
73 |
return -1;
|
|
74 |
}
|
|
75 |
|
|
76 |
icon = VideoCollectionViewUtilsData::mIconString;
|
|
77 |
iconPressed = VideoCollectionViewUtilsData::mPressedString;
|
|
78 |
|
|
79 |
return 0;
|
|
80 |
}
|
|
81 |
|
|
82 |
QString VideoCollectionViewUtils::getServiceUriString()
|
|
83 |
{
|
|
84 |
// not stubbed
|
|
85 |
return QString();
|
|
86 |
}
|
|
87 |
|
|
88 |
void VideoCollectionViewUtils::initListView(HbListView *view)
|
|
89 |
{
|
|
90 |
Q_UNUSED(view);
|
|
91 |
// not stubbed
|
|
92 |
}
|
|
93 |
|
|
94 |
void VideoCollectionViewUtils::sortModel(VideoSortFilterProxyModel *model,
|
|
95 |
bool async)
|
|
96 |
{
|
|
97 |
Q_UNUSED(model);
|
|
98 |
Q_UNUSED(async);
|
|
99 |
// not stubbed
|
|
100 |
}
|
|
101 |
|
|
102 |
void VideoCollectionViewUtils::showStatusMsgSlot(int statusCode, QVariant &additional)
|
|
103 |
{
|
35
|
104 |
VideoCollectionViewUtilsData::mLastStatusAdditional = additional;
|
34
|
105 |
VideoCollectionViewUtilsData::mLastError = statusCode;
|
|
106 |
}
|