30
|
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: VideoThumbnailData class implementation
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
37
|
18 |
// Version : %version: 26 %
|
36
|
19 |
|
30
|
20 |
// INCLUDE FILES
|
36
|
21 |
#include "videocollectiontrace.h"
|
30
|
22 |
#include "videothumbnaildata.h"
|
|
23 |
#include "videothumbnaildata_p.h"
|
|
24 |
|
|
25 |
// ================= MEMBER FUNCTIONS =======================
|
|
26 |
//
|
|
27 |
|
|
28 |
// -----------------------------------------------------------------------------
|
|
29 |
// VideoThumbnailData::VideoThumbnailData()
|
|
30 |
// -----------------------------------------------------------------------------
|
|
31 |
//
|
|
32 |
VideoThumbnailData &VideoThumbnailData::instance()
|
|
33 |
{
|
36
|
34 |
FUNC_LOG;
|
30
|
35 |
static VideoThumbnailData _thumbnailData;
|
|
36 |
return _thumbnailData;
|
|
37 |
}
|
|
38 |
|
|
39 |
// -----------------------------------------------------------------------------
|
|
40 |
// VideoThumbnailData::VideoThumbnailData()
|
|
41 |
// -----------------------------------------------------------------------------
|
|
42 |
//
|
|
43 |
VideoThumbnailData::VideoThumbnailData() :
|
|
44 |
d_ptr(new VideoThumbnailDataPrivate())
|
|
45 |
{
|
36
|
46 |
FUNC_LOG;
|
30
|
47 |
connect(d_ptr, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)),
|
|
48 |
this, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
|
|
49 |
}
|
|
50 |
|
|
51 |
// -----------------------------------------------------------------------------
|
|
52 |
// VideoThumbnailData::~VideoThumbnailData()
|
|
53 |
// -----------------------------------------------------------------------------
|
|
54 |
//
|
|
55 |
VideoThumbnailData::~VideoThumbnailData()
|
|
56 |
{
|
36
|
57 |
FUNC_LOG;
|
30
|
58 |
disconnect(d_ptr, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)),
|
|
59 |
this, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
|
|
60 |
delete d_ptr;
|
|
61 |
}
|
|
62 |
|
|
63 |
// -----------------------------------------------------------------------------
|
|
64 |
// VideoThumbnailData::removeThumbnail()
|
|
65 |
// -----------------------------------------------------------------------------
|
|
66 |
//
|
|
67 |
bool VideoThumbnailData::removeThumbnail(TMPXItemId mediaId)
|
|
68 |
{
|
37
|
69 |
INFO_2("VideoThumbnailData::removeThumbnail() mediaId (%d, %d)", mediaId.iId1, mediaId.iId2);
|
30
|
70 |
return d_ptr->removeThumbnail(mediaId);
|
|
71 |
}
|
|
72 |
|
|
73 |
// -----------------------------------------------------------------------------
|
|
74 |
// VideoThumbnailData::getThumbnail()
|
|
75 |
// -----------------------------------------------------------------------------
|
|
76 |
//
|
|
77 |
const QIcon* VideoThumbnailData::getThumbnail(TMPXItemId mediaId)
|
|
78 |
{
|
37
|
79 |
INFO_2("VideoThumbnailData::getThumbnail() mediaId (%d, %d)", mediaId.iId1, mediaId.iId2);
|
30
|
80 |
return d_ptr->getThumbnail(mediaId);
|
|
81 |
}
|
|
82 |
|
|
83 |
// -----------------------------------------------------------------------------
|
|
84 |
// VideoThumbnailData::startBackgroundFetching()
|
|
85 |
// -----------------------------------------------------------------------------
|
|
86 |
//
|
34
|
87 |
void VideoThumbnailData::startBackgroundFetching(VideoSortFilterProxyModel *model, int fetchIndex)
|
30
|
88 |
{
|
37
|
89 |
INFO_2("VideoThumbnailData::startBackgroundFetching() model: 0x%x, fetchIndex: %d", model, fetchIndex);
|
34
|
90 |
d_ptr->startBackgroundFetching(model, fetchIndex);
|
30
|
91 |
}
|
|
92 |
|
|
93 |
// -----------------------------------------------------------------------------
|
|
94 |
// VideoThumbnailData::enableBackgroundFetching()
|
|
95 |
// -----------------------------------------------------------------------------
|
|
96 |
//
|
|
97 |
void VideoThumbnailData::enableBackgroundFetching(bool enable)
|
|
98 |
{
|
37
|
99 |
INFO_1("VideoThumbnailData::enableBackgroundFetching() enable: %d", enable);
|
30
|
100 |
d_ptr->enableBackgroundFetching(enable);
|
|
101 |
}
|
|
102 |
|
|
103 |
// -----------------------------------------------------------------------------
|
34
|
104 |
// VideoThumbnailData::enableThumbnailCreation()
|
|
105 |
// -----------------------------------------------------------------------------
|
|
106 |
//
|
|
107 |
void VideoThumbnailData::enableThumbnailCreation(bool enable)
|
|
108 |
{
|
37
|
109 |
INFO_1("VideoThumbnailData::enableThumbnailCreation() enable: %d", enable);
|
34
|
110 |
d_ptr->enableThumbnailCreation(enable);
|
|
111 |
}
|
|
112 |
|
|
113 |
// -----------------------------------------------------------------------------
|
30
|
114 |
// VideoThumbnailData::freeThumbnailData()
|
|
115 |
// -----------------------------------------------------------------------------
|
|
116 |
//
|
|
117 |
void VideoThumbnailData::freeThumbnailData()
|
|
118 |
{
|
36
|
119 |
FUNC_LOG;
|
30
|
120 |
d_ptr->freeThumbnailData();
|
|
121 |
}
|
|
122 |
|
|
123 |
// End of file
|