author | Pat Downey <patd@symbian.org> |
Wed, 01 Sep 2010 12:20:35 +0100 | |
branch | RCL_3 |
changeset 22 | 9d4d3445ce6e |
parent 21 | 6257223ede8a |
permissions | -rw-r--r-- |
10
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1 |
/* |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2 |
* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of "Eclipse Public License v1.0" |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
8 |
* |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
11 |
* |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
13 |
* |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
14 |
* Description: |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
15 |
* |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
16 |
*/ |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
17 |
|
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
18 |
#include "thumbnailfetchedchecker.h" |
20
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
19 |
#include "thumbnaillog.h" |
10
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
20 |
|
11
85a88bc05e45
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
10
diff
changeset
|
21 |
const int KMaxStoredEntries = 100; |
10
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
22 |
|
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
23 |
// ----------------------------------------------------------------------------- |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
24 |
// CThumbnailFetchedChecker::CThumbnailFetchedChecker() |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
25 |
// ----------------------------------------------------------------------------- |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
26 |
// |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
27 |
CThumbnailFetchedChecker* CThumbnailFetchedChecker::NewL() |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
28 |
{ |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
29 |
return new (ELeave) CThumbnailFetchedChecker(); |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
30 |
} |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
31 |
|
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
32 |
// ----------------------------------------------------------------------------- |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
33 |
// CThumbnailFetchedChecker::CThumbnailFetchedChecker() |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
34 |
// ----------------------------------------------------------------------------- |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
35 |
// |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
36 |
CThumbnailFetchedChecker::CThumbnailFetchedChecker() |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
37 |
{ |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
38 |
} |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
39 |
|
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
40 |
// ----------------------------------------------------------------------------- |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
41 |
// CThumbnailFetchedChecker::~CThumbnailFetchedChecker() |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
42 |
// ----------------------------------------------------------------------------- |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
43 |
// |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
44 |
CThumbnailFetchedChecker::~CThumbnailFetchedChecker() |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
45 |
{ |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
46 |
iNotFetched.ResetAndDestroy(); |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
47 |
} |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
48 |
|
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
49 |
// ----------------------------------------------------------------------------- |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
50 |
// CThumbnailFetchedChecker::LastFetchResult() |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
51 |
// ----------------------------------------------------------------------------- |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
52 |
// |
20
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
53 |
TInt CThumbnailFetchedChecker::LastFetchResult( const TDesC& aUri, const TThumbnailSize aThumbnailSize ) |
10
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
54 |
{ |
20
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
55 |
TN_DEBUG3( "CThumbnailFetchedChecker::LastFetchResult(aUri=%S aThumbnailSize=%d)", &aUri, aThumbnailSize); |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
56 |
|
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
57 |
CEntry* entry = NULL; |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
58 |
TRAPD( err, entry = CEntry::NewL( aUri, aThumbnailSize, KErrNone ) ); |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
59 |
if ( !err && entry ) |
10
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
60 |
{ |
20
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
61 |
TInt ret = iNotFetched.FindInOrder( entry, CEntry::FindCB ); |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
62 |
if ( ret != KErrNotFound ) |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
63 |
{ |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
64 |
TN_DEBUG1( "CThumbnailFetchedChecker::LastFetchResult() -> error found"); |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
65 |
delete entry; |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
66 |
entry = NULL; |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
67 |
return iNotFetched[ ret ]->iError; |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
68 |
} |
10
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
69 |
} |
20
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
70 |
|
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
71 |
delete entry; |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
72 |
entry = NULL; |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
73 |
|
10
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
74 |
return KErrNone; |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
75 |
} |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
76 |
|
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
77 |
// ----------------------------------------------------------------------------- |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
78 |
// CThumbnailFetchedChecker::SetFetchResult() |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
79 |
// ----------------------------------------------------------------------------- |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
80 |
// |
20
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
81 |
void CThumbnailFetchedChecker::SetFetchResult( const TDesC& aUri, const TThumbnailSize aThumbnailSize, TInt aError ) |
10
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
82 |
{ |
20
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
83 |
TN_DEBUG4( "CThumbnailFetchedChecker::SetFetchResult(aUri=%S aThumbnailSize=%d aError=%d)", &aUri, aThumbnailSize, aError); |
10
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
84 |
if ( aError == KErrNone ) |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
85 |
{ |
20
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
86 |
// Remove successful results from store |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
87 |
CEntry* entry = NULL; |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
88 |
TRAPD( err, entry = CEntry::NewL( aUri, aThumbnailSize, aError ) ); |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
89 |
if ( !err && entry ) |
10
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
90 |
{ |
20
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
91 |
TInt i = iNotFetched.FindInOrder( entry, CEntry::FindCB ); |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
92 |
if ( i >= 0 ) |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
93 |
{ |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
94 |
TN_DEBUG2( "CThumbnailFetchedChecker::LastFetchResult() -> Remove successful results from store %d", iNotFetched.Count() ); |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
95 |
delete iNotFetched[ i ]; |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
96 |
iNotFetched[ i ] = NULL; |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
97 |
iNotFetched.Remove( i ); |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
98 |
} |
10
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
99 |
} |
20
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
100 |
entry = NULL; |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
101 |
delete entry; |
10
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
102 |
} |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
103 |
else |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
104 |
{ |
20
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
105 |
|
10
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
106 |
// Add or update |
11
85a88bc05e45
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
10
diff
changeset
|
107 |
CEntry* entry = NULL; |
20
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
108 |
TRAPD( err, entry = CEntry::NewL( aUri, aThumbnailSize, aError ) ); |
11
85a88bc05e45
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
10
diff
changeset
|
109 |
if ( !err && entry ) |
10
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
110 |
{ |
11
85a88bc05e45
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
10
diff
changeset
|
111 |
err = iNotFetched.Find( entry ); |
10
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
112 |
if ( err != KErrNotFound ) |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
113 |
{ |
20
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
114 |
// update existing fetch result |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
115 |
TInt i = iNotFetched.FindInOrder( entry, CEntry::FindCB ); |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
116 |
if ( i >= 0 ) |
10
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
117 |
{ |
20
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
118 |
TN_DEBUG1( "CThumbnailFetchedChecker::LastFetchResult() -> Update fetched tn error" ); |
10
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
119 |
iNotFetched[ i ]->iError = aError; |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
120 |
} |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
121 |
} |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
122 |
else |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
123 |
{ |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
124 |
if( iNotFetched.Count() < KMaxStoredEntries ) |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
125 |
{ |
20
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
126 |
// insert new fetch result |
10
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
127 |
TInt err = iNotFetched.InsertInOrder( entry, CEntry::InsertCB ); |
17
ff2fb7658ff7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
128 |
if ( err == KErrNone ) |
10
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
129 |
{ |
20
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
130 |
TN_DEBUG2( "CThumbnailFetchedChecker::LastFetchResult() -> Inserted new fetched tn error %d", iNotFetched.Count()); |
17
ff2fb7658ff7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
131 |
entry = NULL; // owned by array now |
10
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
132 |
} |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
133 |
} |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
134 |
} |
17
ff2fb7658ff7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
135 |
|
ff2fb7658ff7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
136 |
delete entry; |
ff2fb7658ff7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
137 |
entry = NULL; |
10
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
138 |
} |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
139 |
} |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
140 |
} |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
141 |
|
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
142 |
// ----------------------------------------------------------------------------- |
20
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
143 |
// CThumbnailFetchedChecker::DeleteFetchResult() |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
144 |
// ----------------------------------------------------------------------------- |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
145 |
// |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
146 |
void CThumbnailFetchedChecker::DeleteFetchResult( const TDesC& aUri ) |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
147 |
{ |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
148 |
TN_DEBUG2( "CThumbnailFetchedChecker::DeleteFetchResult(%S)", &aUri); |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
149 |
// delete all entries of passed uri |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
150 |
TInt ret; |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
151 |
do |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
152 |
{ |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
153 |
ret = iNotFetched.FindInOrder( aUri, CEntry::FindCBUri ); |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
154 |
if ( ret >= 0 ) |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
155 |
{ |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
156 |
TN_DEBUG1( "CThumbnailFetchedChecker::DeleteFetchResult() -> Deteled URI from fetched list" ); |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
157 |
delete iNotFetched[ ret ]; |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
158 |
iNotFetched[ ret ] = NULL; |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
159 |
iNotFetched.Remove( ret ); |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
160 |
} |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
161 |
} |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
162 |
while(ret != KErrNotFound ); |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
163 |
|
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
164 |
} |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
165 |
|
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
166 |
// ----------------------------------------------------------------------------- |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
167 |
// CThumbnailFetchedChecker::LastFetchResult() |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
168 |
// ----------------------------------------------------------------------------- |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
169 |
// |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
170 |
void CThumbnailFetchedChecker::RenameFetchResultL( const TDesC& aNewUri, const TDesC& aOldUri ) |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
171 |
{ |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
172 |
TN_DEBUG3( "CThumbnailFetchedChecker::RenameFetchResult(aNewUri=%S aOldUri=%S)", &aNewUri, &aOldUri); |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
173 |
// change every occurence of passed uri |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
174 |
TInt ret; |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
175 |
do |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
176 |
{ |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
177 |
ret = iNotFetched.FindInOrder( aOldUri, CEntry::FindCBUri ); |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
178 |
if ( ret >= 0 ) |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
179 |
{ |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
180 |
delete iNotFetched[ ret ]->iUri; |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
181 |
iNotFetched[ ret ]->iUri = NULL; |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
182 |
|
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
183 |
iNotFetched[ ret ]->iUri = aNewUri.AllocL(); |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
184 |
TN_DEBUG1( "CThumbnailFetchedChecker::RenameeFetchResult() -> Renamed URI in fetched list" ); |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
185 |
} |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
186 |
} |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
187 |
while(ret != KErrNotFound ); |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
188 |
|
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
189 |
} |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
190 |
|
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
191 |
// ----------------------------------------------------------------------------- |
10
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
192 |
// CThumbnailFetchedChecker::Reset() |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
193 |
// ----------------------------------------------------------------------------- |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
194 |
// |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
195 |
void CThumbnailFetchedChecker::Reset() |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
196 |
{ |
20
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
197 |
TN_DEBUG1( "CThumbnailFetchedChecker::Reset()"); |
10
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
198 |
iNotFetched.ResetAndDestroy(); |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
199 |
} |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
200 |
|
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
201 |
// ----------------------------------------------------------------------------- |
20
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
202 |
// CThumbnailFetchedChecker::CEntry::NewL() |
10
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
203 |
// ----------------------------------------------------------------------------- |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
204 |
// |
11
85a88bc05e45
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
10
diff
changeset
|
205 |
CThumbnailFetchedChecker::CEntry* CThumbnailFetchedChecker::CEntry::NewL( |
20
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
206 |
const TDesC& aUri, const TThumbnailSize aThumbnailSize, TInt aError ) |
10
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
207 |
{ |
20
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
208 |
TN_DEBUG4( "CThumbnailFetchedChecker::CEntry::NewL(aUri=%S aThumbnailSize=%d aError=%d)", &aUri, aThumbnailSize, aError); |
11
85a88bc05e45
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
10
diff
changeset
|
209 |
CEntry* self = new (ELeave) CEntry(); |
10
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
210 |
if ( self ) |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
211 |
{ |
20
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
212 |
self->iUri = aUri.AllocL(); |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
213 |
self->iSize = aThumbnailSize; |
10
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
214 |
self->iError = aError; |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
215 |
if ( !self->iUri ) |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
216 |
{ |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
217 |
delete self; |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
218 |
self = NULL; |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
219 |
} |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
220 |
} |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
221 |
return self; |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
222 |
} |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
223 |
|
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
224 |
// ----------------------------------------------------------------------------- |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
225 |
// CThumbnailFetchedChecker::CEntry::FindCB() |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
226 |
// ----------------------------------------------------------------------------- |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
227 |
// |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
228 |
TInt CThumbnailFetchedChecker::CEntry::FindCB( |
20
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
229 |
const CThumbnailFetchedChecker::CEntry& aEntry, const CThumbnailFetchedChecker::CEntry& aEntry1 ) |
10
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
230 |
{ |
20
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
231 |
TN_DEBUG1( "CThumbnailFetchedChecker::CEntry::FindCB"); |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
232 |
if( aEntry1.iSize == aEntry.iSize) |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
233 |
{ |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
234 |
// return index if size and uri matches |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
235 |
return aEntry.iUri->CompareF( *( aEntry1.iUri ) ); |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
236 |
} |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
237 |
else |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
238 |
{ |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
239 |
return KErrNotFound; |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
240 |
} |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
241 |
} |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
242 |
|
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
243 |
// ----------------------------------------------------------------------------- |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
244 |
// CThumbnailFetchedChecker::CEntry::FindCBUri() |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
245 |
// ----------------------------------------------------------------------------- |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
246 |
// |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
247 |
TInt CThumbnailFetchedChecker::CEntry::FindCBUri( |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
248 |
const TDesC* aUri, const CThumbnailFetchedChecker::CEntry& aEntry ) |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
249 |
{ |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
250 |
TN_DEBUG2( "CThumbnailFetchedChecker::CEntry::FindCBUri(aUri=%S", &aUri); |
10
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
251 |
return aUri->CompareF( *( aEntry.iUri ) ); |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
252 |
} |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
253 |
|
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
254 |
// ----------------------------------------------------------------------------- |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
255 |
// CThumbnailFetchedChecker::CEntry::InsertCB() |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
256 |
// ----------------------------------------------------------------------------- |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
257 |
// |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
258 |
TInt CThumbnailFetchedChecker::CEntry::InsertCB( |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
259 |
const CThumbnailFetchedChecker::CEntry& aEntry1, |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
260 |
const CThumbnailFetchedChecker::CEntry& aEntry2 ) |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
261 |
{ |
20
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
262 |
TN_DEBUG1( "CThumbnailFetchedChecker::CEntry::InsertCB"); |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
263 |
if( aEntry1.iSize == aEntry2.iSize) |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
264 |
{ |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
265 |
// return index if size and uri matches |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
266 |
return aEntry1.iUri->CompareF( *( aEntry2.iUri ) ); |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
267 |
} |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
268 |
else |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
269 |
{ |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
270 |
return KErrNotFound; |
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
271 |
} |
10
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
272 |
} |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
273 |
|
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
274 |
// ----------------------------------------------------------------------------- |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
275 |
// CThumbnailFetchedChecker::CEntry::CEntry() |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
276 |
// ----------------------------------------------------------------------------- |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
277 |
// |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
278 |
CThumbnailFetchedChecker::CEntry::CEntry() |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
279 |
{ |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
280 |
} |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
281 |
|
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
282 |
// ----------------------------------------------------------------------------- |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
283 |
// CThumbnailFetchedChecker::CEntry::~CEntry() |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
284 |
// ----------------------------------------------------------------------------- |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
285 |
// |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
286 |
CThumbnailFetchedChecker::CEntry::~CEntry() |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
287 |
{ |
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
288 |
delete iUri; |
20
2b4b06654caa
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
289 |
iUri = NULL; |
10
ee674526fac5
Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
290 |
} |