videocollection/videocollectionwrapper/src/videothumbnaildata_p.cpp
author hgs
Thu, 08 Jul 2010 13:05:19 +0300
changeset 44 518105d52e45
parent 38 ff53afa8ad05
child 50 21fe8338c6bf
permissions -rw-r--r--
201027
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
30
hgs
parents:
diff changeset
     1
/*
hgs
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
hgs
parents:
diff changeset
     3
* All rights reserved.
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     8
*
hgs
parents:
diff changeset
     9
* Initial Contributors:
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    11
*
hgs
parents:
diff changeset
    12
* Contributors:
hgs
parents:
diff changeset
    13
*
hgs
parents:
diff changeset
    14
* Description:  VideoThumbnailDataPrivate class implementation
hgs
parents:
diff changeset
    15
*
hgs
parents:
diff changeset
    16
*/
hgs
parents:
diff changeset
    17
44
hgs
parents: 38
diff changeset
    18
// Version : %version: 24.1.1 %
36
hgs
parents: 35
diff changeset
    19
30
hgs
parents:
diff changeset
    20
// INCLUDE FILES
34
hgs
parents: 30
diff changeset
    21
#include <qapplication.h>
hgs
parents: 30
diff changeset
    22
#include <qpixmap.h>
hgs
parents: 30
diff changeset
    23
#include <qtimer.h>
38
hgs
parents: 37
diff changeset
    24
#include <qpainter.h>
30
hgs
parents:
diff changeset
    25
#include <mpxmediageneraldefs.h>
35
hgs
parents: 34
diff changeset
    26
#include <hbicon.h>
hgs
parents: 34
diff changeset
    27
34
hgs
parents: 30
diff changeset
    28
#include <vcxmyvideosdefs.h>
36
hgs
parents: 35
diff changeset
    29
#include <videocollectioncommon.h>
30
hgs
parents:
diff changeset
    30
hgs
parents:
diff changeset
    31
#include "videothumbnaildata_p.h"
hgs
parents:
diff changeset
    32
#include "videocollectionwrapper.h"
hgs
parents:
diff changeset
    33
#include "videosortfilterproxymodel.h"
34
hgs
parents: 30
diff changeset
    34
#include "videothumbnailfetcher.h"
36
hgs
parents: 35
diff changeset
    35
#include "videocollectiontrace.h"
30
hgs
parents:
diff changeset
    36
hgs
parents:
diff changeset
    37
// Maximum thumbnails kept in memory.
hgs
parents:
diff changeset
    38
const int THUMBNAIL_CACHE_SIZE = 60;
hgs
parents:
diff changeset
    39
// Maximum of thumbnail fetches done at one background fetch round.
hgs
parents:
diff changeset
    40
const int THUMBNAIL_BACKGROUND_FETCH_AMOUNT = 20;
hgs
parents:
diff changeset
    41
// Milliseconds for the background fetch timer.
hgs
parents:
diff changeset
    42
const int THUMBNAIL_BACKGROUND_TIMEOUT = 100;
hgs
parents:
diff changeset
    43
// Milliseconds while thumbnail ready events are gathered before they 
hgs
parents:
diff changeset
    44
// are signaled.
hgs
parents:
diff changeset
    45
const int THUMBNAIL_READY_SIGNAL_TIMEOUT = 50;
hgs
parents:
diff changeset
    46
// Priority for background thumbnail fetches.
hgs
parents:
diff changeset
    47
const int BACKGROUND_FETCH_PRIORITY = 3000;
hgs
parents:
diff changeset
    48
38
hgs
parents: 37
diff changeset
    49
// Size for default thumbnail, these match with large thumbnail in lists. 
hgs
parents: 37
diff changeset
    50
const int DEFAULT_THUMBNAIL_WIDTH = 114;
hgs
parents: 37
diff changeset
    51
const int DEFAULT_THUMBNAIL_HEIGHT = 64;
hgs
parents: 37
diff changeset
    52
30
hgs
parents:
diff changeset
    53
/**
hgs
parents:
diff changeset
    54
 * global qHash function required fo creating hash values for TMPXItemId -keys
hgs
parents:
diff changeset
    55
 */
hgs
parents:
diff changeset
    56
inline uint qHash(TMPXItemId key) 
38
hgs
parents: 37
diff changeset
    57
{
hgs
parents: 37
diff changeset
    58
    QPair<uint, uint> keyPair(key.iId1, key.iId2);
30
hgs
parents:
diff changeset
    59
hgs
parents:
diff changeset
    60
    return qHash(keyPair);
hgs
parents:
diff changeset
    61
}
hgs
parents:
diff changeset
    62
hgs
parents:
diff changeset
    63
// ================= MEMBER FUNCTIONS =======================
hgs
parents:
diff changeset
    64
//
hgs
parents:
diff changeset
    65
hgs
parents:
diff changeset
    66
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    67
// VideoThumbnailDataPrivate::VideoThumbnailDataPrivate()
hgs
parents:
diff changeset
    68
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    69
//
36
hgs
parents: 35
diff changeset
    70
VideoThumbnailDataPrivate::VideoThumbnailDataPrivate() 
hgs
parents: 35
diff changeset
    71
    : mThumbnailFetcher( 0 )
hgs
parents: 35
diff changeset
    72
    , mCurrentModel( 0 )
hgs
parents: 35
diff changeset
    73
    , mCurrentFetchIndex( 0 )
hgs
parents: 35
diff changeset
    74
    , mCurrentBackgroundFetchCount( 0 )
hgs
parents: 35
diff changeset
    75
    , mBgFetchTimer( 0 )
hgs
parents: 35
diff changeset
    76
    , mTbnReportTimer( 0 )
hgs
parents: 35
diff changeset
    77
    , mSignalsConnected( false )
hgs
parents: 35
diff changeset
    78
    , mBackgroundFetchingEnabled( true )
30
hgs
parents:
diff changeset
    79
{
36
hgs
parents: 35
diff changeset
    80
	FUNC_LOG;
37
hgs
parents: 36
diff changeset
    81
	initialize();
30
hgs
parents:
diff changeset
    82
}
hgs
parents:
diff changeset
    83
hgs
parents:
diff changeset
    84
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    85
// VideoThumbnailDataPrivate::~VideoThumbnailDataPrivate()
hgs
parents:
diff changeset
    86
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    87
//
hgs
parents:
diff changeset
    88
VideoThumbnailDataPrivate::~VideoThumbnailDataPrivate()
hgs
parents:
diff changeset
    89
{
36
hgs
parents: 35
diff changeset
    90
	FUNC_LOG;
30
hgs
parents:
diff changeset
    91
    cleanup();
hgs
parents:
diff changeset
    92
}
hgs
parents:
diff changeset
    93
hgs
parents:
diff changeset
    94
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    95
// VideoThumbnailDataPrivate::initialize()
hgs
parents:
diff changeset
    96
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    97
//
hgs
parents:
diff changeset
    98
int VideoThumbnailDataPrivate::initialize()
hgs
parents:
diff changeset
    99
{
36
hgs
parents: 35
diff changeset
   100
	FUNC_LOG;
30
hgs
parents:
diff changeset
   101
    mThumbnailData.setMaxCost(THUMBNAIL_CACHE_SIZE);
hgs
parents:
diff changeset
   102
    
34
hgs
parents: 30
diff changeset
   103
    if(!mThumbnailFetcher)
30
hgs
parents:
diff changeset
   104
    {
34
hgs
parents: 30
diff changeset
   105
        mThumbnailFetcher = new VideoThumbnailFetcher();        
30
hgs
parents:
diff changeset
   106
    }
hgs
parents:
diff changeset
   107
hgs
parents:
diff changeset
   108
    if(!mBgFetchTimer)
hgs
parents:
diff changeset
   109
    {
hgs
parents:
diff changeset
   110
        mBgFetchTimer = new QTimer();
hgs
parents:
diff changeset
   111
    }
hgs
parents:
diff changeset
   112
    
hgs
parents:
diff changeset
   113
    if(!mTbnReportTimer)
hgs
parents:
diff changeset
   114
    {
hgs
parents:
diff changeset
   115
        mTbnReportTimer = new QTimer();
hgs
parents:
diff changeset
   116
    }
hgs
parents:
diff changeset
   117
hgs
parents:
diff changeset
   118
    if(connectSignals() < 0)
hgs
parents:
diff changeset
   119
    {
36
hgs
parents: 35
diff changeset
   120
        ERROR(-1, "VideoThumbnailDataPrivate::initialize() failed to connect signals.");
30
hgs
parents:
diff changeset
   121
        cleanup();
hgs
parents:
diff changeset
   122
        return -1;
hgs
parents:
diff changeset
   123
    }
37
hgs
parents: 36
diff changeset
   124
30
hgs
parents:
diff changeset
   125
    return 0;
hgs
parents:
diff changeset
   126
}
hgs
parents:
diff changeset
   127
hgs
parents:
diff changeset
   128
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   129
// VideoThumbnailDataPrivate::cleanup()
hgs
parents:
diff changeset
   130
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   131
//
hgs
parents:
diff changeset
   132
void VideoThumbnailDataPrivate::cleanup()
hgs
parents:
diff changeset
   133
{
36
hgs
parents: 35
diff changeset
   134
	FUNC_LOG;
30
hgs
parents:
diff changeset
   135
    disconnectSignals();
hgs
parents:
diff changeset
   136
34
hgs
parents: 30
diff changeset
   137
    delete mThumbnailFetcher;
hgs
parents: 30
diff changeset
   138
    mThumbnailFetcher = 0;
hgs
parents: 30
diff changeset
   139
    
30
hgs
parents:
diff changeset
   140
    freeThumbnailData();
hgs
parents:
diff changeset
   141
    
hgs
parents:
diff changeset
   142
    if(mTbnReportTimer)
hgs
parents:
diff changeset
   143
    {
hgs
parents:
diff changeset
   144
        mTbnReportTimer->stop();
hgs
parents:
diff changeset
   145
        delete mTbnReportTimer;
hgs
parents:
diff changeset
   146
        mTbnReportTimer = 0;
hgs
parents:
diff changeset
   147
    }
hgs
parents:
diff changeset
   148
    
hgs
parents:
diff changeset
   149
    if(mBgFetchTimer)
hgs
parents:
diff changeset
   150
    {
hgs
parents:
diff changeset
   151
        mBgFetchTimer->stop();
hgs
parents:
diff changeset
   152
        delete mBgFetchTimer;
hgs
parents:
diff changeset
   153
        mBgFetchTimer = 0;
hgs
parents:
diff changeset
   154
    }
hgs
parents:
diff changeset
   155
}
hgs
parents:
diff changeset
   156
hgs
parents:
diff changeset
   157
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   158
// VideoThumbnailDataPrivate::disconnectSignals()
hgs
parents:
diff changeset
   159
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   160
//
hgs
parents:
diff changeset
   161
void VideoThumbnailDataPrivate::disconnectSignals()
hgs
parents:
diff changeset
   162
{
36
hgs
parents: 35
diff changeset
   163
	FUNC_LOG;
30
hgs
parents:
diff changeset
   164
    if(mSignalsConnected)
hgs
parents:
diff changeset
   165
    {
37
hgs
parents: 36
diff changeset
   166
		disconnect(mThumbnailFetcher, SIGNAL(thumbnailReady(QPixmap , const TMPXItemId &, int )),
hgs
parents: 36
diff changeset
   167
                    this, SLOT(thumbnailReadySlot(QPixmap , const TMPXItemId &, int )));
34
hgs
parents: 30
diff changeset
   168
        disconnect(mThumbnailFetcher, SIGNAL(allThumbnailsFetched()),
hgs
parents: 30
diff changeset
   169
                 this, SLOT(allThumbnailsFetchedSlot()));          
30
hgs
parents:
diff changeset
   170
        disconnect(mBgFetchTimer, SIGNAL(timeout()), this, SLOT(doBackgroundFetching()));
hgs
parents:
diff changeset
   171
        disconnect(mTbnReportTimer, SIGNAL(timeout()), this, SLOT(reportThumbnailsReadySlot()));
hgs
parents:
diff changeset
   172
    }
hgs
parents:
diff changeset
   173
    mSignalsConnected = false;
hgs
parents:
diff changeset
   174
}
hgs
parents:
diff changeset
   175
hgs
parents:
diff changeset
   176
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   177
// VideoThumbnailDataPrivate::connectSignals()
hgs
parents:
diff changeset
   178
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   179
//
hgs
parents:
diff changeset
   180
int VideoThumbnailDataPrivate::connectSignals()
hgs
parents:
diff changeset
   181
{
36
hgs
parents: 35
diff changeset
   182
	FUNC_LOG;
30
hgs
parents:
diff changeset
   183
    if(!mSignalsConnected)
hgs
parents:
diff changeset
   184
    {
34
hgs
parents: 30
diff changeset
   185
        VideoSortFilterProxyModel *model = 
36
hgs
parents: 35
diff changeset
   186
                VideoCollectionWrapper::instance().getModel(VideoCollectionCommon::EModelTypeAllVideos);
34
hgs
parents: 30
diff changeset
   187
        if(!model)
hgs
parents: 30
diff changeset
   188
            return -1;
37
hgs
parents: 36
diff changeset
   189
        if(!connect(mThumbnailFetcher, SIGNAL(thumbnailReady( QPixmap , const TMPXItemId &, int )),
hgs
parents: 36
diff changeset
   190
                    this, SLOT(thumbnailReadySlot( QPixmap , const TMPXItemId &, int))) ||
34
hgs
parents: 30
diff changeset
   191
            !connect(mThumbnailFetcher, SIGNAL(allThumbnailsFetched()),
hgs
parents: 30
diff changeset
   192
                     this, SLOT(allThumbnailsFetchedSlot())) ||
30
hgs
parents:
diff changeset
   193
           !connect(mBgFetchTimer, SIGNAL(timeout()), this, SLOT(doBackgroundFetching())) ||
hgs
parents:
diff changeset
   194
           !connect(mTbnReportTimer, SIGNAL(timeout()), this, SLOT(reportThumbnailsReadySlot())))
hgs
parents:
diff changeset
   195
        {
hgs
parents:
diff changeset
   196
            return -1;
hgs
parents:
diff changeset
   197
        }
hgs
parents:
diff changeset
   198
        
hgs
parents:
diff changeset
   199
        QApplication *app = qApp;
hgs
parents:
diff changeset
   200
        if(!connect(app, SIGNAL(aboutToQuit()), this, SLOT(aboutToQuitSlot())))
hgs
parents:
diff changeset
   201
        {
hgs
parents:
diff changeset
   202
            return -1;
hgs
parents:
diff changeset
   203
        }
hgs
parents:
diff changeset
   204
        
hgs
parents:
diff changeset
   205
        mSignalsConnected = true;
hgs
parents:
diff changeset
   206
    }
hgs
parents:
diff changeset
   207
    return 0;
hgs
parents:
diff changeset
   208
}
hgs
parents:
diff changeset
   209
hgs
parents:
diff changeset
   210
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   211
// VideoThumbnailDataPrivate::getThumbnail()
hgs
parents:
diff changeset
   212
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   213
//
hgs
parents:
diff changeset
   214
const QIcon* VideoThumbnailDataPrivate::getThumbnail(TMPXItemId mediaId)
hgs
parents:
diff changeset
   215
{
hgs
parents:
diff changeset
   216
    const QIcon *thumbnail = mThumbnailData[mediaId];
hgs
parents:
diff changeset
   217
    if(!thumbnail)
hgs
parents:
diff changeset
   218
    {
hgs
parents:
diff changeset
   219
        return defaultThumbnail(mediaId);
hgs
parents:
diff changeset
   220
    }
hgs
parents:
diff changeset
   221
    return thumbnail;
hgs
parents:
diff changeset
   222
}
hgs
parents:
diff changeset
   223
hgs
parents:
diff changeset
   224
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   225
// VideoThumbnailDataPrivate::startFetchingThumbnails()
hgs
parents:
diff changeset
   226
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   227
//
hgs
parents:
diff changeset
   228
int VideoThumbnailDataPrivate::startFetchingThumbnails(const QList<QModelIndex> &indexes, int priority)
hgs
parents:
diff changeset
   229
{
36
hgs
parents: 35
diff changeset
   230
	FUNC_LOG;
34
hgs
parents: 30
diff changeset
   231
    if(!mCurrentModel || !mThumbnailFetcher)
30
hgs
parents:
diff changeset
   232
    {
hgs
parents:
diff changeset
   233
        return -1;
hgs
parents:
diff changeset
   234
    }
hgs
parents:
diff changeset
   235
    if(indexes.count() == 0)
hgs
parents:
diff changeset
   236
    {
hgs
parents:
diff changeset
   237
        return 0;
hgs
parents:
diff changeset
   238
    }
hgs
parents:
diff changeset
   239
    
34
hgs
parents: 30
diff changeset
   240
    mThumbnailFetcher->pauseFetching();
hgs
parents: 30
diff changeset
   241
hgs
parents: 30
diff changeset
   242
    int fetchCountBefore = mThumbnailFetcher->fetchCount();
30
hgs
parents:
diff changeset
   243
    
34
hgs
parents: 30
diff changeset
   244
    // Fetch the thumbnails
30
hgs
parents:
diff changeset
   245
    for(int i = 0; i < indexes.count(); i++)
hgs
parents:
diff changeset
   246
    {
34
hgs
parents: 30
diff changeset
   247
        startFetchingThumbnail(mCurrentModel->getMediaIdAtIndex(indexes[i]), priority--);
30
hgs
parents:
diff changeset
   248
    }
hgs
parents:
diff changeset
   249
    
34
hgs
parents: 30
diff changeset
   250
    int started = mThumbnailFetcher->fetchCount() - fetchCountBefore;
hgs
parents: 30
diff changeset
   251
    
37
hgs
parents: 36
diff changeset
   252
	// Start the fetches and cancel previous ones.
hgs
parents: 36
diff changeset
   253
    mThumbnailFetcher->continueFetching(true);
34
hgs
parents: 30
diff changeset
   254
    
hgs
parents: 30
diff changeset
   255
    return started;
30
hgs
parents:
diff changeset
   256
}
hgs
parents:
diff changeset
   257
hgs
parents:
diff changeset
   258
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   259
// VideoThumbnailDataPrivate::startFetchingThumbnail()
hgs
parents:
diff changeset
   260
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   261
//
hgs
parents:
diff changeset
   262
int VideoThumbnailDataPrivate::startFetchingThumbnail(TMPXItemId mediaId, int priority)
hgs
parents:
diff changeset
   263
{
34
hgs
parents: 30
diff changeset
   264
    if(!mCurrentModel || !mThumbnailFetcher)
30
hgs
parents:
diff changeset
   265
    {
hgs
parents:
diff changeset
   266
        return -1;
hgs
parents:
diff changeset
   267
    }
hgs
parents:
diff changeset
   268
hgs
parents:
diff changeset
   269
    // Check that it's not fetched before.
hgs
parents:
diff changeset
   270
    if(mThumbnailData.contains(mediaId))
hgs
parents:
diff changeset
   271
    {
hgs
parents:
diff changeset
   272
        return 0;
hgs
parents:
diff changeset
   273
    }
hgs
parents:
diff changeset
   274
34
hgs
parents: 30
diff changeset
   275
    QString fileName = mCurrentModel->getMediaFilePathForId(mediaId);
hgs
parents: 30
diff changeset
   276
    
hgs
parents: 30
diff changeset
   277
    // Thumbnail fetcher signals into thumbnailReadySlot when thumbnail ready
30
hgs
parents:
diff changeset
   278
    if(fileName.length() > 0)
hgs
parents:
diff changeset
   279
    {
37
hgs
parents: 36
diff changeset
   280
        mThumbnailFetcher->addFetch(fileName, mediaId, priority);
30
hgs
parents:
diff changeset
   281
    }
hgs
parents:
diff changeset
   282
34
hgs
parents: 30
diff changeset
   283
    return 0;
30
hgs
parents:
diff changeset
   284
}
hgs
parents:
diff changeset
   285
hgs
parents:
diff changeset
   286
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   287
// VideoThumbnailDataPrivate::doBackgroundFetching()
hgs
parents:
diff changeset
   288
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   289
//
hgs
parents:
diff changeset
   290
void VideoThumbnailDataPrivate::doBackgroundFetching()
hgs
parents:
diff changeset
   291
{
36
hgs
parents: 35
diff changeset
   292
	FUNC_LOG;
44
hgs
parents: 38
diff changeset
   293
	INFO_1("VideoThumbnailDataPrivate::doBackgroundFetching() bg fetch count: %d", mCurrentBackgroundFetchCount);
hgs
parents: 38
diff changeset
   294
	
34
hgs
parents: 30
diff changeset
   295
    if(!mCurrentModel || !mThumbnailFetcher)
30
hgs
parents:
diff changeset
   296
    {
hgs
parents:
diff changeset
   297
        return;
hgs
parents:
diff changeset
   298
    }
44
hgs
parents: 38
diff changeset
   299
    
30
hgs
parents:
diff changeset
   300
    if(mCurrentBackgroundFetchCount >= THUMBNAIL_CACHE_SIZE)
hgs
parents:
diff changeset
   301
    {
hgs
parents:
diff changeset
   302
        return;
hgs
parents:
diff changeset
   303
    }
hgs
parents:
diff changeset
   304
    
34
hgs
parents: 30
diff changeset
   305
    int maxIndex = mCurrentModel->rowCount();
30
hgs
parents:
diff changeset
   306
    if(maxIndex == 0)
hgs
parents:
diff changeset
   307
    {
hgs
parents:
diff changeset
   308
        return;
hgs
parents:
diff changeset
   309
    }
hgs
parents:
diff changeset
   310
hgs
parents:
diff changeset
   311
    // Delta to UI index where fetch has been done already.  
hgs
parents:
diff changeset
   312
    int currentDelta = mCurrentBackgroundFetchCount/2;
hgs
parents:
diff changeset
   313
    
hgs
parents:
diff changeset
   314
    // How many will be fetched.  
hgs
parents:
diff changeset
   315
    const int fetchAmount = THUMBNAIL_BACKGROUND_FETCH_AMOUNT/2;
hgs
parents:
diff changeset
   316
hgs
parents:
diff changeset
   317
    QList<QModelIndex> indexes;
hgs
parents:
diff changeset
   318
34
hgs
parents: 30
diff changeset
   319
    // Items after the current fetch index.
hgs
parents: 30
diff changeset
   320
    int startIndex = mCurrentFetchIndex+currentDelta;
hgs
parents: 30
diff changeset
   321
    int endIndex = mCurrentFetchIndex+currentDelta+fetchAmount;
30
hgs
parents:
diff changeset
   322
    getModelIndexes(indexes, startIndex, endIndex);
hgs
parents:
diff changeset
   323
34
hgs
parents: 30
diff changeset
   324
    // Items before the current fetch index.
hgs
parents: 30
diff changeset
   325
    startIndex = mCurrentFetchIndex-currentDelta-fetchAmount;
hgs
parents: 30
diff changeset
   326
    endIndex = mCurrentFetchIndex-currentDelta;
30
hgs
parents:
diff changeset
   327
    getModelIndexes(indexes, startIndex, endIndex);
34
hgs
parents: 30
diff changeset
   328
    
30
hgs
parents:
diff changeset
   329
    mCurrentBackgroundFetchCount += THUMBNAIL_BACKGROUND_FETCH_AMOUNT;
hgs
parents:
diff changeset
   330
hgs
parents:
diff changeset
   331
    int fetchesStarted = startFetchingThumbnails(indexes, BACKGROUND_FETCH_PRIORITY);
hgs
parents:
diff changeset
   332
    
hgs
parents:
diff changeset
   333
    // No thumbnails to fetch, start again.
hgs
parents:
diff changeset
   334
    if(fetchesStarted == 0)
hgs
parents:
diff changeset
   335
    {
hgs
parents:
diff changeset
   336
        continueBackgroundFetch();
hgs
parents:
diff changeset
   337
    }
hgs
parents:
diff changeset
   338
}
hgs
parents:
diff changeset
   339
hgs
parents:
diff changeset
   340
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   341
// VideoThumbnailDataPrivate::getModelIndexes()
hgs
parents:
diff changeset
   342
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   343
//
hgs
parents:
diff changeset
   344
void VideoThumbnailDataPrivate::getModelIndexes(QList<QModelIndex> &indexes, int startIndex, int endIndex)
hgs
parents:
diff changeset
   345
{
36
hgs
parents: 35
diff changeset
   346
	FUNC_LOG;
44
hgs
parents: 38
diff changeset
   347
    INFO_2("VideoThumbnailDataPrivate::getModelIndexes() from %d to %d", startIndex, endIndex);
hgs
parents: 38
diff changeset
   348
	
30
hgs
parents:
diff changeset
   349
    QModelIndex index;
hgs
parents:
diff changeset
   350
    for(int i = startIndex; i < endIndex; i++)
hgs
parents:
diff changeset
   351
    {
hgs
parents:
diff changeset
   352
        if(i >= 0)
hgs
parents:
diff changeset
   353
        {
34
hgs
parents: 30
diff changeset
   354
            index = mCurrentModel->index(i, 0);
30
hgs
parents:
diff changeset
   355
            if(index.isValid())
hgs
parents:
diff changeset
   356
            {
hgs
parents:
diff changeset
   357
                indexes.append(index);
hgs
parents:
diff changeset
   358
            }
hgs
parents:
diff changeset
   359
        }
hgs
parents:
diff changeset
   360
    }
hgs
parents:
diff changeset
   361
}
hgs
parents:
diff changeset
   362
hgs
parents:
diff changeset
   363
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   364
// VideoThumbnailDataPrivate::thumbnailReadySlot()
hgs
parents:
diff changeset
   365
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   366
//
37
hgs
parents: 36
diff changeset
   367
void VideoThumbnailDataPrivate::thumbnailReadySlot(QPixmap tnData, const TMPXItemId &mediaId, int error)
30
hgs
parents:
diff changeset
   368
{
hgs
parents:
diff changeset
   369
    if(!error && !tnData.isNull())
hgs
parents:
diff changeset
   370
    {
hgs
parents:
diff changeset
   371
        mThumbnailData.insert(mediaId, new QIcon(tnData));
hgs
parents:
diff changeset
   372
        
hgs
parents:
diff changeset
   373
        // Gather list of media ids and emit thumbnailReady signals in larger set
hgs
parents:
diff changeset
   374
        // when timer goes off.
hgs
parents:
diff changeset
   375
        if(mTbnReportTimer && !mTbnReportTimer->isActive())
hgs
parents:
diff changeset
   376
        {
hgs
parents:
diff changeset
   377
            mTbnReportTimer->setSingleShot(true);
hgs
parents:
diff changeset
   378
            mTbnReportTimer->start(THUMBNAIL_READY_SIGNAL_TIMEOUT);
hgs
parents:
diff changeset
   379
        }
hgs
parents:
diff changeset
   380
hgs
parents:
diff changeset
   381
        // Save the media id for the signal.  
hgs
parents:
diff changeset
   382
        mReadyThumbnailMediaIds.append(mediaId);
hgs
parents:
diff changeset
   383
    }
hgs
parents:
diff changeset
   384
}
hgs
parents:
diff changeset
   385
hgs
parents:
diff changeset
   386
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   387
// VideoThumbnailDataPrivate::reportThumbnailsReadySlot()
hgs
parents:
diff changeset
   388
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   389
//
hgs
parents:
diff changeset
   390
void VideoThumbnailDataPrivate::reportThumbnailsReadySlot()
hgs
parents:
diff changeset
   391
{
36
hgs
parents: 35
diff changeset
   392
	FUNC_LOG;
30
hgs
parents:
diff changeset
   393
    emit thumbnailsFetched(mReadyThumbnailMediaIds);
hgs
parents:
diff changeset
   394
    mReadyThumbnailMediaIds.clear();
hgs
parents:
diff changeset
   395
}
hgs
parents:
diff changeset
   396
hgs
parents:
diff changeset
   397
// -----------------------------------------------------------------------------
34
hgs
parents: 30
diff changeset
   398
// VideoThumbnailDataPrivate::allThumbnailsFetchedSlot()
30
hgs
parents:
diff changeset
   399
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   400
//
34
hgs
parents: 30
diff changeset
   401
void VideoThumbnailDataPrivate::allThumbnailsFetchedSlot()
30
hgs
parents:
diff changeset
   402
{
36
hgs
parents: 35
diff changeset
   403
	FUNC_LOG;
34
hgs
parents: 30
diff changeset
   404
    continueBackgroundFetch();
30
hgs
parents:
diff changeset
   405
}
hgs
parents:
diff changeset
   406
hgs
parents:
diff changeset
   407
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   408
// VideoThumbnailDataPrivate::defaultThumbnail()
hgs
parents:
diff changeset
   409
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   410
//
hgs
parents:
diff changeset
   411
const QIcon* VideoThumbnailDataPrivate::defaultThumbnail(TMPXItemId mediaId)
hgs
parents:
diff changeset
   412
{
35
hgs
parents: 34
diff changeset
   413
    const TMPXItemId defaultIdVideo(KMaxTUint32-1, KVcxMvcMediaTypeVideo);
hgs
parents: 34
diff changeset
   414
    const TMPXItemId defaultIdAlbum(KMaxTUint32-1, KVcxMvcMediaTypeAlbum);
hgs
parents: 34
diff changeset
   415
    const TMPXItemId defaultIdDownloads(KVcxMvcCategoryIdDownloads, KVcxMvcMediaTypeCategory);
hgs
parents: 34
diff changeset
   416
    const TMPXItemId defaultIdCaptured(KVcxMvcCategoryIdCaptured, KVcxMvcMediaTypeCategory);
hgs
parents: 34
diff changeset
   417
hgs
parents: 34
diff changeset
   418
    // Default thumbnail for video
34
hgs
parents: 30
diff changeset
   419
    if(mediaId.iId2 == KVcxMvcMediaTypeVideo) 
30
hgs
parents:
diff changeset
   420
    {
35
hgs
parents: 34
diff changeset
   421
        if(!mDefaultThumbnails.contains(defaultIdVideo))
hgs
parents: 34
diff changeset
   422
        {
38
hgs
parents: 37
diff changeset
   423
            mDefaultThumbnails[defaultIdVideo] = loadIcon("qtg_large_video");
35
hgs
parents: 34
diff changeset
   424
        }
hgs
parents: 34
diff changeset
   425
        return &mDefaultThumbnails[defaultIdVideo].qicon();
30
hgs
parents:
diff changeset
   426
    }
hgs
parents:
diff changeset
   427
    else
hgs
parents:
diff changeset
   428
    {
35
hgs
parents: 34
diff changeset
   429
        // Default thumbnail for user defined album.
hgs
parents: 34
diff changeset
   430
        if(mediaId.iId2 == KVcxMvcMediaTypeAlbum)
hgs
parents: 34
diff changeset
   431
        {
hgs
parents: 34
diff changeset
   432
            if(!mDefaultThumbnails.contains(defaultIdAlbum))
hgs
parents: 34
diff changeset
   433
            {
38
hgs
parents: 37
diff changeset
   434
                mDefaultThumbnails[defaultIdAlbum] = loadIcon("qtg_large_video_collection");
35
hgs
parents: 34
diff changeset
   435
            }
hgs
parents: 34
diff changeset
   436
            return &mDefaultThumbnails[defaultIdAlbum].qicon();
hgs
parents: 34
diff changeset
   437
        }
hgs
parents: 34
diff changeset
   438
hgs
parents: 34
diff changeset
   439
        // Thumbnails for default collections.
hgs
parents: 34
diff changeset
   440
        switch(mediaId.iId1)
hgs
parents: 34
diff changeset
   441
        {
hgs
parents: 34
diff changeset
   442
            case KVcxMvcCategoryIdDownloads:
hgs
parents: 34
diff changeset
   443
            {
hgs
parents: 34
diff changeset
   444
                if(!mDefaultThumbnails.contains(defaultIdDownloads))
hgs
parents: 34
diff changeset
   445
                {
38
hgs
parents: 37
diff changeset
   446
                    mDefaultThumbnails[defaultIdDownloads] = loadIcon("qtg_large_video_download");
35
hgs
parents: 34
diff changeset
   447
                }
hgs
parents: 34
diff changeset
   448
                return &mDefaultThumbnails[defaultIdDownloads].qicon();
hgs
parents: 34
diff changeset
   449
            }
hgs
parents: 34
diff changeset
   450
            
hgs
parents: 34
diff changeset
   451
            case KVcxMvcCategoryIdCaptured:
hgs
parents: 34
diff changeset
   452
            {
hgs
parents: 34
diff changeset
   453
                if(!mDefaultThumbnails.contains(defaultIdCaptured))
hgs
parents: 34
diff changeset
   454
                {
38
hgs
parents: 37
diff changeset
   455
                    mDefaultThumbnails[defaultIdCaptured] = loadIcon("qtg_large_video_capture");
35
hgs
parents: 34
diff changeset
   456
                }
hgs
parents: 34
diff changeset
   457
                return &mDefaultThumbnails[defaultIdCaptured].qicon();
hgs
parents: 34
diff changeset
   458
            }
hgs
parents: 34
diff changeset
   459
hgs
parents: 34
diff changeset
   460
            default:
hgs
parents: 34
diff changeset
   461
            {
hgs
parents: 34
diff changeset
   462
                if(!mDefaultThumbnails.contains(defaultIdAlbum))
hgs
parents: 34
diff changeset
   463
                {
38
hgs
parents: 37
diff changeset
   464
                    mDefaultThumbnails[defaultIdAlbum] = loadIcon("qtg_large_video_collection");
35
hgs
parents: 34
diff changeset
   465
                }
hgs
parents: 34
diff changeset
   466
                return &mDefaultThumbnails[defaultIdAlbum].qicon();
hgs
parents: 34
diff changeset
   467
            }
hgs
parents: 34
diff changeset
   468
        }
30
hgs
parents:
diff changeset
   469
    }
hgs
parents:
diff changeset
   470
}
hgs
parents:
diff changeset
   471
hgs
parents:
diff changeset
   472
// -----------------------------------------------------------------------------
38
hgs
parents: 37
diff changeset
   473
// VideoThumbnailDataPrivate::loadIcon()
hgs
parents: 37
diff changeset
   474
// -----------------------------------------------------------------------------
hgs
parents: 37
diff changeset
   475
//
hgs
parents: 37
diff changeset
   476
HbIcon VideoThumbnailDataPrivate::loadIcon(QString iconName)
hgs
parents: 37
diff changeset
   477
{
hgs
parents: 37
diff changeset
   478
    HbIcon icon(iconName);
hgs
parents: 37
diff changeset
   479
    
hgs
parents: 37
diff changeset
   480
    if(!icon.isNull())
hgs
parents: 37
diff changeset
   481
    {
hgs
parents: 37
diff changeset
   482
        QPixmap dest = QPixmap(DEFAULT_THUMBNAIL_WIDTH, DEFAULT_THUMBNAIL_HEIGHT);
hgs
parents: 37
diff changeset
   483
hgs
parents: 37
diff changeset
   484
        // Scale the icon into the thumbnail area.
hgs
parents: 37
diff changeset
   485
        QPixmap source = icon.pixmap();
hgs
parents: 37
diff changeset
   486
        // Smooth scaling is very expensive (size^2). Therefore we reduce the size
hgs
parents: 37
diff changeset
   487
        // to 2x of the destination size and using fast transformation before doing final smooth scaling.
hgs
parents: 37
diff changeset
   488
        if(source.size().width() > (6*dest.width()) || source.size().height() > (6*dest.height()))
hgs
parents: 37
diff changeset
   489
        {
hgs
parents: 37
diff changeset
   490
            QSize intermediate_size = QSize( dest.width() * 2, dest.height() * 2 );
hgs
parents: 37
diff changeset
   491
            source = source.scaled(intermediate_size, Qt::KeepAspectRatio, Qt::FastTransformation );
hgs
parents: 37
diff changeset
   492
        }
hgs
parents: 37
diff changeset
   493
        QPixmap scaled = source.scaled(dest.size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
hgs
parents: 37
diff changeset
   494
hgs
parents: 37
diff changeset
   495
        // Center the icon.
hgs
parents: 37
diff changeset
   496
        int xDiff = 0;
hgs
parents: 37
diff changeset
   497
        int yDiff = 0;
hgs
parents: 37
diff changeset
   498
        if(dest.width() > scaled.width())
hgs
parents: 37
diff changeset
   499
        {
hgs
parents: 37
diff changeset
   500
            xDiff = (dest.width() - scaled.width()) / 2;
hgs
parents: 37
diff changeset
   501
        }
hgs
parents: 37
diff changeset
   502
        if(dest.height() > scaled.height())
hgs
parents: 37
diff changeset
   503
        {
hgs
parents: 37
diff changeset
   504
            yDiff = (dest.height() - scaled.height()) / 2;
hgs
parents: 37
diff changeset
   505
        }
hgs
parents: 37
diff changeset
   506
        
hgs
parents: 37
diff changeset
   507
        // Paint it.
hgs
parents: 37
diff changeset
   508
        QPainter painter(&dest);
hgs
parents: 37
diff changeset
   509
        painter.setCompositionMode(QPainter::CompositionMode_Source);
hgs
parents: 37
diff changeset
   510
        painter.fillRect(dest.rect(), Qt::transparent);
hgs
parents: 37
diff changeset
   511
        painter.drawPixmap(xDiff, yDiff, scaled.width(), scaled.height(), scaled);
hgs
parents: 37
diff changeset
   512
        painter.end();
hgs
parents: 37
diff changeset
   513
        
hgs
parents: 37
diff changeset
   514
        return HbIcon(dest);
hgs
parents: 37
diff changeset
   515
    }
hgs
parents: 37
diff changeset
   516
    else
hgs
parents: 37
diff changeset
   517
    {
hgs
parents: 37
diff changeset
   518
        return HbIcon();
hgs
parents: 37
diff changeset
   519
    }
hgs
parents: 37
diff changeset
   520
}
hgs
parents: 37
diff changeset
   521
hgs
parents: 37
diff changeset
   522
// -----------------------------------------------------------------------------
30
hgs
parents:
diff changeset
   523
// VideoThumbnailDataPrivate::removeThumbnail()
hgs
parents:
diff changeset
   524
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   525
//
hgs
parents:
diff changeset
   526
bool VideoThumbnailDataPrivate::removeThumbnail(TMPXItemId mediaId)
hgs
parents:
diff changeset
   527
{
36
hgs
parents: 35
diff changeset
   528
	FUNC_LOG;
30
hgs
parents:
diff changeset
   529
    return mThumbnailData.remove(mediaId);
hgs
parents:
diff changeset
   530
}
hgs
parents:
diff changeset
   531
hgs
parents:
diff changeset
   532
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   533
// VideoThumbnailDataPrivate::enableBackgroundFetching()
hgs
parents:
diff changeset
   534
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   535
//
hgs
parents:
diff changeset
   536
void VideoThumbnailDataPrivate::enableBackgroundFetching(bool enable)
hgs
parents:
diff changeset
   537
{
36
hgs
parents: 35
diff changeset
   538
	FUNC_LOG;
hgs
parents: 35
diff changeset
   539
    INFO_1("VideoThumbnailDataPrivate::enableBackgroundFetching() enable: %d", enable);
30
hgs
parents:
diff changeset
   540
    mBackgroundFetchingEnabled = enable;
34
hgs
parents: 30
diff changeset
   541
    startBackgroundFetching(mCurrentModel, 0);
hgs
parents: 30
diff changeset
   542
}
hgs
parents: 30
diff changeset
   543
hgs
parents: 30
diff changeset
   544
// -----------------------------------------------------------------------------
hgs
parents: 30
diff changeset
   545
// VideoThumbnailDataPrivate::enableThumbnailCreation()
hgs
parents: 30
diff changeset
   546
// -----------------------------------------------------------------------------
hgs
parents: 30
diff changeset
   547
//
hgs
parents: 30
diff changeset
   548
void VideoThumbnailDataPrivate::enableThumbnailCreation(bool enable)
hgs
parents: 30
diff changeset
   549
{
36
hgs
parents: 35
diff changeset
   550
	FUNC_LOG;
hgs
parents: 35
diff changeset
   551
	INFO_1("VideoThumbnailDataPrivate::enableThumbnailCreation() enable: %d", enable);
34
hgs
parents: 30
diff changeset
   552
    if(mThumbnailFetcher)
36
hgs
parents: 35
diff changeset
   553
    {
34
hgs
parents: 30
diff changeset
   554
        mThumbnailFetcher->enableThumbnailCreation(enable);
36
hgs
parents: 35
diff changeset
   555
    }
30
hgs
parents:
diff changeset
   556
}
hgs
parents:
diff changeset
   557
hgs
parents:
diff changeset
   558
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   559
// VideoThumbnailDataPrivate::freeThumbnailData()
hgs
parents:
diff changeset
   560
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   561
//
hgs
parents:
diff changeset
   562
void VideoThumbnailDataPrivate::freeThumbnailData()
hgs
parents:
diff changeset
   563
{
36
hgs
parents: 35
diff changeset
   564
	FUNC_LOG;
30
hgs
parents:
diff changeset
   565
    // Stop timers.
37
hgs
parents: 36
diff changeset
   566
	if(mBgFetchTimer)
36
hgs
parents: 35
diff changeset
   567
    {
30
hgs
parents:
diff changeset
   568
        mBgFetchTimer->stop();
36
hgs
parents: 35
diff changeset
   569
    }
30
hgs
parents:
diff changeset
   570
    
hgs
parents:
diff changeset
   571
    if(mTbnReportTimer)
36
hgs
parents: 35
diff changeset
   572
    {
30
hgs
parents:
diff changeset
   573
        mTbnReportTimer->stop();
36
hgs
parents: 35
diff changeset
   574
    }
30
hgs
parents:
diff changeset
   575
34
hgs
parents: 30
diff changeset
   576
    if(mThumbnailFetcher)
36
hgs
parents: 35
diff changeset
   577
    {
34
hgs
parents: 30
diff changeset
   578
        mThumbnailFetcher->cancelFetches();
36
hgs
parents: 35
diff changeset
   579
    }
34
hgs
parents: 30
diff changeset
   580
    
30
hgs
parents:
diff changeset
   581
    // Clear data.
hgs
parents:
diff changeset
   582
    mReadyThumbnailMediaIds.clear();
hgs
parents:
diff changeset
   583
    mThumbnailData.clear();
35
hgs
parents: 34
diff changeset
   584
    mDefaultThumbnails.clear();
30
hgs
parents:
diff changeset
   585
}
hgs
parents:
diff changeset
   586
hgs
parents:
diff changeset
   587
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   588
// VideoThumbnailDataPrivate::startBackgroundFetching()
hgs
parents:
diff changeset
   589
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   590
//
34
hgs
parents: 30
diff changeset
   591
void VideoThumbnailDataPrivate::startBackgroundFetching(VideoSortFilterProxyModel *model, int fetchIndex)
30
hgs
parents:
diff changeset
   592
{
36
hgs
parents: 35
diff changeset
   593
	FUNC_LOG;
37
hgs
parents: 36
diff changeset
   594
hgs
parents: 36
diff changeset
   595
    // If model is null, we continue using the current one. Model and index are kept up to date even
hgs
parents: 36
diff changeset
   596
	// fetching is not enabled.
34
hgs
parents: 30
diff changeset
   597
    if(model)
36
hgs
parents: 35
diff changeset
   598
    {
34
hgs
parents: 30
diff changeset
   599
        mCurrentModel = model;
36
hgs
parents: 35
diff changeset
   600
    }
34
hgs
parents: 30
diff changeset
   601
    
30
hgs
parents:
diff changeset
   602
    mCurrentFetchIndex = fetchIndex;
hgs
parents:
diff changeset
   603
    mCurrentBackgroundFetchCount = 0;
37
hgs
parents: 36
diff changeset
   604
	
hgs
parents: 36
diff changeset
   605
	if(!mBackgroundFetchingEnabled || !mThumbnailFetcher)
hgs
parents: 36
diff changeset
   606
    {
hgs
parents: 36
diff changeset
   607
        INFO("VideoThumbnailDataPrivate::startBackgroundFetching() fetching is disabled.");
hgs
parents: 36
diff changeset
   608
        return;
hgs
parents: 36
diff changeset
   609
    }
44
hgs
parents: 38
diff changeset
   610
hgs
parents: 38
diff changeset
   611
    if(mBgFetchTimer)
hgs
parents: 38
diff changeset
   612
    {
hgs
parents: 38
diff changeset
   613
        mBgFetchTimer->stop();
hgs
parents: 38
diff changeset
   614
    }
hgs
parents: 38
diff changeset
   615
	
30
hgs
parents:
diff changeset
   616
    doBackgroundFetching();
hgs
parents:
diff changeset
   617
}
hgs
parents:
diff changeset
   618
hgs
parents:
diff changeset
   619
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   620
// VideoThumbnailDataPrivate::continueBackgroundFetch()
hgs
parents:
diff changeset
   621
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   622
//
hgs
parents:
diff changeset
   623
void VideoThumbnailDataPrivate::continueBackgroundFetch()
hgs
parents:
diff changeset
   624
{
36
hgs
parents: 35
diff changeset
   625
	FUNC_LOG;
30
hgs
parents:
diff changeset
   626
    if(!mBackgroundFetchingEnabled)
36
hgs
parents: 35
diff changeset
   627
    {
37
hgs
parents: 36
diff changeset
   628
        INFO("VideoThumbnailDataPrivate::continueBackgroundFetch() fetching is disabled.")
30
hgs
parents:
diff changeset
   629
        return;
36
hgs
parents: 35
diff changeset
   630
    }
30
hgs
parents:
diff changeset
   631
hgs
parents:
diff changeset
   632
    if(mBgFetchTimer)
hgs
parents:
diff changeset
   633
    {
hgs
parents:
diff changeset
   634
        mBgFetchTimer->stop();
hgs
parents:
diff changeset
   635
        mBgFetchTimer->setSingleShot(true);
hgs
parents:
diff changeset
   636
        mBgFetchTimer->start(THUMBNAIL_BACKGROUND_TIMEOUT);
hgs
parents:
diff changeset
   637
    }
hgs
parents:
diff changeset
   638
}
hgs
parents:
diff changeset
   639
hgs
parents:
diff changeset
   640
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   641
// VideoThumbnailDataPrivate::aboutToQuitSlot()
hgs
parents:
diff changeset
   642
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   643
//
hgs
parents:
diff changeset
   644
void VideoThumbnailDataPrivate::aboutToQuitSlot()
hgs
parents:
diff changeset
   645
{
36
hgs
parents: 35
diff changeset
   646
	FUNC_LOG;
30
hgs
parents:
diff changeset
   647
    cleanup();
hgs
parents:
diff changeset
   648
}
hgs
parents:
diff changeset
   649
hgs
parents:
diff changeset
   650
// End of file