| Start/ | End/ | |||
| True | False | - | Line | Source |
| 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: ThumbnailManager stub for testing MpSongData | |||
| 15 | * | |||
| 16 | */ | |||
| 17 | #include <qsize.h> | |||
| 18 | #include "stub/inc/thumbnailmanager_qt.h" | |||
| 19 | #include "mptrace.h" | |||
| 20 | #include "logger.h" | |||
| 21 | ||||
| 22 | int gInitCounter = 0; | |||
| 23 | ||||
| 24 | /*! | |||
| 25 | Returns gInitCounter. | |||
| 26 | gInitCounter counts the number of constructor/destructor calls. | |||
| 27 | */ | |||
| Top | ||||
| 0 | 0 | - | 28 | int ThumbnailManager::getInitCounter() |
| 29 | { | |||
| 30 | TRACE("ThumbnailManager::getInitCounter() STUB"); | |||
| 30 | while ( 0 ) | |||
| 0 | - | 31 | return gInitCounter; | |
| 32 | } | |||
| 33 | ||||
| 34 | /*! | |||
| 35 | Resets gInitCounter to zero. | |||
| 36 | */ | |||
| Top | ||||
| 0 | 0 | - | 37 | void ThumbnailManager::resetInitCounter() |
| 38 | { | |||
| 39 | TRACE("ThumbnailManager::resetInitCounter() STUB"); | |||
| 39 | while ( 0 ) | |||
| 40 | gInitCounter = 0; | |||
| 41 | } | |||
| 42 | ||||
| Top | ||||
| 4 | 4 | 43 | ThumbnailManager::ThumbnailManager( QObject* parentPtr ) : | |
| 44 | QObject( parentPtr ), | |||
| 45 | mGetThumbFails(false), | |||
| 46 | mThumbnailReqCounter(0), | |||
| 47 | mCancelCounter(0) | |||
| 48 | { | |||
| 49 | TX_ENTRY_ARGS("Stub") | |||
| 50 | gInitCounter++; | |||
| 51 | } | |||
| 52 | ||||
| Top | ||||
| 4 | 4 | 53 | ThumbnailManager::~ThumbnailManager() | |
| 54 | { | |||
| 55 | TX_ENTRY_ARGS("Stub") | |||
| 56 | gInitCounter--; | |||
| 57 | } | |||
| 58 | ||||
| Top | ||||
| 0 | 0 | - | 59 | bool ThumbnailManager::setMode( ThumbnailMode mode ) |
| 60 | { | |||
| 61 | TX_ENTRY_ARGS("Stub") | |||
| 62 | Q_UNUSED(mode); | |||
| 0 | - | 63 | return true; | |
| 64 | } | |||
| 65 | ||||
| Top | ||||
| 4 | 0 | 66 | bool ThumbnailManager::setQualityPreference( QualityPreference | |
| 67 | qualityPreference ) | |||
| 68 | { | |||
| 69 | TX_ENTRY_ARGS("Stub") | |||
| 70 | Q_UNUSED(qualityPreference); | |||
| 4 | 71 | return true; | ||
| 72 | } | |||
| 73 | ||||
| Top | ||||
| 4 | 0 | 74 | bool ThumbnailManager::setThumbnailSize( ThumbnailSize thumbnailSize ) | |
| 75 | { | |||
| 76 | TX_ENTRY_ARGS("Stub") | |||
| 77 | Q_UNUSED(thumbnailSize); | |||
| 4 | 78 | return true; | ||
| 79 | } | |||
| 80 | ||||
| Top | ||||
| 0 | 0 | - | 81 | int ThumbnailManager::getThumbnail( const QString& fileName, void *clientData, |
| 82 | int priority ) | |||
| 83 | { | |||
| 84 | TX_ENTRY_ARGS("Stub") | |||
| 85 | Q_UNUSED(fileName); | |||
| 86 | Q_UNUSED(priority); | |||
| 87 | ||||
| 0 | 0 | - | 88 | if (clientData) { |
| 89 | // Delete this to prevent memory leak | |||
| 90 | int *data = (int *)clientData; | |||
| 91 | delete data; | |||
| 92 | ||||
| 93 | data = 0; | |||
| 94 | } | |||
| 95 | ||||
| 0 | 0 | - | 96 | if ( mGetThumbFails ) { |
| 0 | - | 97 | return -1; | |
| 98 | } | |||
| 99 | ||||
| 100 | mThumbnailReqCounter++; | |||
| 0 | - | 101 | return mThumbnailReqCounter; | |
| 102 | } | |||
| 103 | ||||
| Top | ||||
| 0 | 0 | - | 104 | bool ThumbnailManager::cancelRequest( int id ) |
| 105 | { | |||
| 106 | TX_ENTRY_ARGS("Stub") | |||
| 107 | Q_UNUSED(id); | |||
| 108 | mCancelCounter++; | |||
| 0 | - | 109 | return true; | |
| 110 | } | |||
| ***TER 30% (6/20) of SOURCE FILE thumbnailmanager_qt.cpp | ||||