--- a/imagehandling_plat/thumbnailmanager_api/inc/thumbnailmanager.h Wed Jun 23 18:33:48 2010 +0300
+++ b/imagehandling_plat/thumbnailmanager_api/inc/thumbnailmanager.h Tue Jul 06 14:37:18 2010 +0300
@@ -44,6 +44,9 @@
EAudioGridThumbnailSize,
EAudioListThumbnailSize,
EAudioFullScreenThumbnailSize,
+EContactGridThumbnailSize,
+EContactListThumbnailSize,
+EContactFullScreenThumbnailSize,
EGridThumbnailSize,
EListThumbnailSize,
EFullScreenThumbnailSize,
--- a/imagehandling_plat/thumbnailmanager_api/inc/thumbnailmanager_qt.h Wed Jun 23 18:33:48 2010 +0300
+++ b/imagehandling_plat/thumbnailmanager_api/inc/thumbnailmanager_qt.h Tue Jul 06 14:37:18 2010 +0300
@@ -46,7 +46,6 @@
public:
-
/** Thumbnail size. */
enum ThumbnailSize
{
@@ -259,6 +258,25 @@
*/
TNM_EXPORT int setThumbnail( const QImage& source, const QString& fileName,
void * clientData = NULL, int priority = tnmWrapperPriorityIdle );
+
+ /**
+ * Set a thumbnail for an object file generated from source file.
+ * thumbnailReady() signal will be emited when the operation is complete.
+ *
+ * @param sourceFileName Source file name from which the thumbnail will be created
+ * @param targetFileName Target file name
+ * @param clientData Pointer to arbitrary client data.
+ * This pointer is not used by the API for
+ * anything other than returning it in the
+ * ThumbnailReady callback.
+ * @param priority Priority for this operation
+ * @return Thumbnail request ID or -1 if request failed. This can be used to
+ * cancel the request or change priority.
+ *
+ */
+ TNM_EXPORT int setThumbnail( const QString& sourceFileName, const QString& targetFileName,
+ const QString& mimeType = QString(""), void * clientData = NULL,
+ int priority = tnmWrapperPriorityIdle );
/**
* Delete all thumbnails for a given object. This is an asynchronous
--- a/imagehandling_plat/thumbnailmanager_api/inc/thumbnailobjectsource.h Wed Jun 23 18:33:48 2010 +0300
+++ b/imagehandling_plat/thumbnailmanager_api/inc/thumbnailobjectsource.h Tue Jul 06 14:37:18 2010 +0300
@@ -134,6 +134,45 @@
*/
void ConstructL( const RFile64& aFile, const TDesC& aMimeType );
+ /**
+ * Symbian 2nd phase constructor can leave.
+ *
+ * @since S60 v5.0
+ * @param aURI URI.
+ * @param aMimeType MimeType.
+ * @param aThumbnailId ThumbnailId
+ */
+ void ConstructL( const TDesC& aUri, const TDesC& aMimeType, TThumbnailId aThumbnailId );
+
+ /**
+ * Symbian 2nd phase constructor can leave.
+ *
+ * @since S60 v5.0
+ * @param aBitmap Bitmap.
+ * @param aURI URI.
+ */
+ void ConstructL( CFbsBitmap* aBitmap, const TDesC& aUri );
+
+ /**
+ * Symbian 2nd phase constructor can leave.
+ *
+ * @since S60 v5.0
+ * @param aBuffer Buffer.
+ * @param aMimeType MIME type. Optional, but should be specified if known.
+ * @param aURI URI.
+ */
+ void ConstructL( TDesC8* aBuffer, const TDesC& aMimeType, const TDesC& aUri );
+
+ /**
+ * Symbian 2nd phase constructor can leave.
+ *
+ * @since Symbian^3
+ * @param aUri Object URI or a full path to a file in the file system.
+ * @param aTargetUri For linking the thumbnail to a different URI.
+ * @param aMimeType MIME type. Optional, but should be specified if known.
+ */
+ void ConstructL( const TDesC& aUri, const TDesC& aTargetUri, const TDesC& aMimeType );
+
private:
// data
@@ -160,25 +199,19 @@
/**
* Bitmap
*/
-
CFbsBitmap* iBitmap; // own
/**
* ThumbnailId
- */
+ */
+ TThumbnailId iThumbnailId; //own
- TThumbnailId iThumbnailId; //own
+ /**
+ * Uri
+ */
+ HBufC* iTargetUri; // own
public:
- /**
- * Symbian 2nd phase constructor can leave.
- *
- * @since S60 v5.0
- * @param aURI URI.
- * @param aMimeType MimeType.
- * @param aThumbnailId ThumbnailId
- */
- void ConstructL( const TDesC& aUri, const TDesC& aMimeType, TThumbnailId aThumbnailId );
/**
* Construct a new CThumbnailObjectSource referring to a buffer
@@ -211,7 +244,8 @@
* @since S60 v5.0
* @return New CThumbnailObjectSource instance.
*/
- IMPORT_C static CThumbnailObjectSource* NewL( TDesC8* aBuffer, TDesC& aMimeType, const TDesC& aUri );
+ IMPORT_C static CThumbnailObjectSource* NewL( TDesC8* aBuffer, TDesC& aMimeType,
+ const TDesC& aUri );
/**
* Construct a new CThumbnailObjectSource referring to a buffer
@@ -223,7 +257,8 @@
* @since S60 v5.0
* @return New CThumbnailObjectSource instance.
*/
- IMPORT_C static CThumbnailObjectSource* NewLC( TDesC8* aBuffer, TDesC& aMimeType, const TDesC& aUri);
+ IMPORT_C static CThumbnailObjectSource* NewLC( TDesC8* aBuffer, TDesC& aMimeType,
+ const TDesC& aUri);
/**
* Construct a new CThumbnailObjectSource referring to an URI.
@@ -233,7 +268,7 @@
* @return New CThumbnailObjectSource instance.
*/
IMPORT_C static CThumbnailObjectSource* NewL( const TDesC& aUri,
- TThumbnailId aThumbnailId = 0, const TDesC& aMimeType = KNullDesC );
+ TThumbnailId aThumbnailId = 0, const TDesC& aMimeType = KNullDesC );
/**
* Construct a new CThumbnailObjectSource referring to an URI.
@@ -243,9 +278,8 @@
* @return New CThumbnailObjectSource instance.
*/
IMPORT_C static CThumbnailObjectSource* NewLC( const TDesC& aUri,
- TThumbnailId aThumbnailId = 0, const TDesC& aMimeType = KNullDesC );
-
-
+ TThumbnailId aThumbnailId = 0, const TDesC& aMimeType = KNullDesC );
+
/**
* Returns source buffer.
*
@@ -276,30 +310,8 @@
*
* @since S60 v5.0
* @return ThumbnailId
- */
-
- IMPORT_C TThumbnailId Id();
-
- /**
- * Symbian 2nd phase constructor can leave.
- *
- * @since S60 v5.0
- * @param aBitmap Bitmap.
- * @param aURI URI.
- */
- void ConstructL( CFbsBitmap* aBitmap, const TDesC&
- aUri );
-
- /**
- * Symbian 2nd phase constructor can leave.
- *
- * @since S60 v5.0
- * @param aBuffer Buffer.
- * @param aMimeType MIME type. Optional, but should be specified if known.
- * @param aURI URI.
- */
- void ConstructL( TDesC8* aBuffer, const TDesC&
- aMimeType, const TDesC& aUri );
+ */
+ IMPORT_C TThumbnailId Id();
/**
* Returns source bitmap.
@@ -317,6 +329,36 @@
* @return bitmap
*/
IMPORT_C CFbsBitmap* GetBitmapOwnership();
+
+ /**
+ * Construct a new CThumbnailObjectSource referring to an URI.
+ * @param aUri Object URI or a full path to a file in the file system.
+ * @param aTargetUri For linking the thumbnail to a different URI.
+ * @param aMimeType MIME type. Optional, but should be specified if known.
+ * @since Symbian^3
+ * @return New CThumbnailObjectSource instance.
+ */
+ IMPORT_C static CThumbnailObjectSource* NewL( const TDesC& aUri,
+ const TDesC& aTargetUri, const TDesC& aMimeType );
+
+ /**
+ * Construct a new CThumbnailObjectSource referring to an URI.
+ * @param aUri Object URI or a full path to a file in the file system.
+ * @param aTargetUri For linking the thumbnail to a different URI.
+ * @param aMimeType MIME type.
+ * @since Symbian^3
+ * @return New CThumbnailObjectSource instance.
+ */
+ IMPORT_C static CThumbnailObjectSource* NewLC( const TDesC& aUri,
+ const TDesC& aTargetUri, const TDesC& aMimeType );
+
+ /**
+ * Returns target uri.
+ *
+ * @since Symbian^3
+ * @return uri
+ */
+ IMPORT_C const TDesC& TargetUri();
};
#endif // THUMBNAILOBJECTSOURCE_H
--- a/imagehandling_plat/thumbnailmanager_api/tsrc/conf/ThumbnailManagerTest.cfg Wed Jun 23 18:33:48 2010 +0300
+++ b/imagehandling_plat/thumbnailmanager_api/tsrc/conf/ThumbnailManagerTest.cfg Tue Jul 06 14:37:18 2010 +0300
@@ -37,23 +37,26 @@
// ---------------------------------------------------------------------------
[Define]
-KErrNotFound -1
-KErrNotSupported -5
-KErrArgument -6
+KErrNotFound -1
+KErrGeneral -2
+KErrNotSupported -5
+KErrArgument -6
KMaxTInt 2147483647
// Delay between test cases (milliseconds)
KTestDelay 1000
-KOneSecondDelay 1000
-KFiveSecondDelay 5000
-KTenSecondDelay 5000
+KOneSecondDelay 1000
+KFiveSecondDelay 5000
+KTenSecondDelay 10000
// A delay to make sure the client-server request to generate a thumbnail
// reaches the server, but doesn't have enough time to complete yet
// (milliseconds)
-KClientServerDelay 150
+KClientServerDelay 150
+KClientServerDelay2 25
+KClientServerDelay3 10
// From TDisplayMode: value for 24-bit display mode
EColor16M 8
@@ -81,7 +84,13 @@
EVideoFullScreenThumbnailSize 7
EAudioGridThumbnailSize 8
EAudioListThumbnailSize 9
-EAudioFullScreenThumbnailSize 10
+EAudioFullScreenThumbnailSize 10
+EContactGridThumbnailSize 11
+EContactListThumbnailSize 12
+EContactFullScreenThumbnailSize 13
+EGridThumbnailSize = 14
+EListThumbnailSize = 15
+EFullScreenThumbnailSize = 16
// Custom sizes
KCustomSizeX 111
@@ -600,12 +609,128 @@
pause KTestDelay
[Endtest]
+// ---------------------------------------------------------------------------
+// Create MP3 thumbnail with PNG album art
+// ---------------------------------------------------------------------------
+[Test]
+title Create MP3 thumbnail with PNG album art
+create ThumbnailManagerTest tn
+tn CreateInstanceL
+tn SetDisplayModeL EColor16M
+
+// using path
+tn CreateSourceInstancePathL \data\ThumbnailManagerTest\mp3_png.mp3
+tn DeleteThumbnails
+tn SetThumbnailEnumSizeL EImageGridThumbnailSize
+tn GetThumbnailL
+waittestclass tn
+tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor16M
+tn DeleteThumbnails
+tn SetThumbnailEnumSizeL EImageFullScreenThumbnailSize
+tn GetThumbnailL
+waittestclass tn
+tn CheckThumbnailCenrepL EImageFullScreenThumbnailSize EColor16M
+tn DeleteThumbnails
+tn SetThumbnailEnumSizeL ECustomThumbnailSize
+tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
+tn GetThumbnailL
+waittestclass tn
+tn CheckThumbnailL KCustomSizeX KCustomSizeY EColor16M
+tn DeleteThumbnails
+tn DeleteSourceInstance
+
+tn DeleteInstance
+delete tn
+pause KTestDelay
+[Endtest]
// ---------------------------------------------------------------------------
-// Thumbs from buffer
+// Create thumbnail preview from JPG with EXIF
// ---------------------------------------------------------------------------
[Test]
-title Thumbs from buffer
+title Create thumbnail preview from JPG with EXIF
+create ThumbnailManagerTest tn
+tn CreateInstanceL
+tn SetDisplayModeL EColor16M
+
+// jpg with exif
+tn CreateSourceInstancePathL \data\ThumbnailManagerTest\RGB_VGA.jpg
+tn DeleteThumbnails
+tn SetThumbnailEnumSizeL EImageGridThumbnailSize
+tn SetQualityPreferenceL EOptimizeForQualityWithPreview
+tn GetThumbnailL
+waittestclass tn
+tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor16M
+tn DeleteThumbnails
+tn DeleteSourceInstance
+
+// png with exif
+tn CreateSourceInstancePathL \data\ThumbnailManagerTest\exif.png
+tn DeleteThumbnails
+tn SetThumbnailEnumSizeL EImageGridThumbnailSize
+tn SetQualityPreferenceL EOptimizeForQualityWithPreview
+tn GetThumbnailL
+waittestclass tn
+tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor16M
+tn DeleteThumbnails
+tn DeleteSourceInstance
+
+// no exif
+tn CreateSourceInstancePathL \data\ThumbnailManagerTest\no_exif.jpg
+tn DeleteThumbnails
+tn SetThumbnailEnumSizeL EImageGridThumbnailSize
+tn SetQualityPreferenceL EOptimizeForQualityWithPreview
+tn GetThumbnailL
+waittestclass tn
+tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor16M
+tn DeleteThumbnails
+tn DeleteSourceInstance
+
+tn DeleteInstance
+delete tn
+pause KTestDelay
+[Endtest]
+
+// ---------------------------------------------------------------------------
+// Create thumbnail from WMA PNG & empty album arts
+// ---------------------------------------------------------------------------
+[Test]
+title Create thumbnail from WMA PNG & empty album arts
+create ThumbnailManagerTest tn
+tn CreateInstanceL
+tn SetDisplayModeL EColor16M
+
+// try to create thumbnail from PNG
+tn CreateSourceInstancePathL \data\ThumbnailManagerTest\wma_png.wma
+tn DeleteThumbnails
+tn SetThumbnailEnumSizeL EAudioFullScreenThumbnailSize
+tn GetThumbnailL
+allownextresult KErrNotFound
+waittestclass tn
+tn DeleteThumbnails
+tn DeleteSourceInstance
+
+// try to create thumbnail without album art
+tn CreateSourceInstancePathL \data\ThumbnailManagerTest\wma_empty.wma
+tn DeleteThumbnails
+tn SetThumbnailEnumSizeL EAudioFullScreenThumbnailSize
+tn GetThumbnailL
+allownextresult KErrNotFound
+waittestclass tn
+tn DeleteThumbnails
+tn DeleteSourceInstance
+
+tn DeleteInstance
+delete tn
+pause KTestDelay
+[Endtest]
+
+
+// ---------------------------------------------------------------------------
+// Create thumbs from buffer
+// ---------------------------------------------------------------------------
+[Test]
+title Create thumbs from buffer
create ThumbnailManagerTest tn
tn CreateInstanceL
tn SetDisplayModeL EColor16M
@@ -696,6 +821,77 @@
[Endtest]
// ---------------------------------------------------------------------------
+// Create thumbs from CFbsBitmap
+// ---------------------------------------------------------------------------
+[Test]
+title Create thumbs from CFbsBitmap
+create ThumbnailManagerTest tn
+tn CreateInstanceL
+tn SetDisplayModeL EColor16M
+
+tn SetFlagsL EDefaultFlags
+tn CreateSourceInstanceBitmapL \data\ThumbnailManagerTest\TestMBM.mbm \data\ThumbnailManagerTest\camera.jpg
+tn DeleteThumbnails
+tn CreateThumbnails
+waittestclass tn
+
+pause KTenSecondDelay
+
+tn DeleteSourceInstance
+
+tn CreateSourceInstancePathL \data\ThumbnailManagerTest\camera.jpg
+tn SetFlagsL EDoNotCreate
+tn SetThumbnailEnumSizeL EImageGridThumbnailSize
+tn GetThumbnailL
+waittestclass tn
+tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor16M
+tn SetThumbnailEnumSizeL EImageFullScreenThumbnailSize
+tn GetThumbnailL
+waittestclass tn
+tn CheckThumbnailCenrepL EImageFullScreenThumbnailSize EColor16M
+tn DeleteThumbnails
+tn DeleteSourceInstance
+
+tn DeleteInstance
+delete tn
+pause KTestDelay
+[Endtest]
+
+
+// ---------------------------------------------------------------------------
+// Create image/audio/video thumbs
+// ---------------------------------------------------------------------------
+[Test]
+title Create image/audio/video thumbs
+create ThumbnailManagerTest tn
+tn CreateInstanceL
+tn SetDisplayModeL EColor16M
+
+// try to create thumbnail from image
+tn CreateThumbnailsByUrlL \data\ThumbnailManagerTest\RGB_VGA.jpg
+waittestclass tn
+tn DeleteThumbnails
+tn DeleteSourceInstance
+
+// try to create thumbnail from music
+tn CreateThumbnailsByUrlL \data\ThumbnailManagerTest\mp3_png.mp3
+waittestclass tn
+tn DeleteThumbnails
+tn DeleteSourceInstance
+
+// try to create thumbnail from video
+tn CreateThumbnailsByUrlL \data\ThumbnailManagerTest\Videoclip.mp4
+waittestclass tn
+tn DeleteThumbnails
+tn DeleteSourceInstance
+
+tn DeleteInstance
+delete tn
+pause KTestDelay
+[Endtest]
+
+
+// ---------------------------------------------------------------------------
// Create thumbnails for each persistent size
// ---------------------------------------------------------------------------
[Test]
@@ -829,80 +1025,6 @@
pause KTestDelay
[Endtest]
-
-// ---------------------------------------------------------------------------
-// Thumbnail from missing or unsupported file
-// ---------------------------------------------------------------------------
-[Test]
-title Thumbnail from missing or unsupported file
-create ThumbnailManagerTest tn
-tn CreateInstanceL
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
-
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\does_not_exist.jpg
-tn GetThumbnailL
-allownextresult KErrNotFound
-waittestclass tn
-tn DeleteSourceInstance
-
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\Unsupported.txt
-tn GetThumbnailL
-allownextresult KErrNotSupported
-waittestclass tn
-tn DeleteSourceInstance
-
-tn CreateSourceInstanceHandleL \data\ThumbnailManagerTest\Unsupported.txt
-tn GetThumbnailL
-allownextresult KErrNotSupported
-waittestclass tn
-tn DeleteSourceInstance
-
-tn CreateSourceInstanceBufferL \data\ThumbnailManagerTest\Unsupported.txt plain/text
-tn GetThumbnailL
-allownextresult KErrNotSupported
-waittestclass tn
-tn DeleteSourceInstance
-
-tn DeleteInstance
-delete tn
-pause KTestDelay
-[Endtest]
-
-// ---------------------------------------------------------------------------
-// Thumbnail from corrupt file
-// ---------------------------------------------------------------------------
-[Test]
-title Thumbnail from corrupt file
-create ThumbnailManagerTest tn
-tn CreateInstanceL
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
-
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\not_jpg.jpg
-tn GetThumbnailL
-allownextresult KErrNotFound
-waittestclass tn
-tn DeleteSourceInstance
-
-tn CreateSourceInstanceBufferL \data\ThumbnailManagerTest\not_jpg.jpg image/jpeg
-tn GetThumbnailL
-allownextresult KErrNotFound
-waittestclass tn
-tn DeleteSourceInstance
-
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\not_3gp.3gp
-tn GetThumbnailL
-allownextresult KErrNotSupported
-waittestclass tn
-tn DeleteSourceInstance
-
-tn DeleteInstance
-delete tn
-pause KTestDelay
-[Endtest]
-
-
// ---------------------------------------------------------------------------
// Custom size thumbs
// ---------------------------------------------------------------------------
@@ -1592,35 +1714,79 @@
// ---------------------------------------------------------------------------
-// Get thumbnail by id
+// Thumbnail from missing or unsupported file
// ---------------------------------------------------------------------------
[Test]
-title Get thumbnail by id
+title Thumbnail from missing or unsupported file
create ThumbnailManagerTest tn
tn CreateInstanceL
-tn SetDisplayModeL EColor16M
+tn SetThumbnailEnumSizeL ECustomThumbnailSize
+tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
-tn SetThumbnailEnumSizeL EImageGridThumbnailSize
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\RGB_VGA.jpg 99999
-tn DeleteThumbnails
-tn CreateThumbnails
+tn CreateSourceInstancePathL \data\ThumbnailManagerTest\does_not_exist.jpg
+tn GetThumbnailL
+allownextresult KErrNotFound
waittestclass tn
+tn DeleteSourceInstance
-pause KTenSecondDelay
-
-tn SetFlagsL EDoNotCreate
-tn GetThumbnailByIdL 99999
+tn CreateSourceInstancePathL \data\ThumbnailManagerTest\Unsupported.txt
+tn GetThumbnailL
+allownextresult KErrNotSupported
waittestclass tn
-tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor16M
-tn DeleteThumbnails
+tn DeleteSourceInstance
+tn CreateSourceInstanceHandleL \data\ThumbnailManagerTest\Unsupported.txt
+tn GetThumbnailL
+allownextresult KErrNotSupported
+waittestclass tn
tn DeleteSourceInstance
+
+tn CreateSourceInstanceBufferL \data\ThumbnailManagerTest\Unsupported.txt plain/text
+tn GetThumbnailL
+allownextresult KErrNotSupported
+waittestclass tn
+tn DeleteSourceInstance
+
tn DeleteInstance
delete tn
pause KTestDelay
[Endtest]
// ---------------------------------------------------------------------------
+// Thumbnail from corrupt file
+// ---------------------------------------------------------------------------
+[Test]
+title Thumbnail from corrupt file
+create ThumbnailManagerTest tn
+tn CreateInstanceL
+tn SetThumbnailEnumSizeL ECustomThumbnailSize
+tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
+
+tn CreateSourceInstancePathL \data\ThumbnailManagerTest\not_jpg.jpg
+tn GetThumbnailL
+allownextresult KErrNotFound
+waittestclass tn
+tn DeleteSourceInstance
+
+tn CreateSourceInstanceBufferL \data\ThumbnailManagerTest\not_jpg.jpg image/jpeg
+tn GetThumbnailL
+allownextresult KErrNotFound
+waittestclass tn
+tn DeleteSourceInstance
+
+tn CreateSourceInstancePathL \data\ThumbnailManagerTest\not_3gp.3gp
+tn GetThumbnailL
+allownextresult KErrNotSupported
+waittestclass tn
+tn DeleteSourceInstance
+
+tn DeleteInstance
+delete tn
+pause KTestDelay
+[Endtest]
+
+
+// ---------------------------------------------------------------------------
// Set thumbnail from buffer
// ---------------------------------------------------------------------------
[Test]
@@ -1678,72 +1844,47 @@
[Endtest]
// ---------------------------------------------------------------------------
-// Import thumbnail
+// Set thumbnail from path
// ---------------------------------------------------------------------------
[Test]
-title Import thumbnail
+title Set thumbnail from path
create ThumbnailManagerTest tn
tn CreateInstanceL
tn SetDisplayModeL EColor16M
+// normal uri
tn SetFlagsL EDefaultFlags
-tn SetThumbnailEnumSizeL EImageGridThumbnailSize
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\RGB_VGA.jpg
-tn DeleteThumbnails
-tn ImportThumbnailL \data\ThumbnailManagerTest\imported.jpg
+tn CreateSourceInstancePathTargetL \data\ThumbnailManagerTest\RGB_VGA.jpg \data\ThumbnailManagerTest\target.jpg image/jpeg 0 0
+tn SetThumbnailL
+
waittestclass tn
+
tn DeleteSourceInstance
-
+tn CreateSourceInstancePathL \data\ThumbnailManagerTest\target.jpg
+tn SetThumbnailEnumSizeL EImageGridThumbnailSize
tn SetFlagsL EDoNotCreate
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\imported.jpg
tn GetThumbnailL
+
waittestclass tn
tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor16M
tn DeleteThumbnails
tn DeleteSourceInstance
+// virtual uri
tn SetFlagsL EDefaultFlags
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\RGB_400x300.bmp
-tn DeleteThumbnails
-tn ImportThumbnailL \data\ThumbnailManagerTest\imported.bmp
-waittestclass tn
-tn DeleteSourceInstance
+tn CreateSourceInstancePathTargetL \data\ThumbnailManagerTest\RGB_VGA.jpg \data\ThumbnailManagerTest\target.vcf contact/x-vcard 0 1
+tn SetThumbnailL
-tn SetFlagsL EDoNotCreate
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\imported.bmp
-tn GetThumbnailL
waittestclass tn
-tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-tn SetFlagsL EDefaultFlags
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\WIDE_800x400.gif
-tn DeleteThumbnails
-tn ImportThumbnailL \data\ThumbnailManagerTest\imported.gif
-waittestclass tn
tn DeleteSourceInstance
-
+tn CreateSourceInstancePathL \data\ThumbnailManagerTest\target.vcf
+tn SetThumbnailEnumSizeL EContactGridThumbnailSize
tn SetFlagsL EDoNotCreate
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\imported.gif
tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-tn SetFlagsL EDefaultFlags
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\video.3gp
-tn DeleteThumbnails
-tn ImportThumbnailL \data\ThumbnailManagerTest\imported.3gp
waittestclass tn
-tn DeleteSourceInstance
-
-tn SetFlagsL EDoNotCreate
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\imported.3gp
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor16M
+tn CheckThumbnailCenrepL EContactGridThumbnailSize EColor16M
tn DeleteThumbnails
tn DeleteSourceInstance
@@ -1801,77 +1942,105 @@
pause KTestDelay
[Endtest]
+
// ---------------------------------------------------------------------------
-// Delete thumbnails by id
+// Run multiple tests
// ---------------------------------------------------------------------------
[Test]
-title Delete thumbnails by id
+title Run misc multiple tests
create ThumbnailManagerTest tn
tn CreateInstanceL
tn SetDisplayModeL EColor16M
-tn SetThumbnailEnumSizeL EImageGridThumbnailSize
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\RGB_VGA.jpg 99999
+// using path
+tn CreateSourceInstancePathL \data\ThumbnailManagerTest\RGB_VGA.jpg
tn DeleteThumbnails
-tn CreateThumbnails
-waittestclass tn
-
-pause KTenSecondDelay
-
-tn SetFlagsL EDoNotCreate
-tn GetThumbnailByIdL 99999
+tn SetThumbnailEnumSizeL EImageGridThumbnailSize
+tn GetThumbnailL
waittestclass tn
tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor16M
+tn DeleteThumbnails
+tn SetThumbnailEnumSizeL EImageFullScreenThumbnailSize
+tn GetThumbnailL
+waittestclass tn
+tn CheckThumbnailCenrepL EImageFullScreenThumbnailSize EColor16M
+tn DeleteThumbnails
+tn SetThumbnailEnumSizeL ECustomThumbnailSize
+tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
+tn GetThumbnailL
+waittestclass tn
+tn CheckThumbnailL KCustomSizeX KCustomSizeY EColor16M
+tn DeleteThumbnails
+tn DeleteSourceInstance
-tn DeleteThumbnailsByIdL 99999
-pause KOneSecondDelay
+// mp3 using handle
+tn CreateSourceInstanceHandleL \data\ThumbnailManagerTest\mp3.mp3
+tn DeleteThumbnails
+tn SetThumbnailEnumSizeL EAudioGridThumbnailSize
+tn GetThumbnailL
+waittestclass tn
+tn CheckThumbnailCenrepL EAudioGridThumbnailSize EColor16M
+tn DeleteThumbnails
+tn SetThumbnailEnumSizeL EAudioFullScreenThumbnailSize
+tn GetThumbnailL
+waittestclass tn
+tn CheckThumbnailCenrepL EAudioFullScreenThumbnailSize EColor16M
+tn DeleteThumbnails
+tn SetThumbnailEnumSizeL ECustomThumbnailSize
+tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
+tn GetThumbnailL
+waittestclass tn
+tn CheckThumbnailL KCustomSizeX KCustomSizeY EColor16M
+tn DeleteThumbnails
+tn DeleteSourceInstance
-tn GetThumbnailByIdL 99999
+// corrupted file
+tn SetThumbnailEnumSizeL ECustomThumbnailSize
+tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
+tn CreateSourceInstancePathL \data\ThumbnailManagerTest\not_jpg.jpg
+tn GetThumbnailL
+allownextresult KErrNotFound
+waittestclass tn
+tn DeleteSourceInstance
+tn CreateSourceInstanceBufferL \data\ThumbnailManagerTest\not_jpg.jpg image/jpeg
+tn GetThumbnailL
+allownextresult KErrNotFound
+waittestclass tn
+tn DeleteSourceInstance
+tn CreateSourceInstancePathL \data\ThumbnailManagerTest\not_3gp.3gp
+tn GetThumbnailL
+allownextresult KErrNotSupported
+waittestclass tn
+tn DeleteSourceInstance
+
+// delete one thumbnail
+tn SetThumbnailEnumSizeL EImageGridThumbnailSize
+tn CreateSourceInstancePathL \data\ThumbnailManagerTest\RGB_VGA.jpg
+tn DeleteThumbnails
+tn GetThumbnailL
+waittestclass tn
+tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor16M
+tn DeleteThumbnails
+pause KTenSecondDelay
+tn SetFlagsL EDoNotCreate
+tn GetThumbnailL
allownextresult KErrNotFound
waittestclass tn
-tn DeleteSourceInstance
-tn DeleteInstance
-delete tn
-pause KTestDelay
-[Endtest]
-
-
-// ---------------------------------------------------------------------------
-// Update path
-// ---------------------------------------------------------------------------
-[Test]
-title Update path
-create ThumbnailManagerTest tn
-tn CreateInstanceL
-tn SetDisplayModeL EColor16M
-
-tn SetThumbnailEnumSizeL EImageGridThumbnailSize
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\RGB_VGA.jpg 99999
-tn DeleteThumbnails
+// delete all persistent thumbnails created
+tn SetFlagsL EDefaultFlags
tn CreateThumbnails
waittestclass tn
-tn DeleteSourceInstance
-
pause KTenSecondDelay
-
-tn UpdatePathL 99999 \data\ThumbnailManagerTest\updated_path.bmp
-
+tn DeleteThumbnails
pause KTenSecondDelay
-
tn SetFlagsL EDoNotCreate
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\RGB_VGA.jpg
tn GetThumbnailL
+allownextresult KErrNotFound
waittestclass tn
+tn DeleteThumbnails
tn DeleteSourceInstance
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\updated_path.bmp 99999
-tn GetThumbnailByIdL 99999
-waittestclass tn
-tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor16M
-tn DeleteSourceInstance
-tn DeleteThumbnailsByIdL 99999
-
tn DeleteInstance
delete tn
pause KTestDelay
@@ -1934,7 +2103,7 @@
tn GetThumbnailL
tn DeleteSourceInstance
-pause KClientServerDelay
+pause KClientServerDelay2
// The server should have the two thumbnail requests queued by now.
// This should cancel the second one while letting the first one finish.
@@ -1968,25 +2137,22 @@
tn DeleteThumbnails
tn DeleteSourceInstance
-// First request with 0 priority
+// First request with 100 priority
tn SetThumbnailSizeL 80 40
tn CreateSourceInstanceHandleL \data\ThumbnailManagerTest\WIDE_800x400.gif
-tn GetThumbnailL 0 0
+tn GetThumbnailL 0 100
tn DeleteSourceInstance
-// Short delay to make sure the server starts processing this request
-pause KClientServerDelay
-
// Second request with negative priority
tn SetThumbnailSizeL 1 1
tn CreateSourceInstanceHandleL \data\ThumbnailManagerTest\TALL_400x800.bmp
-tn GetThumbnailL 0 -10
+tn GetThumbnailL 0 -100
tn DeleteSourceInstance
// Third request with positive priority
tn SetThumbnailSizeL 40 30
tn CreateSourceInstanceHandleL \data\ThumbnailManagerTest\SVG_640x480.svg
-tn GetThumbnailL 0 10
+tn GetThumbnailL 0 0
tn DeleteSourceInstance
// First request should complete first, since the server started processing
@@ -1994,8 +2160,7 @@
waittestclass tn
tn CheckThumbnailL 80 40 EColor16M
-// The third request should finish next, since it had the highest priority of
-// the other tasks.
+// The third request should finish next
waittestclass tn
tn CheckThumbnailL 40 30 EColor16M
@@ -2044,31 +2209,27 @@
tn GetThumbnailL 0 0
tn DeleteSourceInstance
-// Short delay to make sure the server starts processing this request
-pause KClientServerDelay
-
// Second request with negative priority
tn SetThumbnailSizeL 1 1
tn CreateSourceInstanceHandleL \data\ThumbnailManagerTest\TALL_400x800.bmp
-tn GetThumbnailL 0 -10
+tn GetThumbnailL 0 -50
tn DeleteSourceInstance
// Third request with positive priority
tn SetThumbnailSizeL 40 30
tn CreateSourceInstanceHandleL \data\ThumbnailManagerTest\SVG_640x480.svg
-tn GetThumbnailL 0 10
+tn GetThumbnailL 0 50
tn DeleteSourceInstance
// Change the priority of the third request to a low value
-tn ChangePreviousPriority -20
+tn ChangePreviousPriority -100
// First request should complete first, since the server started processing
// it before the other requests were done
waittestclass tn
tn CheckThumbnailL 80 40 EColor16M
-// The second request should finish next, since it had the highest priority of
-// the other tasks.
+// The second request should finish next
waittestclass tn
tn CheckThumbnailL 1 1 EColor16M
@@ -2105,40 +2266,3 @@
pause KTestDelay
[Endtest]
-// ---------------------------------------------------------------------------
-// Create thumbnails using CFbsBitmap
-// ---------------------------------------------------------------------------
-[Test]
-title Create thumbnails using CFbsBitmap
-create ThumbnailManagerTest tn
-tn CreateInstanceL
-tn SetDisplayModeL EColor16M
-
-tn SetFlagsL EDefaultFlags
-tn CreateSourceInstanceBitmapL \data\ThumbnailManagerTest\TestMBM.mbm \data\ThumbnailManagerTest\camera.jpg
-tn DeleteThumbnails
-tn CreateThumbnails
-waittestclass tn
-
-pause KTenSecondDelay
-
-tn SetFlagsL EDoNotCreate
-tn SetThumbnailEnumSizeL EImageGridThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor16M
-tn SetThumbnailEnumSizeL EImageListThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageListThumbnailSize EColor16M
-tn SetThumbnailEnumSizeL EImageFullScreenThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageFullScreenThumbnailSize EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-tn DeleteInstance
-delete tn
-pause KTestDelay
-[Endtest]
Binary file imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/camera.jpg has changed
Binary file imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/exif.jpg has changed
Binary file imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/exif.png has changed
Binary file imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/mp3_png.mp3 has changed
Binary file imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/no_exif.jpg has changed
Binary file imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/wma.wma has changed
Binary file imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/wma_empty.wma has changed
Binary file imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/wma_png.wma has changed
--- a/imagehandling_plat/thumbnailmanager_api/tsrc/group/ThumbnailManagerTest.pkg Wed Jun 23 18:33:48 2010 +0300
+++ b/imagehandling_plat/thumbnailmanager_api/tsrc/group/ThumbnailManagerTest.pkg Tue Jul 06 14:37:18 2010 +0300
@@ -45,4 +45,10 @@
"..\data\mmc\ThumbnailManagerTest\WIDE_800x400.gif" - "e:\testing\data\ThumbnailManagerTest\WIDE_800x400.gif"
"..\data\mmc\ThumbnailManagerTest\TestMBM.mbm" - "e:\testing\data\ThumbnailManagerTest\TestMBM.mbm"
"..\data\mmc\ThumbnailManagerTest\mp3.mp3" - "e:\testing\data\ThumbnailManagerTest\mp3.mp3"
-
+"..\data\mmc\ThumbnailManagerTest\camera.jpg" - "e:\testing\data\ThumbnailManagerTest\camera.jpg"
+"..\data\mmc\ThumbnailManagerTest\mp3_png.mp3" - "e:\testing\data\ThumbnailManagerTest\mp3_png.mp3"
+"..\data\mmc\ThumbnailManagerTest\no_exif.jpg" - "e:\testing\data\ThumbnailManagerTest\no_exif.jpg"
+"..\data\mmc\ThumbnailManagerTest\wma.wma" - "e:\testing\data\ThumbnailManagerTest\wma.wma"
+"..\data\mmc\ThumbnailManagerTest\wma_empty.wma" - "e:\testing\data\ThumbnailManagerTest\wma_empty.wma"
+"..\data\mmc\ThumbnailManagerTest\wma_png.wma" - "e:\testing\data\ThumbnailManagerTest\wma_png.wma"
+"..\data\mmc\ThumbnailManagerTest\exif.jpg" - "e:\testing\data\ThumbnailManagerTest\exif.jpg"
--- a/imagehandling_plat/thumbnailmanager_api/tsrc/group/bld.inf Wed Jun 23 18:33:48 2010 +0300
+++ b/imagehandling_plat/thumbnailmanager_api/tsrc/group/bld.inf Tue Jul 06 14:37:18 2010 +0300
@@ -43,5 +43,11 @@
../data/mmc/ThumbnailManagerTest/WIDE_800x400.gif /epoc32/winscw/c/data/ThumbnailManagerTest/WIDE_800x400.gif
../data/mmc/ThumbnailManagerTest/TestMBM.mbm /epoc32/winscw/c/data/ThumbnailManagerTest/TestMBM.mbm
../data/mmc/ThumbnailManagerTest/mp3.mp3 /epoc32/winscw/c/data/ThumbnailManagerTest/mp3.mp3
-
+../data/mmc/ThumbnailManagerTest/camera.jpg /epoc32/winscw/c/data/ThumbnailManagerTest/camera.jpg
+../data/mmc/ThumbnailManagerTest/mp3_png.mp3 /epoc32/winscw/c/data/ThumbnailManagerTest/mp3_png.mp3
+../data/mmc/ThumbnailManagerTest/no_exif.jpg /epoc32/winscw/c/data/ThumbnailManagerTest/no_exif.jpg
+../data/mmc/ThumbnailManagerTest/wma.wma /epoc32/winscw/c/data/ThumbnailManagerTest/wma.wma
+../data/mmc/ThumbnailManagerTest/wma_empty.wma /epoc32/winscw/c/data/ThumbnailManagerTest/wma_empty.wma
+../data/mmc/ThumbnailManagerTest/wma_png.wma /epoc32/winscw/c/data/ThumbnailManagerTest/wma_png.wma
+../data/mmc/ThumbnailManagerTest/exif.jpg /epoc32/winscw/c/data/ThumbnailManagerTest/exif.jpg
// End of File
--- a/imagehandling_plat/thumbnailmanager_api/tsrc/inc/ThumbnailManagerTest.h Wed Jun 23 18:33:48 2010 +0300
+++ b/imagehandling_plat/thumbnailmanager_api/tsrc/inc/ThumbnailManagerTest.h Tue Jul 06 14:37:18 2010 +0300
@@ -117,6 +117,7 @@
virtual TInt DeleteInstance( CStifItemParser& aItem );
virtual TInt CreateSourceInstancePathL( CStifItemParser& aItem );
+ virtual TInt CreateSourceInstancePathTargetL( CStifItemParser& aItem );
virtual TInt CreateSourceInstanceHandleL( CStifItemParser& aItem );
virtual TInt CreateSourceInstanceBufferL( CStifItemParser& aItem );
virtual TInt CreateSourceInstanceBitmapL( CStifItemParser& aItem );
@@ -146,7 +147,7 @@
virtual TInt CheckDisplayModeL( CStifItemParser& aItem );
virtual TInt DeleteThumbnails( CStifItemParser& aItem );
- virtual TInt DeleteThumbnailsByIdL( CStifItemParser& aItem );
+ virtual TInt CreateThumbnailsByUrlL( CStifItemParser& aItem );
virtual TInt CreateThumbnails( CStifItemParser& aItem );
virtual TInt UpdatePathL( CStifItemParser& aItem );
--- a/imagehandling_plat/thumbnailmanager_api/tsrc/inc/thumbnailcenrep.h Wed Jun 23 18:33:48 2010 +0300
+++ b/imagehandling_plat/thumbnailmanager_api/tsrc/inc/thumbnailcenrep.h Tue Jul 06 14:37:18 2010 +0300
@@ -142,7 +142,7 @@
};
public:
- enum { EUnknownSourceType, EImage, EVideo, EAudio };
+ enum { EUnknownSourceType, EImage, EVideo, EAudio, EContact };
enum { EUnknownSizeType, EGrid, EList, EFullscreen };
public:
@@ -205,7 +205,10 @@
TBool iVideoFullscreen;
TBool iAudioGrid;
TBool iAudioList;
- TBool iAudioFullscreen;
+ TBool iAudioFullscreen;
+ TBool iContactGrid;
+ TBool iContactList;
+ TBool iContactFullscreen;
};
#endif // THUMBNAILCENREP_H
--- a/imagehandling_plat/thumbnailmanager_api/tsrc/src/ThumbnailManagerTestBlocks.cpp Wed Jun 23 18:33:48 2010 +0300
+++ b/imagehandling_plat/thumbnailmanager_api/tsrc/src/ThumbnailManagerTestBlocks.cpp Tue Jul 06 14:37:18 2010 +0300
@@ -67,6 +67,7 @@
ENTRY( "CheckThumbnailSizeL", CThumbnailManagerTest::CheckThumbnailSizeL ),
ENTRY( "SetThumbnailEnumSizeL", CThumbnailManagerTest::SetThumbnailEnumSizeL ),
ENTRY( "CreateSourceInstancePathL", CThumbnailManagerTest::CreateSourceInstancePathL ),
+ ENTRY( "CreateSourceInstancePathTargetL", CThumbnailManagerTest::CreateSourceInstancePathTargetL ),
ENTRY( "CreateSourceInstanceHandleL", CThumbnailManagerTest::CreateSourceInstanceHandleL ),
ENTRY( "CreateSourceInstanceBufferL", CThumbnailManagerTest::CreateSourceInstanceBufferL ),
ENTRY( "CreateSourceInstanceBitmapL", CThumbnailManagerTest::CreateSourceInstanceBitmapL ),
@@ -87,7 +88,7 @@
ENTRY( "SetDisplayModeL", CThumbnailManagerTest::SetDisplayModeL ),
ENTRY( "CheckDisplayModeL", CThumbnailManagerTest::CheckDisplayModeL ),
ENTRY( "DeleteThumbnails", CThumbnailManagerTest::DeleteThumbnails ),
- ENTRY( "DeleteThumbnailsByIdL", CThumbnailManagerTest::DeleteThumbnailsByIdL ),
+ ENTRY( "CreateThumbnailsByUrlL", CThumbnailManagerTest::CreateThumbnailsByUrlL ),
ENTRY( "CreateThumbnails", CThumbnailManagerTest::CreateThumbnails ),
ENTRY( "UpdatePathL", CThumbnailManagerTest::UpdatePathL ),
ENTRY( "GetSupportedMimeTypesL", CThumbnailManagerTest::GetSupportedMimeTypesL )
@@ -300,6 +301,53 @@
return KErrNone;
}
+TInt CThumbnailManagerTest::CreateSourceInstancePathTargetL( CStifItemParser& aItem )
+ {
+ _LIT( KPanicTxt, "CreateSrcPathTarget" );
+ __ASSERT_ALWAYS( !iObjectSource, User::Panic( KPanicTxt, 0 ));
+
+ TPtrC path;
+ User::LeaveIfError( aItem.GetNextString( path ));
+
+ TPtrC target;
+ User::LeaveIfError( aItem.GetNextString( target ));
+
+ TPtrC mimeType;
+ User::LeaveIfError( aItem.GetNextString( mimeType ));
+
+ TInt virtual1 = 0;
+ aItem.GetNextInt( virtual1 );
+
+ TInt virtual2 = 0;
+ aItem.GetNextInt( virtual2 );
+
+ TFileName filePath( iDataPath );
+ filePath.Append( path );
+ filePath.ZeroTerminate();
+
+ if (virtual1)
+ {
+ filePath.Delete(2,1);
+ }
+
+ TFileName targetPath( iDataPath );
+ targetPath.Append( target );
+ targetPath.ZeroTerminate();
+
+ if (virtual2)
+ {
+ targetPath.Delete(2,1);
+ }
+
+ iLog->Log( _L( "CreateSourceInstancePathTargetL - path = %S, target = %S" ), &filePath );
+
+ delete iObjectSource;
+ iObjectSource = NULL;
+
+ iObjectSource = CThumbnailObjectSource::NewL( filePath, targetPath, mimeType );
+ return KErrNone;
+ }
+
TInt CThumbnailManagerTest::CreateSourceInstanceHandleL( CStifItemParser& aItem )
{
_LIT( KPanicTxt, "CreateSrcHandle" );
@@ -627,6 +675,7 @@
TInt CThumbnailManagerTest::CheckThumbnailCenrepL( CStifItemParser& aItem )
{
TInt err = KErrNone;
+ TBool full = EFalse;
TInt sizeType;
TInt displaymode = 0;
@@ -634,6 +683,12 @@
User::LeaveIfError( aItem.GetNextInt( displaymode ));
TThumbnailSize size = (TThumbnailSize)sizeType;
+ if (size == EImageFullScreenThumbnailSize ||
+ size == EVideoFullScreenThumbnailSize ||
+ size == EAudioFullScreenThumbnailSize)
+ {
+ full = ETrue;
+ }
if ( iThumbnail )
{
@@ -663,6 +718,10 @@
{
iLog->Log( _L( "CheckThumbnailCenrepL - ok" ));
}
+ else if (full && (thumbSize.iWidth <= width && thumbSize.iHeight <= height))
+ {
+ iLog->Log( _L( "CheckThumbnailCenrepL - fullscreen ok, not upscaled" ));
+ }
else
{
iLog->Log( _L( "CheckThumbnailCenrepL - size mismatch" ));
@@ -724,12 +783,42 @@
return KErrNone;
}
-TInt CThumbnailManagerTest::DeleteThumbnailsByIdL( CStifItemParser& aItem )
+TInt CThumbnailManagerTest::CreateThumbnailsByUrlL( CStifItemParser& aItem )
{
+ _LIT( KPanicTxt, "CreateSrcPath" );
+ __ASSERT_ALWAYS( !iObjectSource, User::Panic( KPanicTxt, 0 ));
+
+ TPtrC path;
+ User::LeaveIfError( aItem.GetNextString( path ));
+
TInt id = 0;
- User::LeaveIfError( aItem.GetNextInt( id ));
+ aItem.GetNextInt( id );
+
+ TFileName filePath( iDataPath );
+ filePath.Append( path );
+ filePath.ZeroTerminate();
+
+ iLog->Log( _L( "CreateSourceInstancePathL - path = %S" ), &filePath );
+
+ delete iObjectSource;
+ iObjectSource = NULL;
+
+ iObjectSource = CThumbnailObjectSource::NewL( filePath, id );
- iEngine->DeleteThumbnails( id );
+ id = iEngine->CreateThumbnails( *iObjectSource );
+ if (id < 0)
+ {
+ iLog->Log( _L( "CreateThumbnails - error %d" ), id );
+ return id;
+ }
+ else
+ {
+ iPreviousRequestId = id;
+ iLog->Log( _L( "CreateThumbnails - request id %d" ), iPreviousRequestId );
+ }
+
+ iCreateThumbnails = ETrue;
+
return KErrNone;
}
--- a/imagehandling_plat/thumbnailmanager_api/tsrc/src/thumbnailcenrep.cpp Wed Jun 23 18:33:48 2010 +0300
+++ b/imagehandling_plat/thumbnailmanager_api/tsrc/src/thumbnailcenrep.cpp Tue Jul 06 14:37:18 2010 +0300
@@ -42,6 +42,12 @@
const TUint32 KSizeAudioListHeight = 0x15;
const TUint32 KSizeAudioFullscreenWidth = 0x16;
const TUint32 KSizeAudioFullscreenHeight = 0x17;
+const TUint32 KSizeContactListWidth = 0x18;
+const TUint32 KSizeContactListHeight = 0x19;
+const TUint32 KSizeContactGridWidth = 0x20;
+const TUint32 KSizeContactGridHeight = 0x21;
+const TUint32 KSizeContactFullscreenWidth = 0x22;
+const TUint32 KSizeContactFullscreenHeight = 0x23;
const TUint32 KAutoCreateImageGrid = 0x100;
const TUint32 KAutoCreateImageList = 0x101;
@@ -52,6 +58,9 @@
const TUint32 KAutoCreateAudioGrid = 0x106;
const TUint32 KAutoCreateAudioList = 0x107;
const TUint32 KAutoCreateAudioFullscreen = 0x108;
+const TUint32 KAutoCreateContactGrid = 0x109;
+const TUint32 KAutoCreateContactList = 0x110;
+const TUint32 KAutoCreateContactFullscreen = 0x111;
// ---------------------------------------------------------------------------
@@ -94,6 +103,11 @@
case EAudioFullScreenThumbnailSize:
iSourceType = EAudio;
break;
+ case EContactGridThumbnailSize:
+ case EContactListThumbnailSize:
+ case EContactFullScreenThumbnailSize:
+ iSourceType = EContact;
+ break;
default:
iSourceType = EUnknownSourceType;
}
@@ -107,7 +121,8 @@
TThumbnailAutoCreate::TThumbnailAutoCreate()
: iImageGrid(EFalse), iImageList(EFalse), iImageFullscreen(EFalse),
iVideoGrid(EFalse), iVideoList(EFalse), iVideoFullscreen(EFalse),
- iAudioGrid(EFalse), iAudioList(EFalse), iAudioFullscreen(EFalse)
+ iAudioGrid(EFalse), iAudioList(EFalse), iAudioFullscreen(EFalse),
+ iContactGrid(EFalse), iContactList(EFalse), iContactFullscreen(EFalse)
{
// No implementation required
}
@@ -164,7 +179,7 @@
TInt ySize( 0 );
TBool flags( EFalse );
const TBool KGridAndListThumbnailCropped = ETrue;
- TInt raw_mode( EColor16M ); // always 16-bit
+ TInt raw_mode( EColor64K );
TInt format( 0 );
TBool autoCreate( EFalse );
@@ -230,6 +245,27 @@
iPersistentSizes.AppendL( TThumbnailPersistentSize( EAudioFullScreenThumbnailSize, TSize( xSize, ySize ),
flags, static_cast <TDisplayMode> (raw_mode), format, autoCreate ));
+
+ User::LeaveIfError( iRepository->Get( KSizeContactGridWidth, xSize ));
+ User::LeaveIfError( iRepository->Get( KSizeContactGridHeight, ySize ));
+ User::LeaveIfError( iRepository->Get( KAutoCreateContactGrid, autoCreate ));
+
+ iPersistentSizes.AppendL( TThumbnailPersistentSize( EContactGridThumbnailSize, TSize( xSize, ySize ),
+ KGridAndListThumbnailCropped, static_cast <TDisplayMode> (raw_mode), format, autoCreate ));
+
+ User::LeaveIfError( iRepository->Get( KSizeContactListWidth, xSize ));
+ User::LeaveIfError( iRepository->Get( KSizeContactListHeight, ySize ));
+ User::LeaveIfError( iRepository->Get( KAutoCreateContactList, autoCreate ));
+
+ iPersistentSizes.AppendL( TThumbnailPersistentSize( EContactListThumbnailSize, TSize( xSize, ySize ),
+ KGridAndListThumbnailCropped, static_cast <TDisplayMode> (raw_mode), format, autoCreate ));
+
+ User::LeaveIfError( iRepository->Get( KSizeContactFullscreenWidth, xSize ));
+ User::LeaveIfError( iRepository->Get( KSizeContactFullscreenHeight, ySize ));
+ User::LeaveIfError( iRepository->Get( KAutoCreateContactFullscreen, autoCreate ));
+
+ iPersistentSizes.AppendL( TThumbnailPersistentSize( EContactFullScreenThumbnailSize, TSize( xSize, ySize ),
+ flags, static_cast <TDisplayMode> (raw_mode), format, autoCreate ));
iAutoCreate = new (ELeave) TThumbnailAutoCreate();
@@ -242,6 +278,9 @@
User::LeaveIfError( iRepository->Get( KAutoCreateAudioGrid, iAutoCreate->iAudioGrid ));
User::LeaveIfError( iRepository->Get( KAutoCreateAudioList, iAutoCreate->iAudioList ));
User::LeaveIfError( iRepository->Get( KAutoCreateAudioFullscreen, iAutoCreate->iAudioFullscreen ));
+ User::LeaveIfError( iRepository->Get( KAutoCreateContactGrid, iAutoCreate->iContactGrid ));
+ User::LeaveIfError( iRepository->Get( KAutoCreateContactList, iAutoCreate->iContactList ));
+ User::LeaveIfError( iRepository->Get( KAutoCreateContactFullscreen, iAutoCreate->iContactFullscreen ));
}
// ---------------------------------------------------------------------------
Binary file imagehandlingutilities/thumbnailmanager/conf/102830B0.txt has changed
Binary file imagehandlingutilities/thumbnailmanager/conf/thumbnailmanager.confml has changed
Binary file imagehandlingutilities/thumbnailmanager/conf/thumbnailmanager_102830B0.crml has changed
--- a/imagehandlingutilities/thumbnailmanager/inc/thumbnailmanagerconstants.h Wed Jun 23 18:33:48 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/inc/thumbnailmanagerconstants.h Tue Jul 06 14:37:18 2010 +0300
@@ -53,10 +53,10 @@
//actual batch size will vary and will be between min...max batch size values below
//minimum batch size
-const TUint KMInBatchItems = 3;
+const TUint KMInBatchItems = 6;
//maximum batch size
const TUint KMaxBatchItems = 60;
-//Max allowed flush time
+//Max allowed flush time ms
const TUint KMaxFlushDelay = 3000; // 3 sec
//Max allowed flush time on MTP/music collection refresh
const TUint KMaxMTPFlushDelay = 15000; // 15 seconds
@@ -149,43 +149,48 @@
const TInt KImeiBufferSize = CTelephony::KPhoneSerialNumberSize;
const TInt KCheckValue = 123456;
-_LIT8( KJpegMime, "image/jpeg" ); _LIT( KJpegExt, ".jpeg" );
-_LIT8( KJpeg2000Mime, "image/jp2" ); _LIT( KJpeg2000Ext, ".jp2" );
-_LIT8( KJpgMime, "image/jpeg" ); _LIT( KJpgExt, ".jpg" );
-_LIT8( KGifMime, "image/gif" ); _LIT( KGifExt, ".gif" );
-_LIT8( KPngMime, "image/png" ); _LIT( KPngExt, ".png" );
-_LIT8( KSvgMime, "image/svg+xml" ); _LIT( KSvgExt, ".svg" );
-_LIT8( KMpgMime1, "video/mpeg"); _LIT( KMpgExt1, ".mpg" );
-_LIT8( KMpeg4Mime, "video/mpeg4" ); _LIT( KMpeg4Ext,".mpeg4" );
-_LIT8( KMp4Mime, "video/mp4" ); _LIT( KMp4Ext, ".mp4" );
-_LIT8( KAviMime, "video/x-msvideo" ); _LIT( KAviExt, ".avi" );
-_LIT8( KMp3Mime, "audio/mpeg" ); _LIT( KMp3Ext, ".mp3" );
-_LIT8( KNonEmbeddArtMime, "audio/mpeg" ); _LIT( KNonEmbeddArtExt, ".alb" );
-_LIT8( KM4aMime, "audio/mp4" ); _LIT( KM4aExt, ".m4a" );
-_LIT8( KAacMime, "audio/aac" ); _LIT( KAacExt, ".aac" );
-_LIT8( KWmaMime, "audio/x-ms-wma" ); _LIT( KWmaExt, ".wma" );
-_LIT8( KBmpMime, "image/bmp" ); _LIT( KBmpExt, ".bmp" );
-_LIT8( KAudio3gppMime, "audio/3gpp" );
-_LIT8( KVideo3gppMime, "video/3gpp" ); _LIT( K3gpExt, ".3gp" ); _LIT( K3gppExt, ".3gpp" );
-_LIT8( KAudioAmrMime, "audio/AMR" ); _LIT( KAmrExt, ".amr" );
-_LIT8( KVideoWmvMime, "video/x-ms-wmv" ); _LIT( KWmvExt, ".wmv" );
-_LIT8( KRealAudioMime, "audio/vnd.rn-realaudio" ); _LIT( KRealAudioExt, ".ra" );
-_LIT8( KPmRealAudioPluginMime, "audio/x-pn-realaudio-plugin" ); _LIT( KPmRealAudioPluginExt, ".rpm" );
-_LIT8( KPmRealVideoPluginMime, "video/x-pn-realvideo" ); _LIT( KPmRealVideoPluginExt, ".rm" );
-_LIT8( KPmRealVbVideoPluginMime, "video/x-pn-realvideo" ); _LIT( KPmRealVbVideoPluginExt, ".rmvb" );
-_LIT8( KPmRealAudioMime, "audio/x-pn-realaudio" ); _LIT( KPmRealAudioExt, ".ra" );
-_LIT8( KRealVideoMime, "video/vnd.rn-realvideo" ); _LIT( KRealVideoExt, ".rv" );
-_LIT8( KFlashVideoMime, "video/x-flv" ); _LIT( KFlashVideoExt, ".flv" );
-_LIT8( KMatroskaVideoMime, "video/x-matroska" ); _LIT( KMatroskaVideoExt, ".mkv" );
+_LIT8( KJpegMime, "image/jpeg" ); _LIT( KJpegExt, ".jpeg" );
+_LIT8( KJpeg2000Mime, "image/jp2" ); _LIT( KJpeg2000Ext, ".jp2" );
+_LIT8( KJpgMime, "image/jpeg" ); _LIT( KJpgExt, ".jpg" );
+_LIT8( KGifMime, "image/gif" ); _LIT( KGifExt, ".gif" );
+_LIT8( KPngMime, "image/png" ); _LIT( KPngExt, ".png" );
+_LIT8( KSvgMime, "image/svg+xml" ); _LIT( KSvgExt, ".svg" );
+_LIT8( KMpgMime1, "video/mpeg"); _LIT( KMpgExt1, ".mpg" );
+_LIT8( KMpeg4Mime, "video/mpeg4" ); _LIT( KMpeg4Ext,".mpeg4" );
+_LIT8( KMp4Mime, "video/mp4" ); _LIT( KMp4Ext, ".mp4" ); _LIT( KM4vExt, ".m4v" );
+_LIT8( KAviMime, "video/x-msvideo" ); _LIT( KAviExt, ".avi" );
+_LIT8( KMp3Mime, "audio/mpeg" ); _LIT( KMp3Ext, ".mp3" );
+_LIT8( KNonEmbeddArtMime, "audio/mpeg" ); _LIT( KNonEmbeddArtExt, ".alb" );
+_LIT8( KM4aMime, "audio/mp4" ); _LIT( KM4aExt, ".m4a" );
+_LIT8( KAacMime, "audio/aac" ); _LIT( KAacExt, ".aac" );
+_LIT8( KWmaMime, "audio/x-ms-wma" ); _LIT( KWmaExt, ".wma" );
+_LIT8( KBmpMime, "image/bmp" ); _LIT( KBmpExt, ".bmp" );
+_LIT8( KAudio3gppMime, "audio/3gpp" );
+_LIT8( KVideo3gppMime, "video/3gpp" ); _LIT( K3gpExt, ".3gp" ); _LIT( K3gppExt, ".3gpp" );
+_LIT8( KAudioAmrMime, "audio/AMR" ); _LIT( KAmrExt, ".amr" );
+_LIT8( KVideoWmvMime, "video/x-ms-wmv" ); _LIT( KWmvExt, ".wmv" );
+_LIT8( KRealAudioMime, "audio/vnd.rn-realaudio" ); _LIT( KRealAudioExt, ".ra" );
+_LIT8( KPmRealAudioPluginMime, "audio/x-pn-realaudio-plugin" ); _LIT( KPmRealAudioPluginExt, ".rpm" );
+_LIT8( KPmRealVideoPluginMime, "video/x-pn-realvideo" ); _LIT( KPmRealVideoPluginExt, ".rm" );
+_LIT8( KPmRealVbVideoPluginMime, "video/x-pn-realvideo" ); _LIT( KPmRealVbVideoPluginExt, ".rmvb" );
+_LIT8( KPmRealAudioMime, "audio/x-pn-realaudio" ); _LIT( KPmRealAudioExt, ".ra" );
+_LIT8( KRealVideoMime, "video/vnd.rn-realvideo" ); _LIT( KRealVideoExt, ".rv" );
+_LIT8( KFlashVideoMime, "video/x-flv" ); _LIT( KFlashVideoExt, ".flv" );
+_LIT8( KMatroskaVideoMime, "video/x-matroska" ); _LIT( KMatroskaVideoExt, ".mkv" );
+_LIT8( KContactMime, "contact/x-vcard" ); _LIT( KContactExt, ".vcf" );
+_LIT( KNonEmbeddedArtExt, ".alb" );
_LIT( KImageMime, "image/*" );
_LIT( KVideoMime, "video/*" );
_LIT( KAudioMime, "audio/*" );
-_LIT( KM4vExt, ".m4v" );
-_LIT( KNonEmbeddedArtExt, ".alb" );
_LIT( KPrivateFolder, ":\\private\\");
_LIT( KSysFolder, ":\\sys\\");
+_LIT( KDrv, ":");
+_LIT( KBackSlash, "\\");
+
+const TInt KExtLength = 4;
+
/**
* Control flags set by the server for handling specific situations
* (for example for distinguishing between preview thumbnails and
@@ -316,6 +321,16 @@
* Overwrite old thumbs (SetThumbnailL)
*/
TBool iOverwrite;
+
+ /**
+ * URI is virtual
+ */
+ TBool iVirtualUri;
+
+ /**
+ * Target differs from source
+ */
+ TBool iImport;
};
--- a/imagehandlingutilities/thumbnailmanager/inc/thumbnailmanagerprivatecrkeys.h Wed Jun 23 18:33:48 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/inc/thumbnailmanagerprivatecrkeys.h Tue Jul 06 14:37:18 2010 +0300
@@ -44,6 +44,12 @@
const TUint32 KSizeAudioListHeight = 0x15;
const TUint32 KSizeAudioFullscreenWidth = 0x16;
const TUint32 KSizeAudioFullscreenHeight = 0x17;
+const TUint32 KSizeContactListWidth = 0x18;
+const TUint32 KSizeContactListHeight = 0x19;
+const TUint32 KSizeContactGridWidth = 0x20;
+const TUint32 KSizeContactGridHeight = 0x21;
+const TUint32 KSizeContactFullscreenWidth = 0x22;
+const TUint32 KSizeContactFullscreenHeight = 0x23;
const TUint32 KAutoCreateImageGrid = 0x100;
const TUint32 KAutoCreateImageList = 0x101;
@@ -54,6 +60,9 @@
const TUint32 KAutoCreateAudioGrid = 0x106;
const TUint32 KAutoCreateAudioList = 0x107;
const TUint32 KAutoCreateAudioFullscreen = 0x108;
+const TUint32 KAutoCreateContactGrid = 0x109;
+const TUint32 KAutoCreateContactList = 0x110;
+const TUint32 KAutoCreateContactFullscreen = 0x111;
const TUint32 KColorDepthGrid = 0x200;
const TUint32 KColorDepthList = 0x201;
Binary file imagehandlingutilities/thumbnailmanager/sis/thumbnailmanager/ThumbnailManager_0x102830AB_v10.10.7_SA_S60.50_Euro1.sis has changed
Binary file imagehandlingutilities/thumbnailmanager/sis/thumbnailmanager/ThumbnailManager_0x102830AB_v10.10.8_SA_S60.50_Euro1.sis has changed
--- a/imagehandlingutilities/thumbnailmanager/sis/thumbnailmanager/package.pkg Wed Jun 23 18:33:48 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/sis/thumbnailmanager/package.pkg Tue Jul 06 14:37:18 2010 +0300
@@ -17,7 +17,7 @@
&EN
; Header
-#{"Thumbnail Manager"},(0x102830AB), 10, 10, 7, TYPE=SA, RU
+#{"Thumbnail Manager"},(0x102830AB), 10, 10, 8, TYPE=SA, RU
; Localised Vendor name
%{"Nokia"}
--- a/imagehandlingutilities/thumbnailmanager/sis/thumbnailmanager/stub.pkg Wed Jun 23 18:33:48 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/sis/thumbnailmanager/stub.pkg Tue Jul 06 14:37:18 2010 +0300
@@ -17,7 +17,7 @@
&EN
; Header
-#{"ThumbnailManager"},(0x102830AB), 10, 10, 7, TYPE=SA
+#{"ThumbnailManager"},(0x102830AB), 10, 10, 8, TYPE=SA
; Localised Vendor name
%{"Nokia"}
Binary file imagehandlingutilities/thumbnailmanager/sis/thumbnailmanager/thumbnailmanager_stub.sis has changed
--- a/imagehandlingutilities/thumbnailmanager/sis/thumbnailmanagercenrep/package.pkg Wed Jun 23 18:33:48 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/sis/thumbnailmanagercenrep/package.pkg Tue Jul 06 14:37:18 2010 +0300
@@ -17,7 +17,7 @@
&EN
; Header
-#{"Thumbnail Manager Cenrep"},(0x10202BE9), 10, 10, 7, TYPE=SP
+#{"Thumbnail Manager Cenrep"},(0x10202BE9), 10, 10, 8, TYPE=SP
; Localised Vendor name
%{"Symbian Software Ltd."}
--- a/imagehandlingutilities/thumbnailmanager/thumbagdaemon/inc/thumbagprocessor.h Wed Jun 23 18:33:48 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbagdaemon/inc/thumbagprocessor.h Tue Jul 06 14:37:18 2010 +0300
@@ -205,8 +205,9 @@
* QueryPlaceholdersL
*
* @since S60 v5.0
+ * @param aPresent item should not be present item
*/
- void QueryPlaceholdersL();
+ void QueryPlaceholdersL(const TBool aPresent);
/**
* DeleteAndCancelQuery
--- a/imagehandlingutilities/thumbnailmanager/thumbagdaemon/src/thumbagaudioobserver.cpp Wed Jun 23 18:33:48 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbagdaemon/src/thumbagaudioobserver.cpp Tue Jul 06 14:37:18 2010 +0300
@@ -272,7 +272,7 @@
}
#ifdef _DEBUG
- TN_DEBUG3( "CThumbAGImageObserver::IN-COUNTERS---------- Add = %d Modify = %d", iAddCounter, iModCounter );
+ TN_DEBUG3( "CThumbAGAudioObserver::IN-COUNTERS---------- Add = %d Modify = %d", iAddCounter, iModCounter );
iModCounter = 0;
iAddCounter = 0;
#endif
--- a/imagehandlingutilities/thumbnailmanager/thumbagdaemon/src/thumbagcameraobserver.cpp Wed Jun 23 18:33:48 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbagdaemon/src/thumbagcameraobserver.cpp Tue Jul 06 14:37:18 2010 +0300
@@ -263,7 +263,7 @@
}
#ifdef _DEBUG
- TN_DEBUG3( "CThumbAGImageObserver::IN-COUNTERS---------- Add = %d Modify = %d", iAddCounter, iModCounter );
+ TN_DEBUG3( "CThumbAGCameraObserver::IN-COUNTERS---------- Add = %d Modify = %d", iAddCounter, iModCounter );
iModCounter = 0;
iAddCounter = 0;
#endif
--- a/imagehandlingutilities/thumbnailmanager/thumbagdaemon/src/thumbagprocessor.cpp Wed Jun 23 18:33:48 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbagdaemon/src/thumbagprocessor.cpp Tue Jul 06 14:37:18 2010 +0300
@@ -83,7 +83,7 @@
// set auto create values from cenrep
CheckAutoCreateValuesL();
- iPeriodicTimer = CPeriodic::NewL(CActive::EPriorityIdle);
+ iPeriodicTimer = CPeriodic::NewL(CActive::EPriorityStandard);
iMountTimer = CPeriodic::NewL(CActive::EPriorityUserInput);
@@ -608,7 +608,7 @@
item.iItemId = aIDArray[i];
item.iItemType = aItemType;
- SetGenerationItemType(item, aItemType);
+ SetGenerationItemAction(item, aItemType);
if(iPHHarvesting)
{
@@ -629,6 +629,7 @@
{
TThumbnailGenerationItem item;
item.iItemId = aIDArray[i];
+ item.iItemType = aItemType;
TInt itemIndex = iGenerationQueue.FindInOrder(item, Compare);
@@ -642,7 +643,7 @@
TN_DEBUG1( "CThumbAGProcessor::AddToQueueL() - append");
item.iPlaceholder = EFalse;
- SetGenerationItemType( item, 0 );
+ SetGenerationItemAction( item, aItemType );
AppendProcessingQueue( item );
}
}
@@ -657,6 +658,7 @@
{
TThumbnailGenerationItem item;
item.iItemId = aIDArray[i];
+ item.iItemType = aItemType;
itemIndex = iGenerationQueue.FindInOrder(item, Compare);
@@ -677,7 +679,7 @@
else
{
TN_DEBUG1( "CThumbAGProcessor::AddToQueueL() - append");
- SetGenerationItemType( item, 0 );
+ SetGenerationItemAction( item, aItemType);
item.iPlaceholder = EFalse;
AppendProcessingQueue( item );
}
@@ -692,6 +694,7 @@
{
TThumbnailGenerationItem item;
item.iItemId = aIDArray[i];
+ item.iItemType = aItemType;
TInt itemIndex = iGenerationQueue.FindInOrder(item, Compare);
@@ -998,7 +1001,7 @@
// ---------------------------------------------------------------------------
//
-void CThumbAGProcessor::QueryPlaceholdersL()
+void CThumbAGProcessor::QueryPlaceholdersL(TBool aPresent)
{
TN_DEBUG1( "CThumbAGProcessor::QueryPlaceholdersL" );
@@ -1040,15 +1043,15 @@
CMdEObjectCondition& imagePHObjectCondition = rootCondition.AddObjectConditionL(imageObjDef);
imagePHObjectCondition.SetPlaceholderOnly( ETrue );
- imagePHObjectCondition.SetNotPresent( ETrue );
+ imagePHObjectCondition.SetNotPresent( aPresent );
CMdEObjectCondition& videoPHObjectCondition = rootCondition.AddObjectConditionL(videoObjDef);
videoPHObjectCondition.SetPlaceholderOnly( ETrue );
- videoPHObjectCondition.SetNotPresent( ETrue );
+ videoPHObjectCondition.SetNotPresent( aPresent );
CMdEObjectCondition& audioPHObjectCondition = rootCondition.AddObjectConditionL(audioObjDef);
audioPHObjectCondition.SetPlaceholderOnly( ETrue );
- audioPHObjectCondition.SetNotPresent( ETrue );
+ audioPHObjectCondition.SetNotPresent( aPresent );
iQueryPlaceholders->FindL(KMaxTInt, KMaxQueryBatchSize);
@@ -1087,7 +1090,8 @@
iGenerationQueue.Reset();
iQueryQueue.Reset();
- TRAP_IGNORE(QueryPlaceholdersL());
+ //query all not present placeholders
+ TRAP_IGNORE(QueryPlaceholdersL( ETrue ));
//query all items after PH query
iDoQueryAllItems = ETrue;
TN_DEBUG1( "CThumbAGProcessor::RunL() - Initialisation 1 done" );
@@ -1112,7 +1116,7 @@
if( err == KErrNone )
{
TN_DEBUG1( "CThumbAGProcessor::RunL() add iHarvesterClient observer");
- err = iHarvesterClient.AddHarvesterEventObserver( *this, EHEObserverTypeOverall | EHEObserverTypeMMC | EHEObserverTypePlaceholder, 10 );
+ err = iHarvesterClient.AddHarvesterEventObserver( *this, EHEObserverTypeOverall | EHEObserverTypeMMC | EHEObserverTypePlaceholder, 20 );
TN_DEBUG2( "CThumbAGProcessor::RunL() iHarvesterClient observer err = %d", err);
if( !err )
@@ -1213,7 +1217,9 @@
{
TInt err(KErrNone);
//if force or non forced
- if((iForceRun && iModify ) || (!iForceRun && !iModify ))
+ //if unknown items or mount timer is active, abort processing
+
+ if(((iForceRun && iModify ) || (!iForceRun && !iModify )) && !iUnknownItemCount && !iMountTimer->IsActive())
{
TN_DEBUG1( "CThumbAGProcessor::RunL() - iQueryReady START" );
@@ -1239,7 +1245,8 @@
//force is coming, but executing non-forced query complete-> cancel old
else
{
- //cancel query and move items back to original processing queue
+ //cancel query
+ TN_DEBUG1( "CThumbAGProcessor::RunL() - cancel processing query" );
DeleteAndCancelQuery( ETrue );
ActivateAO();
return;
@@ -1483,7 +1490,9 @@
else
{
TN_DEBUG1( "CThumbAGProcessor::HarvestingUpdated -- MDS placeholder harvesting finished");
- TRAP_IGNORE(QueryPlaceholdersL());
+ //query present placeholders
+ TRAP_IGNORE(QueryPlaceholdersL( EFalse ));
+ iDoQueryAllItems = EFalse;
iPHHarvestingItemsLeftTemp = 0;
}
}
@@ -1584,6 +1593,11 @@
}
else
{
+ //activate timeout if overall harvesting is not active
+ if(!iHarvesting)
+ {
+ StartTimeout();
+ }
TN_DEBUG1( "CThumbAGProcessor::HarvestingUpdated -- MDS MMC harvesting finished ");
}
}
@@ -1629,6 +1643,7 @@
//
void CThumbAGProcessor::CancelTimeout()
{
+ TN_DEBUG1( "CThumbAGProcessor::CancelTimeout()");
if(iPeriodicTimer->IsActive())
{
iPeriodicTimer->Cancel();
@@ -1671,7 +1686,6 @@
return;
}
-
//check if forced run needs to continue
if ( iModifyItemCount || iUnknownItemCount > 0 )
{
@@ -2097,6 +2111,10 @@
{
daemonProcessing = ETrue;
}
+ else
+ {
+ daemonProcessing = EFalse;
+ }
if( daemonProcessing != iPreviousDaemonProcessing)
{
@@ -2156,7 +2174,7 @@
for(TInt i=0; i < iGenerationQueue.Count(); i++)
{
- TThumbnailGenerationItem& item = iGenerationQueue[i];
+ TThumbnailGenerationItem& item = iGenerationQueue[i];
if(item.iItemAction == EGenerationItemActionModify)
{
@@ -2204,6 +2222,8 @@
TN_DEBUG2( "CThumbAGProcessor::UpdateItemCounts() iActiveCount = %d",
iActiveCount);
+ TN_DEBUG2( "CThumbAGProcessor::UpdateItemCounts() iPreviousItemsLeft = %d",
+ iPreviousItemsLeft);
TN_DEBUG5( "CThumbAGProcessor::UpdateItemCounts() iHarvesting == %d, iMMCHarvesting == %d, iPHHarvesting == %d, iMPXHarvesting == %d",
iHarvesting, iMMCHarvesting, iPHHarvesting, iMPXHarvesting);
TN_DEBUG5( "CThumbAGProcessor::UpdateItemCounts() iIdle = %d, iForegroundRun = %d, timer = %d, iForceRun = %d",
@@ -2211,7 +2231,7 @@
TN_DEBUG4( "CThumbAGProcessor::UpdateItemCounts() iModify = %d, iQueryReady = %d, iProcessingCount = %d",
iModify, iQueryReady, iProcessingCount);
TN_DEBUG2( "CThumbAGProcessor::UpdateItemCounts() iMountTimer = %d", iMountTimer->IsActive());
- TN_DEBUG3( "CThumbAGProcessor::UpdateItemCounts() ProcessingQueue = %d, iQueryQueue = %d",
+ TN_DEBUG3( "CThumbAGProcessor::UpdateItemCounts() iGenerationQueue = %d, iQueryQueue = %d",
iGenerationQueue.Count(), iQueryQueue.Count());
TN_DEBUG5( "CThumbAGProcessor::UpdateItemCounts() iAddItemCount=%d, i2ndAddItemCount=%d, iModifyItemCount=%d, iDeleteItemCount=%d",
iAddItemCount, i2ndAddItemCount, iModifyItemCount, iDeleteItemCount );
@@ -2220,6 +2240,17 @@
TN_DEBUG4( "CThumbAGProcessor::UpdateItemCounts() iAudioItemCount=%d, iVideoItemCount=%d, iImageItemCount=%d",
iAudioItemCount, iVideoItemCount, iImageItemCount);
TN_DEBUG2( "CThumbAGProcessor::UpdateItemCounts() iCameraItemCount=%d", iCameraItemCount);
+
+ //compress queues when empty
+ if(!iGenerationQueue.Count())
+ {
+ iGenerationQueue.Compress();
+ }
+
+ if(!iQueryQueue.Count())
+ {
+ iQueryQueue.Compress();
+ }
}
@@ -2233,6 +2264,12 @@
CThumbAGProcessor* self = static_cast<CThumbAGProcessor*>( aAny );
self->iMountTimer->Cancel();
+
+ //activate timeout if overall or mmc harvestig is not active
+ if(!self->iHarvesting && !self->iMMCHarvesting )
+ {
+ self->ActivateAO();
+ }
return KErrNone; // Return value ignored by CPeriodic
}
--- a/imagehandlingutilities/thumbnailmanager/thumbagdaemon/src/thumbagvideoobserver.cpp Wed Jun 23 18:33:48 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbagdaemon/src/thumbagvideoobserver.cpp Tue Jul 06 14:37:18 2010 +0300
@@ -251,7 +251,7 @@
// Add event to processing queue by type and enable force run
RPointerArray<HBufC> dummyArray;
- TRAPD(err, iProcessor->AddToQueueL(aType, EGenerationItemTypeAudio, aObjectIdArray, dummyArray, EFalse));
+ TRAPD(err, iProcessor->AddToQueueL(aType, EGenerationItemTypeVideo, aObjectIdArray, dummyArray, EFalse));
if (err != KErrNone)
{
TN_DEBUG1( "CThumbAGVideoObserver::HandleObjectNotification() - error adding to queue" );
@@ -263,7 +263,7 @@
}
#ifdef _DEBUG
- TN_DEBUG3( "CThumbAGImageObserver::IN-COUNTERS---------- Add = %d Modify = %d", iAddCounter, iModCounter );
+ TN_DEBUG3( "CThumbAGVideoObserver::IN-COUNTERS---------- Add = %d Modify = %d", iAddCounter, iModCounter );
iModCounter = 0;
iAddCounter = 0;
#endif
--- a/imagehandlingutilities/thumbnailmanager/thumbnailclient/bwins/thumbnailmanageru.def Wed Jun 23 18:33:48 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailclient/bwins/thumbnailmanageru.def Tue Jul 06 14:37:18 2010 +0300
@@ -19,4 +19,7 @@
?Uri@CThumbnailObjectSource@@QAEABVTDesC16@@XZ @ 18 NONAME ; class TDesC16 const & CThumbnailObjectSource::Uri(void)
?Bitmap@CThumbnailObjectSource@@QAEPAVCFbsBitmap@@XZ @ 19 NONAME ; class CFbsBitmap * CThumbnailObjectSource::Bitmap(void)
?GetBitmapOwnership@CThumbnailObjectSource@@QAEPAVCFbsBitmap@@XZ @ 20 NONAME ; class CFbsBitmap * CThumbnailObjectSource::GetBitmapOwnership(void)
+ ?NewLC@CThumbnailObjectSource@@SAPAV1@ABVTDesC16@@00@Z @ 21 NONAME ; class CThumbnailObjectSource * CThumbnailObjectSource::NewLC(class TDesC16 const &, class TDesC16 const &, class TDesC16 const &)
+ ?TargetUri@CThumbnailObjectSource@@QAEABVTDesC16@@XZ @ 22 NONAME ; class TDesC16 const & CThumbnailObjectSource::TargetUri(void)
+ ?NewL@CThumbnailObjectSource@@SAPAV1@ABVTDesC16@@00@Z @ 23 NONAME ; class CThumbnailObjectSource * CThumbnailObjectSource::NewL(class TDesC16 const &, class TDesC16 const &, class TDesC16 const &)
--- a/imagehandlingutilities/thumbnailmanager/thumbnailclient/eabi/thumbnailmanageru.def Wed Jun 23 18:33:48 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailclient/eabi/thumbnailmanageru.def Tue Jul 06 14:37:18 2010 +0300
@@ -21,4 +21,7 @@
_ZN22CThumbnailObjectSource6BitmapEv @ 20 NONAME
_ZTI22CThumbnailRequestQueue @ 21 NONAME
_ZTV22CThumbnailRequestQueue @ 22 NONAME
+ _ZN22CThumbnailObjectSource4NewLERK7TDesC16S2_S2_ @ 23 NONAME
+ _ZN22CThumbnailObjectSource5NewLCERK7TDesC16S2_S2_ @ 24 NONAME
+ _ZN22CThumbnailObjectSource9TargetUriEv @ 25 NONAME
--- a/imagehandlingutilities/thumbnailmanager/thumbnailclient/inc/thumbnailrequestactive.h Wed Jun 23 18:33:48 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailclient/inc/thumbnailrequestactive.h Tue Jul 06 14:37:18 2010 +0300
@@ -41,7 +41,8 @@
EReqUpdateThumbnails = 4,
EReqGetThumbnailHandleLater = 5,
EReqDeleteThumbnails = 6,
- EReqRenameThumbnails = 7
+ EReqRenameThumbnails = 7,
+ EReqSetThumbnailPath = 8
};
/**
@@ -238,6 +239,32 @@
const TInt aPriority );
/**
+ * Set thumbnail from file path.
+ *
+ * @param aPath Path to file from which the thumbnail is to be created.
+ * @param aFile File from which the thumbnail is to be created.
+ * @param aFlags Flags that control the creation of thumbnail.
+ * @param aQualityPreference Quality preference value
+ * @param aSize Requested size of the thumbnail.
+ * @param aDisplayMode Display mode.
+ * @param aPriority Priority of the request.
+ * @param aClientData Pointer to arbitrary client data.
+ * This pointer is not used by the API for
+ * anything other than returning it in the
+ * ThumbnailReady callback.
+ * @param aGeneratePersistentSizesOnly
+ * @param aOverwrite Overwrite old existing thumbs
+ * @param aTargetUri Target URI to which the imported thumbnail is linked.
+ * @param aThumbnailSize Relative thumbnail size
+ */
+ void SetThumbnailL( const TDesC& aPath, const TDesC8& aMimeType,
+ CThumbnailManager::TThumbnailFlags aFlags,
+ CThumbnailManager::TThumbnailQualityPreference aQualityPreference,
+ const TSize& aSize, const TDisplayMode aDisplayMode, const TInt aPriority,
+ TAny* aClientData, TBool aGeneratePersistentSizesOnly, const TDesC& aTargetUri,
+ TThumbnailSize aThumbnailSize, TBool aOverwrite);
+
+ /**
* Start active request.
*
* @since S60 v5.0
@@ -366,6 +393,11 @@
* @since S60 v5.0
*/
static TInt TimerCallBack(TAny* aAny);
+
+ /**
+ * Checks if URI is virtual.
+ */
+ TBool IsVirtualUri( const TDesC& aPath );
private:
// data
--- a/imagehandlingutilities/thumbnailmanager/thumbnailclient/src/thumbnailmanagerimpl.cpp Wed Jun 23 18:33:48 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailclient/src/thumbnailmanagerimpl.cpp Tue Jul 06 14:37:18 2010 +0300
@@ -69,6 +69,7 @@
}
delete iMimeTypeList;
+ iMimeTypeList = NULL;
TN_DEBUG1( "CThumbnailManagerImpl::~CThumbnailManagerImpl() - end" );
}
@@ -306,13 +307,20 @@
CleanupStack::PushL( getThumbnailActive );
if (aObjectSource.Uri().Length() &&
- aObjectSource.Bitmap() != NULL)
+ aObjectSource.TargetUri().Length())
+ {
+ // from path
+ getThumbnailActive->SetThumbnailL( aObjectSource.Uri(),
+ aObjectSource.MimeType(), iFlags, iQualityPreference, iSize, iDisplayMode,
+ priority, aClientData, ETrue, aObjectSource.TargetUri(), iThumbnailSize, ETrue);
+ }
+ else if (aObjectSource.Uri().Length() &&
+ aObjectSource.Bitmap() != NULL)
{
// from bitmap
getThumbnailActive->SetThumbnailL( aObjectSource.GetBitmapOwnership(),
- aObjectSource.Id(), KBmpMime, iFlags, iQualityPreference,
- iSize, iDisplayMode, priority, aClientData, ETrue,
- aObjectSource.Uri(), iThumbnailSize, ETrue);
+ aObjectSource.Id(), KBmpMime, iFlags, iQualityPreference, iSize, iDisplayMode,
+ priority, aClientData, ETrue, aObjectSource.Uri(), iThumbnailSize, ETrue);
}
else if (aObjectSource.Uri().Length() &&
aObjectSource.Buffer() != NULL &&
--- a/imagehandlingutilities/thumbnailmanager/thumbnailclient/src/thumbnailobjectsource.cpp Wed Jun 23 18:33:48 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailclient/src/thumbnailobjectsource.cpp Tue Jul 06 14:37:18 2010 +0300
@@ -24,6 +24,7 @@
// ---------------------------------------------------------------------------
// CThumbnailObjectSource::NewL()
+// CThumbnailObjectSource::NewLC()
// Two-phased constructor.
// ---------------------------------------------------------------------------
//
@@ -36,12 +37,6 @@
return self;
}
-
-// ---------------------------------------------------------------------------
-// CThumbnailObjectSource::NewLC()
-// Two-phased constructor.
-// ---------------------------------------------------------------------------
-//
EXPORT_C CThumbnailObjectSource* CThumbnailObjectSource::NewLC( const TDesC&
aUri, const TDesC& aMimeType )
{
@@ -51,11 +46,6 @@
return self;
}
-// ---------------------------------------------------------------------------
-// CThumbnailObjectSource::NewL()
-// Two-phased constructor.
-// ---------------------------------------------------------------------------
-//
EXPORT_C CThumbnailObjectSource* CThumbnailObjectSource::NewL( const RFile64&
aFile, const TDesC& aMimeType )
{
@@ -65,12 +55,6 @@
return self;
}
-
-// ---------------------------------------------------------------------------
-// CThumbnailObjectSource::NewLC()
-// Two-phased constructor.
-// ---------------------------------------------------------------------------
-//
EXPORT_C CThumbnailObjectSource* CThumbnailObjectSource::NewLC( const RFile64&
aFile, const TDesC& aMimeType )
{
@@ -80,15 +64,16 @@
return self;
}
-
-EXPORT_C CThumbnailObjectSource* CThumbnailObjectSource::NewL( CFbsBitmap* aBitmap, const TDesC& aUri )
+EXPORT_C CThumbnailObjectSource* CThumbnailObjectSource::NewL( CFbsBitmap* aBitmap,
+ const TDesC& aUri )
{
CThumbnailObjectSource* self = CThumbnailObjectSource::NewLC( aBitmap, aUri );
CleanupStack::Pop( self );
return self;
}
-EXPORT_C CThumbnailObjectSource* CThumbnailObjectSource::NewLC( CFbsBitmap* aBitmap, const TDesC& aUri )
+EXPORT_C CThumbnailObjectSource* CThumbnailObjectSource::NewLC( CFbsBitmap* aBitmap,
+ const TDesC& aUri )
{
CThumbnailObjectSource* self = new( ELeave )CThumbnailObjectSource();
CleanupStack::PushL( self );
@@ -96,21 +81,60 @@
return self;
}
-EXPORT_C CThumbnailObjectSource* CThumbnailObjectSource::NewL( TDesC8* aBuffer, TDesC& aMimeType, const TDesC& aUri)
+EXPORT_C CThumbnailObjectSource* CThumbnailObjectSource::NewL( TDesC8* aBuffer,
+ TDesC& aMimeType, const TDesC& aUri)
{
- CThumbnailObjectSource* self = CThumbnailObjectSource::NewLC( aBuffer, aMimeType, aUri );
+ CThumbnailObjectSource* self = CThumbnailObjectSource::NewLC( aBuffer,
+ aMimeType, aUri );
CleanupStack::Pop( self );
return self;
}
-EXPORT_C CThumbnailObjectSource* CThumbnailObjectSource::NewLC( TDesC8* aBuffer, TDesC& aMimeType, const TDesC& aUri)
+EXPORT_C CThumbnailObjectSource* CThumbnailObjectSource::NewLC( TDesC8* aBuffer,
+ TDesC& aMimeType, const TDesC& aUri)
{
CThumbnailObjectSource* self = new( ELeave )CThumbnailObjectSource();
CleanupStack::PushL( self );
self->ConstructL( aBuffer, aMimeType, aUri );
return self;
}
-
+
+EXPORT_C CThumbnailObjectSource* CThumbnailObjectSource::NewL( const TDesC&
+ aUri, const TThumbnailId aThumbnailId, const TDesC& aMimeType )
+ {
+ CThumbnailObjectSource* self = CThumbnailObjectSource::NewLC( aUri,
+ aThumbnailId, aMimeType );
+ CleanupStack::Pop( self );
+ return self;
+ }
+
+EXPORT_C CThumbnailObjectSource* CThumbnailObjectSource::NewLC( const TDesC& aUri,
+ const TThumbnailId aThumbnailId, const TDesC& aMimeType )
+ {
+ CThumbnailObjectSource* self = new( ELeave )CThumbnailObjectSource();
+ CleanupStack::PushL( self );
+ self->ConstructL( aUri, aMimeType, aThumbnailId );
+ return self;
+ }
+
+EXPORT_C CThumbnailObjectSource* CThumbnailObjectSource::NewL( const TDesC& aUri,
+ const TDesC& aTargetUri, const TDesC& aMimeType )
+ {
+ CThumbnailObjectSource* self = CThumbnailObjectSource::NewLC( aUri, aTargetUri,
+ aMimeType );
+ CleanupStack::Pop( self );
+ return self;
+ }
+
+EXPORT_C CThumbnailObjectSource* CThumbnailObjectSource::NewLC( const TDesC& aUri,
+ const TDesC& aTargetUri, const TDesC& aMimeType )
+ {
+ CThumbnailObjectSource* self = new( ELeave )CThumbnailObjectSource();
+ CleanupStack::PushL( self );
+ self->ConstructL( aUri, aTargetUri, aMimeType );
+ return self;
+ }
+
// ---------------------------------------------------------------------------
// CThumbnailObjectSource::CThumbnailObjectSource()
@@ -134,15 +158,11 @@
iUri = aUri.AllocL();
iMimeType = HBufC8::NewL( aMimeType.Length() );
iMimeType->Des().Copy( aMimeType );
+ iThumbnailId = 0;
iBitmap = NULL;
+ iTargetUri = NULL;
}
-
-// ---------------------------------------------------------------------------
-// CThumbnailObjectSource::ConstructL()
-// Symbian 2nd phase constructor can leave.
-// ---------------------------------------------------------------------------
-//
void CThumbnailObjectSource::ConstructL( const RFile64& aFile, const TDesC&
aMimeType )
{
@@ -151,26 +171,18 @@
iMimeType->Des().Copy( aMimeType );
iThumbnailId = 0;
iBitmap = NULL;
+ iTargetUri = NULL;
}
-// ---------------------------------------------------------------------------
-// CThumbnailObjectSource::ConstructL()
-// Symbian 2nd phase constructor can leave.
-// ---------------------------------------------------------------------------
-//
-void CThumbnailObjectSource::ConstructL( CFbsBitmap* aBitmap, const TDesC&
- aUri )
+void CThumbnailObjectSource::ConstructL( CFbsBitmap* aBitmap, const TDesC&
+ aUri )
{
iBitmap = aBitmap;
iUri = aUri.AllocL();
iThumbnailId = 0;
+ iTargetUri = NULL;
}
-// ---------------------------------------------------------------------------
-// CThumbnailObjectSource::ConstructL()
-// Symbian 2nd phase constructor can leave.
-// ---------------------------------------------------------------------------
-//
void CThumbnailObjectSource::ConstructL( TDesC8* aBuffer, const TDesC&
aMimeType, const TDesC& aUri )
{
@@ -180,13 +192,9 @@
iUri = aUri.AllocL();
iThumbnailId = 0;
iBitmap = NULL;
+ iTargetUri = NULL;
}
-// ---------------------------------------------------------------------------
-// CThumbnailObjectSource::ConstructL()
-// Symbian 2nd phase constructor can leave.
-// ---------------------------------------------------------------------------
-//
void CThumbnailObjectSource::ConstructL( const TDesC& aUri, const TDesC&
aMimeType, TThumbnailId aThumbnailId )
{
@@ -194,6 +202,18 @@
iMimeType = HBufC8::NewL( aMimeType.Length() );
iMimeType->Des().Copy( aMimeType );
iThumbnailId = aThumbnailId;
+ iTargetUri = NULL;
+ }
+
+void CThumbnailObjectSource::ConstructL( const TDesC& aUri, const TDesC&
+ aTargetUri, const TDesC& aMimeType )
+ {
+ iUri = aUri.AllocL();
+ iTargetUri = aTargetUri.AllocL();
+ iMimeType = HBufC8::NewL( aMimeType.Length() );
+ iMimeType->Des().Copy( aMimeType );
+ iThumbnailId = 0;
+ iBitmap = NULL;
}
@@ -205,9 +225,13 @@
CThumbnailObjectSource::~CThumbnailObjectSource()
{
delete iUri;
+ iUri = NULL;
delete iMimeType;
+ iMimeType = NULL;
delete iBuffer;
+ iBuffer = NULL;
delete iBitmap;
+ iBitmap = NULL;
}
@@ -215,12 +239,11 @@
// CThumbnailObjectSourceImpl::FileHandle()
// ---------------------------------------------------------------------------
//
-EXPORT_C RFile64& CThumbnailObjectSource::FileHandle()
+EXPORT_C RFile64& CThumbnailObjectSource::FileHandle()
{
return iFile;
}
-
// ---------------------------------------------------------------------------
// CThumbnailObjectSourceImpl::Uri()
// ---------------------------------------------------------------------------
@@ -267,35 +290,15 @@
return KNullDesC8;
}
+// ---------------------------------------------------------------------------
+// CThumbnailObjectSourceImpl::Id()
+// ---------------------------------------------------------------------------
+//
EXPORT_C TThumbnailId CThumbnailObjectSource::Id()
{
return iThumbnailId;
}
-EXPORT_C CThumbnailObjectSource* CThumbnailObjectSource::NewL( const TDesC&
-aUri, const TThumbnailId aThumbnailId, const TDesC& aMimeType )
-{
-CThumbnailObjectSource* self = CThumbnailObjectSource::NewLC( aUri,
- aThumbnailId, aMimeType );
-CleanupStack::Pop( self );
-return self;
- }
-
-
-// ---------------------------------------------------------------------------
-// CThumbnailObjectSource::NewLC()
-// Two-phased constructor.
-// ---------------------------------------------------------------------------
-//
-EXPORT_C CThumbnailObjectSource* CThumbnailObjectSource::NewLC( const TDesC& aUri,
- const TThumbnailId aThumbnailId, const TDesC& aMimeType )
- {
- CThumbnailObjectSource* self = new( ELeave )CThumbnailObjectSource();
- CleanupStack::PushL( self );
- self->ConstructL( aUri, aMimeType, aThumbnailId );
- return self;
- }
-
// ---------------------------------------------------------------------------
// CThumbnailObjectSourceImpl::Bitmap()
// ---------------------------------------------------------------------------
@@ -316,4 +319,18 @@
return temp;
}
+// ---------------------------------------------------------------------------
+// CThumbnailObjectSourceImpl::TargetUri()
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TDesC& CThumbnailObjectSource::TargetUri()
+ {
+ if ( iTargetUri )
+ {
+ return * iTargetUri;
+ }
+ return KNullDesC;
+ }
+
+
// End of file
--- a/imagehandlingutilities/thumbnailmanager/thumbnailclient/src/thumbnailrequestactive.cpp Wed Jun 23 18:33:48 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailclient/src/thumbnailrequestactive.cpp Tue Jul 06 14:37:18 2010 +0300
@@ -163,6 +163,14 @@
TN_DEBUG2( "CThumbnailRequestActive::StartL() - file handle opened for %S", &iPath );
CleanupClosePushL( iFile );
+
+ if ( iParams.iQualityPreference == CThumbnailManager::EOptimizeForQualityWithPreview )
+ {
+ // We may need the file handle later for the 2nd phase thumbnail
+ iMyFileHandle.Close();
+ User::LeaveIfError( iMyFileHandle.Duplicate( iFile ));
+ }
+
iSession.RequestThumbnailL( iFile, iPath, iParamsPckg, iStatus );
CleanupStack::PopAndDestroy( &iFile );
}
@@ -197,6 +205,14 @@
TN_DEBUG2( "CThumbnailRequestActive::StartL() - file handle opened for %S", &iTargetUri );
CleanupClosePushL( iFile );
+
+ if ( iParams.iQualityPreference == CThumbnailManager::EOptimizeForQualityWithPreview )
+ {
+ // We may need the file handle later for the 2nd phase thumbnail
+ iMyFileHandle.Close();
+ User::LeaveIfError( iMyFileHandle.Duplicate( iFile ));
+ }
+
iSession.RequestThumbnailL( iFile, iTargetUri, iParamsPckg, iStatus );
CleanupStack::PopAndDestroy( &iFile );
break;
@@ -220,6 +236,29 @@
iSession.RenameThumbnails( iParamsPckg, iStatus );
break;
}
+ case EReqSetThumbnailPath:
+ {
+ // open file handle
+ iFile.Close();
+ User::LeaveIfError( iFile.Open( iFs, iParams.iFileName, EFileShareReadersOrWriters ) );
+
+ TN_DEBUG2( "CThumbnailRequestActive::StartL() - file handle opened for %S", &iParams.iFileName );
+
+ CleanupClosePushL( iFile );
+
+ if ( iParams.iQualityPreference == CThumbnailManager::EOptimizeForQualityWithPreview )
+ {
+ // We may need the file handle later for the 2nd phase thumbnail
+ iMyFileHandle.Close();
+ User::LeaveIfError( iMyFileHandle.Duplicate( iFile ));
+ }
+
+ iSession.RequestThumbnailL( iFile, iTargetUri, iParamsPckg, iStatus );
+ CleanupStack::PopAndDestroy( &iFile );
+
+ break;
+ }
+
default:
{
break;
@@ -651,10 +690,20 @@
iParams.iThumbnailSize = aThumbnailSize;
iParams.iThumbnailId = aThumbnailId;
iParams.iOverwrite = EFalse;
+ iParams.iImport = EFalse;
User::LeaveIfError( iFile.Duplicate( aFile ));
iTargetUri = aTargetUri;
+
+ if (iParams.iFileName.Length() && IsVirtualUri(iParams.iFileName))
+ {
+ iParams.iVirtualUri = ETrue;
+ }
+ else
+ {
+ iParams.iVirtualUri = EFalse;
+ }
}
@@ -687,8 +736,18 @@
iParams.iThumbnailSize = aThumbnailSize;
iParams.iThumbnailId = aThumbnailId;
iParams.iOverwrite = EFalse;
+ iParams.iImport = EFalse;
iTargetUri = aTargetUri;
+
+ if (iPath.Length() && IsVirtualUri(iPath))
+ {
+ iParams.iVirtualUri = ETrue;
+ }
+ else
+ {
+ iParams.iVirtualUri = EFalse;
+ }
}
@@ -721,9 +780,19 @@
iParams.iThumbnailId = aThumbnailId;
iParams.iFileName = aPath;
iParams.iOverwrite = EFalse;
+ iParams.iImport = EFalse;
iPath = aPath;
iTargetUri = aTargetUri;
+
+ if (iPath.Length() && IsVirtualUri(iPath))
+ {
+ iParams.iVirtualUri = ETrue;
+ }
+ else
+ {
+ iParams.iVirtualUri = EFalse;
+ }
}
// ---------------------------------------------------------------------------
@@ -757,8 +826,18 @@
iParams.iQualityPreference = aQualityPreference;
iParams.iThumbnailId = aThumbnailId;
iParams.iOverwrite = aOverwrite;
+ iParams.iImport = EFalse;
iTargetUri = aTargetUri;
+
+ if (iTargetUri.Length() && IsVirtualUri(iTargetUri))
+ {
+ iParams.iVirtualUri = ETrue;
+ }
+ else
+ {
+ iParams.iVirtualUri = EFalse;
+ }
}
// ---------------------------------------------------------------------------
@@ -789,9 +868,19 @@
iParams.iThumbnailId = aThumbnailId;
iParams.iFileName = aTargetUri;
iParams.iOverwrite = aOverwrite;
+ iParams.iImport = EFalse;
iTargetUri = aTargetUri;
+ if (iTargetUri.Length() && IsVirtualUri(iTargetUri))
+ {
+ iParams.iVirtualUri = ETrue;
+ }
+ else
+ {
+ iParams.iVirtualUri = EFalse;
+ }
+
TInt memoryFree( 0 );
HAL::Get( HALData::EMemoryRAMFree, memoryFree );
@@ -804,7 +893,7 @@
iParams.iMimeType = TDataType( aMimeType );
iRequestType = EReqSetThumbnailBitmap;
}
- else
+ else if (!iParams.iVirtualUri)
{
// memory low, create thumbs using filehandle
TN_DEBUG1( "CThumbnaiRequestActive::SetThumbnailbyBitmap() - memory low, create thumbs using filehandle!" );
@@ -813,6 +902,10 @@
iParams.iPriority = aPriority - 1;
iRequestType = EReqGetThumbnailHandleLater;
}
+ else
+ {
+ User::Leave(KErrNoMemory);
+ }
}
// ---------------------------------------------------------------------------
@@ -838,6 +931,8 @@
iParams.iQualityPreference = aQualityPreference;
iParams.iThumbnailId = aThumbnailId;
iParams.iOverwrite = EFalse;
+ iParams.iVirtualUri = EFalse;
+ iParams.iImport = EFalse;
iPath = aPath;
iOrientation = aOrientation;
@@ -878,6 +973,51 @@
}
// ---------------------------------------------------------------------------
+// CThumbnailRequestActive::SetThumbnailL()
+// Set thumbnail from file path.
+// ---------------------------------------------------------------------------
+//
+void CThumbnailRequestActive::SetThumbnailL( const TDesC& aPath, const TDesC8& aMimeType,
+ CThumbnailManager::TThumbnailFlags aFlags, CThumbnailManager
+ ::TThumbnailQualityPreference aQualityPreference, const TSize& aSize, const
+ TDisplayMode aDisplayMode, const TInt aPriority, TAny* aClientData,
+ TBool aGeneratePersistentSizesOnly, const TDesC& aTargetUri,
+ TThumbnailSize aThumbnailSize, TBool aOverwrite)
+ {
+ iRequestType = EReqSetThumbnailPath;
+
+ iClientData = aClientData;
+ iParams.iControlFlags = (aGeneratePersistentSizesOnly ?
+ EThumbnailGeneratePersistentSizesOnly :
+ EThumbnailNoControlFlags);
+ iParams.iOriginalControlFlags = iParams.iControlFlags;
+ iParams.iMimeType = TDataType( aMimeType );
+ iParams.iBitmapHandle = 0;
+ iParams.iSize = aSize;
+ iParams.iDisplayMode = aDisplayMode;
+ iParams.iFileName = aPath;
+ iParams.iRequestId = iRequestId;
+ iParams.iPriority = aPriority;
+ iParams.iFlags = aFlags;
+ iParams.iQualityPreference = aQualityPreference;
+ iParams.iThumbnailSize = aThumbnailSize;
+ iParams.iOverwrite = aOverwrite;
+
+ iTargetUri = aTargetUri;
+
+ if (iTargetUri.Length() && IsVirtualUri(iTargetUri))
+ {
+ iParams.iVirtualUri = ETrue;
+ }
+ else
+ {
+ iParams.iVirtualUri = EFalse;
+ }
+
+ iParams.iImport = ETrue;
+ }
+
+// ---------------------------------------------------------------------------
// Request 2nd phase thumbnail
// ---------------------------------------------------------------------------
//
@@ -970,4 +1110,26 @@
return KErrNone;
}
+// ---------------------------------------------------------------------------
+// CThumbnailRequestActive::IsVirtualUri()
+// Checks if URI is virtual.
+// ---------------------------------------------------------------------------
+//
+TBool CThumbnailRequestActive::IsVirtualUri( const TDesC& aPath )
+ {
+ TInt pos = aPath.Find(KBackSlash);
+
+ // normal URI
+ if ( pos == 2 )
+ {
+ return EFalse;
+ }
+ // virtual URI
+ else
+ {
+ TN_DEBUG1( "CThumbnailRequestActive::IsVirtualUri() - yes");
+ return ETrue;
+ }
+ }
+
// End of file
--- a/imagehandlingutilities/thumbnailmanager/thumbnailclient/src/thumbnailrequestqueue.cpp Wed Jun 23 18:33:48 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailclient/src/thumbnailrequestqueue.cpp Tue Jul 06 14:37:18 2010 +0300
@@ -166,6 +166,11 @@
iRequests.Remove( i );
}
}
+
+ if(!iRequests.Count())
+ {
+ iRequests.Compress();
+ }
TN_DEBUG3( "CThumbnailRequestQueue::RemoveCompleted() end - requests: %d, active requests: %d",
iRequests.Count(), iActiveRequests );
--- a/imagehandlingutilities/thumbnailmanager/thumbnailmanagerqt/bwins/thumbnailmanagerqt.def Wed Jun 23 18:33:48 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailmanagerqt/bwins/thumbnailmanagerqt.def Tue Jul 06 14:37:18 2010 +0300
@@ -18,4 +18,5 @@
?setThumbnail@ThumbnailManager@@QAEHABVQImage@@ABVQString@@PAXH@Z @ 17 NONAME ; int ThumbnailManager::setThumbnail(class QImage const &, class QString const &, void *, int)
?thumbnailReady@ThumbnailManager@@IAEXVQImage@@PAXHH@Z @ 18 NONAME ; void ThumbnailManager::thumbnailReady(class QImage, void *, int, int)
?thumbnailReady@ThumbnailManager@@IAEXVQPixmap@@PAXHH@Z @ 19 NONAME ; void ThumbnailManager::thumbnailReady(class QPixmap, void *, int, int)
+ ?setThumbnail@ThumbnailManager@@QAEHABVQString@@00PAXH@Z @ 20 NONAME ; int ThumbnailManager::setThumbnail(class QString const &, class QString const &, class QString const &, void *, int)
--- a/imagehandlingutilities/thumbnailmanager/thumbnailmanagerqt/eabi/thumbnailmanagerqt.def Wed Jun 23 18:33:48 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailmanagerqt/eabi/thumbnailmanagerqt.def Tue Jul 06 14:37:18 2010 +0300
@@ -21,4 +21,5 @@
_ZN16ThumbnailManager12setThumbnailERK6QImageRK7QStringPvi @ 20 NONAME
_ZN16ThumbnailManager14thumbnailReadyE6QImagePvii @ 21 NONAME
_ZN16ThumbnailManager14thumbnailReadyE7QPixmapPvii @ 22 NONAME
+ _ZN16ThumbnailManager12setThumbnailERK7QStringS2_S2_Pvi @ 23 NONAME
--- a/imagehandlingutilities/thumbnailmanager/thumbnailmanagerqt/inc/thumbnailmanager_p_qt.h Wed Jun 23 18:33:48 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailmanagerqt/inc/thumbnailmanager_p_qt.h Tue Jul 06 14:37:18 2010 +0300
@@ -116,7 +116,14 @@
* thumbnailReady() signal will be emited when the operation is complete.
*/
int setThumbnail( const QImage& source, const QString& fileName,
- void * clientData, int priority );
+ void * clientData, int priority );
+
+ /**
+ * Set a thumbnail for an object file generated from source file.
+ * thumbnailReady() signal will be emited when the operation is complete.
+ */
+ int setThumbnail( const QString& sourceFileName, const QString& targetFileName,
+ const QString& mimeType, void * clientData, int priority );
/**
* Delete all thumbnails for a given object. This is an asynchronous
--- a/imagehandlingutilities/thumbnailmanager/thumbnailmanagerqt/src/thumbnailmanager_p_qt.cpp Wed Jun 23 18:33:48 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailmanagerqt/src/thumbnailmanager_p_qt.cpp Tue Jul 06 14:37:18 2010 +0300
@@ -123,6 +123,7 @@
CleanupClosePushL( buf );
buf.CreateL( symbFileName.length() );
buf.Copy( symbFileName.utf16(), symbFileName.length() );
+
CThumbnailObjectSource* objSrc = CThumbnailObjectSource::NewLC( buf, KNullDesC );
result = iThumbnailManager->GetThumbnailL( *objSrc, clientData, priority );
CleanupStack::PopAndDestroy( 2, &buf );
@@ -216,6 +217,53 @@
return result;
}
+int ThumbnailManagerPrivate::setThumbnail( const QString& sourceFileName, const QString& targetFileName,
+ const QString& mimeType, void * clientData, int priority )
+{
+ int result( -1 );
+ QString symbSourceFile( sourceFileName );
+ QString symbTargetFile( targetFileName );
+ RBuf sourceFile;
+ RBuf targetFile;
+ RBuf mime;
+
+ priority = convertPriority(priority);
+
+ if( symbSourceFile.contains( "/" ) )
+ symbSourceFile.replace( "/", "\\", Qt::CaseSensitive );
+
+ if( symbTargetFile.contains( "/" ) )
+ symbTargetFile.replace( "/", "\\", Qt::CaseSensitive );
+
+ TRAP_IGNORE(
+ CleanupClosePushL( sourceFile );
+ sourceFile.CreateL( symbSourceFile.length() );
+ sourceFile.Copy( symbSourceFile.utf16(), symbSourceFile.length() );
+
+ CleanupClosePushL( targetFile );
+ targetFile.CreateL( symbTargetFile.length() );
+ targetFile.Copy( symbTargetFile.utf16(), symbTargetFile.length() );
+
+ CleanupClosePushL( mime );
+
+ if (mimeType.length())
+ {
+ mime.CreateL( mimeType.length() );
+ mime.Copy( mimeType.utf16(), mimeType.length() );
+ }
+ else
+ {
+ mime.Assign(KNullDesC().AllocL());
+ }
+
+ CThumbnailObjectSource* objSrc = CThumbnailObjectSource::NewLC( sourceFile, targetFile, mime );
+ result = iThumbnailManager->SetThumbnailL( *objSrc, clientData, priority );
+ CleanupStack::PopAndDestroy( 4, &sourceFile );
+ );
+
+ return result;
+}
+
void ThumbnailManagerPrivate::deleteThumbnails( const QString& fileName )
{
QString symbFileName( fileName );
--- a/imagehandlingutilities/thumbnailmanager/thumbnailmanagerqt/src/thumbnailmanager_qt.cpp Wed Jun 23 18:33:48 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailmanagerqt/src/thumbnailmanager_qt.cpp Tue Jul 06 14:37:18 2010 +0300
@@ -94,6 +94,12 @@
return d->setThumbnail( source, filename, clientData, priority );
}
+Q_DECL_EXPORT int ThumbnailManager::setThumbnail( const QString& sourceFileName, const QString& targetFileName,
+ const QString& mimeType, void * clientData , int priority )
+{
+ return d->setThumbnail( sourceFileName, targetFileName, mimeType, clientData, priority );
+}
+
Q_DECL_EXPORT void ThumbnailManager::deleteThumbnails( const QString& fileName )
{
d->deleteThumbnails( fileName );
--- a/imagehandlingutilities/thumbnailmanager/thumbnailmanagerqt/tsrc/test_qtnmwrapper.cpp Wed Jun 23 18:33:48 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailmanagerqt/tsrc/test_qtnmwrapper.cpp Tue Jul 06 14:37:18 2010 +0300
@@ -62,6 +62,7 @@
void getThumbnailByName();
void getThumbnailById();
void setThumbnail();
+ void setThumbnailFromPath();
void cancelRequest();
void changePriority();
void deleteThumbnailsByName();
@@ -245,6 +246,18 @@
delete img;
}
+void TestThumbnailManager::setThumbnailFromPath()
+{
+ // normal URI
+ QVERIFY( wrapper->setThumbnail( "c:\\tnmwrapper_tsrc.png", "c:\\tnmwrapper_tsrc.vcf", "contact/x-vcard" ) != -1 );
+
+ // virtual URI
+ QVERIFY( wrapper->setThumbnail( "c:\\tnmwrapper_tsrc.png", "c:tnmwrapper_tsrc.vcf", "contact/x-vcard" ) != -1 );
+
+ // no mime
+ QVERIFY( wrapper->setThumbnail( "c:\\tnmwrapper_tsrc.png", "c:tnmwrapper_tsrc.vcf" ) != -1 );
+}
+
void TestThumbnailManager::cancelRequest()
{
wrapper->setMode( ThumbnailManager::CropToAspectRatio );
--- a/imagehandlingutilities/thumbnailmanager/thumbnailserver/inc/thumbnailcenrep.h Wed Jun 23 18:33:48 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailserver/inc/thumbnailcenrep.h Tue Jul 06 14:37:18 2010 +0300
@@ -142,7 +142,7 @@
};
public:
- enum TThumbnailSourceType { EUnknownSourceType, EImage, EVideo, EAudio };
+ enum TThumbnailSourceType { EUnknownSourceType, EImage, EVideo, EAudio, EContact };
enum TThumbnailSizeType { EUnknownSizeType, EGrid, EList, EFullscreen };
public:
@@ -203,7 +203,10 @@
TBool iVideoFullscreen;
TBool iAudioGrid;
TBool iAudioList;
- TBool iAudioFullscreen;
+ TBool iAudioFullscreen;
+ TBool iContactGrid;
+ TBool iContactList;
+ TBool iContactFullscreen;
};
#endif // THUMBNAILCENREP_H
--- a/imagehandlingutilities/thumbnailmanager/thumbnailserver/inc/thumbnailgeneratetask.h Wed Jun 23 18:33:48 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailserver/inc/thumbnailgeneratetask.h Tue Jul 06 14:37:18 2010 +0300
@@ -33,7 +33,7 @@
* @since S60 v5.0
*/
class CThumbnailGenerateTask: public CThumbnailTask,
- public MThumbnailProviderObserver
+ public MThumbnailProviderObserver
{
public:
@@ -56,7 +56,8 @@
TDisplayMode aDisplayMode, TInt aPriority,
RArray < TThumbnailPersistentSize >* aMissingSizes, const TDesC& aTargetUri,
TThumbnailSize aThumbnailSize, const TInt64 aModified,
- const CThumbnailManager::TThumbnailQualityPreference aQualityPreference );
+ const CThumbnailManager::TThumbnailQualityPreference aQualityPreference,
+ TBool aImportVirtual );
/**
* Destructor.
@@ -233,6 +234,9 @@
TBool iPortrait;
TInt iBitmapHandle;
+
+ // virtual uri
+ TBool iVirtualUri;
};
#endif // THUMBNAILGENERATETASK_H
--- a/imagehandlingutilities/thumbnailmanager/thumbnailserver/inc/thumbnailscaletask.h Wed Jun 23 18:33:48 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailserver/inc/thumbnailscaletask.h Tue Jul 06 14:37:18 2010 +0300
@@ -59,7 +59,7 @@
TDisplayMode aDisplayMode, TInt aPriority, const TDesC& aTargetUri,
const TThumbnailSize aThumbnailSize, const TInt64 aModified,
const TBool aBitmapToPool, const TBool aEXIF,
- const TThumbnailServerRequestId aRequestId);
+ const TThumbnailServerRequestId aRequestId, const TBool aImportVirtual);
/**
* Destructor
@@ -131,7 +131,7 @@
aDisplayMode, TInt aPriority, const TDesC& aTargetUri,
const TThumbnailSize aThumbnailSize, const TInt64 aModified,
const TBool aBitmapToPool, const TBool aEXIF,
- const TThumbnailServerRequestId aRequestId);
+ const TThumbnailServerRequestId aRequestId, const TBool aImportVirtual);
/**
* Symbian 2nd phase constructor can leave.
@@ -278,6 +278,9 @@
* Is origin EXIF.
*/
TBool iEXIF;
+
+ // virtual uri
+ TBool iVirtualUri;
};
#endif // THUMBNAILSCALETASK_H
--- a/imagehandlingutilities/thumbnailmanager/thumbnailserver/inc/thumbnailserver.h Wed Jun 23 18:33:48 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailserver/inc/thumbnailserver.h Tue Jul 06 14:37:18 2010 +0300
@@ -168,9 +168,8 @@
*/
void StoreThumbnailL( const TDesC& aPath, CFbsBitmap* aBitmap, const TSize&
aOriginalSize, const TBool aCropped, const TThumbnailSize aThumbnailSize,
- const TInt64 aModified,
- const TBool aThumbFromPath = ETrue,
- const TBool aCheckExist = ETrue);
+ const TInt64 aModified, const TBool aThumbFromPath,
+ const TBool aCheckExist);
/**
* Fetch thumbnail image.
--- a/imagehandlingutilities/thumbnailmanager/thumbnailserver/inc/thumbnailsql.h Wed Jun 23 18:33:48 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailserver/inc/thumbnailsql.h Tue Jul 06 14:37:18 2010 +0300
@@ -130,6 +130,10 @@
_LIT8 ( KGetInfoRowID, "SELECT MAX (ThumbnailInfo.rowID) FROM ThumbnailInfo" );
_LIT8 ( KGetDataRowID, "SELECT MAX (ThumbnailInfoData.rowID) FROM ThumbnailInfoData" );
+// counts
+_LIT8 ( KGetInfoCount, "SELECT COUNT(*) FROM ThumbnailInfo" );
+_LIT8 ( KGetInfoDataCount, "SELECT COUNT(*) FROM ThumbnailInfoData" );
+
// flush
_LIT8( KThumbnailMoveFromTempInfoToMainTable, "INSERT INTO ThumbnailInfo SELECT * FROM TempThumbnailInfo;");
_LIT8( KThumbnailMoveFromTempDataToMainTable, "INSERT INTO ThumbnailInfoData SELECT * FROM TempThumbnailInfoData;");
@@ -210,6 +214,6 @@
_LIT8( KThumbnailSelectAllPaths, "SELECT ThumbnailInfo.RowID,Path FROM ThumbnailInfo "
"WHERE NOT EXISTS (SELECT Path FROM ThumbnailDeleted "
"WHERE ThumbnailInfo.Path = ThumbnailDeleted.Path) "
- "AND ThumbnailInfo.RowID > :RowID ORDER BY ThumbnailInfo.RowID ASC LIMIT :Limit;" );
+ "AND ThumbFromPath = 1 AND ThumbnailInfo.RowID > :RowID ORDER BY ThumbnailInfo.RowID ASC LIMIT :Limit;" );
#endif // THUMBNAILSQL_H
--- a/imagehandlingutilities/thumbnailmanager/thumbnailserver/inc/thumbnailstore.h Wed Jun 23 18:33:48 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailserver/inc/thumbnailstore.h Tue Jul 06 14:37:18 2010 +0300
@@ -232,9 +232,7 @@
*/
void StoreThumbnailL( const TDesC& aPath, CFbsBitmap* aThumbnail, const
TSize& aOriginalSize, TBool aCropped, const TThumbnailSize aThumbnailSize,
- const TInt64 aModified,
- const TBool aThumbFromPath = ETrue,
- TBool aBlackListed = EFalse );
+ const TInt64 aModified, const TBool aThumbFromPath, TBool aBlackListed);
/**
* Fetches thumbnail image.
@@ -442,7 +440,7 @@
void StoreThumbnailL( const TDesC& aPath, const TDes8& aData, const TSize&
aSize, const TSize& aOriginalSize, const TThumbnailFormat& aFormat, TInt aFlags,
const TThumbnailSize& aThumbnailSize, const TInt64 aModified,
- const TBool aThumbFromPath = ETrue);
+ const TBool aThumbFromPath);
/**
* Finds possible existing duplicate thumbnail.
--- a/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailcenrep.cpp Wed Jun 23 18:33:48 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailcenrep.cpp Tue Jul 06 14:37:18 2010 +0300
@@ -67,6 +67,11 @@
case EAudioFullScreenThumbnailSize:
iSourceType = EAudio;
break;
+ case EContactGridThumbnailSize:
+ case EContactListThumbnailSize:
+ case EContactFullScreenThumbnailSize:
+ iSourceType = EContact;
+ break;
default:
iSourceType = EUnknownSourceType;
}
@@ -80,7 +85,8 @@
TThumbnailAutoCreate::TThumbnailAutoCreate()
: iImageGrid(EFalse), iImageList(EFalse), iImageFullscreen(EFalse),
iVideoGrid(EFalse), iVideoList(EFalse), iVideoFullscreen(EFalse),
- iAudioGrid(EFalse), iAudioList(EFalse), iAudioFullscreen(EFalse)
+ iAudioGrid(EFalse), iAudioList(EFalse), iAudioFullscreen(EFalse),
+ iContactGrid(EFalse), iContactList(EFalse), iContactFullscreen(EFalse)
{
// No implementation required
}
@@ -203,6 +209,28 @@
iPersistentSizes.AppendL( TThumbnailPersistentSize( EAudioFullScreenThumbnailSize, TSize( xSize, ySize ),
flags, static_cast <TDisplayMode> (raw_mode), format, autoCreate, TThumbnailPersistentSize::EFullscreen ));
+
+ User::LeaveIfError( iRepository->Get( KSizeContactGridWidth, xSize ));
+ User::LeaveIfError( iRepository->Get( KSizeContactGridHeight, ySize ));
+ User::LeaveIfError( iRepository->Get( KAutoCreateContactGrid, autoCreate ));
+
+ iPersistentSizes.AppendL( TThumbnailPersistentSize( EContactGridThumbnailSize, TSize( xSize, ySize ),
+ KGridAndListThumbnailCropped, static_cast <TDisplayMode> (raw_mode), format, autoCreate, TThumbnailPersistentSize::EGrid ));
+
+ User::LeaveIfError( iRepository->Get( KSizeContactListWidth, xSize ));
+ User::LeaveIfError( iRepository->Get( KSizeContactListHeight, ySize ));
+ User::LeaveIfError( iRepository->Get( KAutoCreateContactList, autoCreate ));
+
+ iPersistentSizes.AppendL( TThumbnailPersistentSize( EContactListThumbnailSize, TSize( xSize, ySize ),
+ KGridAndListThumbnailCropped, static_cast <TDisplayMode> (raw_mode), format, autoCreate, TThumbnailPersistentSize::EList ));
+
+ User::LeaveIfError( iRepository->Get( KSizeContactFullscreenWidth, xSize ));
+ User::LeaveIfError( iRepository->Get( KSizeContactFullscreenHeight, ySize ));
+ User::LeaveIfError( iRepository->Get( KAutoCreateContactFullscreen, autoCreate ));
+
+ iPersistentSizes.AppendL( TThumbnailPersistentSize( EContactFullScreenThumbnailSize, TSize( xSize, ySize ),
+ flags, static_cast <TDisplayMode> (raw_mode), format, autoCreate, TThumbnailPersistentSize::EFullscreen ));
+
iAutoCreate = new (ELeave) TThumbnailAutoCreate();
@@ -215,6 +243,9 @@
User::LeaveIfError( iRepository->Get( KAutoCreateAudioGrid, iAutoCreate->iAudioGrid ));
User::LeaveIfError( iRepository->Get( KAutoCreateAudioList, iAutoCreate->iAudioList ));
User::LeaveIfError( iRepository->Get( KAutoCreateAudioFullscreen, iAutoCreate->iAudioFullscreen ));
+ User::LeaveIfError( iRepository->Get( KAutoCreateContactGrid, iAutoCreate->iContactGrid ));
+ User::LeaveIfError( iRepository->Get( KAutoCreateContactList, iAutoCreate->iContactList ));
+ User::LeaveIfError( iRepository->Get( KAutoCreateContactFullscreen, iAutoCreate->iContactFullscreen ));
}
// ---------------------------------------------------------------------------
--- a/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailgeneratetask.cpp Wed Jun 23 18:33:48 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailgeneratetask.cpp Tue Jul 06 14:37:18 2010 +0300
@@ -43,12 +43,13 @@
const TSize& aSize, TDisplayMode aDisplayMode, TInt aPriority,
RArray < TThumbnailPersistentSize >* aMissingSizes, const TDesC& aTargetUri,
TThumbnailSize aThumbnailSize, const TInt64 aModified,
- const CThumbnailManager::TThumbnailQualityPreference aQualityPreference ):
+ const CThumbnailManager::TThumbnailQualityPreference aQualityPreference,
+ TBool aVirtualUri ):
CThumbnailTask( aProcessor, aPriority ), iServer( aServer ),
iFlags( aFlags ), iSize( aSize ), iDisplayMode( aDisplayMode ),
iMissingSizes( aMissingSizes ), iTargetUri( aTargetUri ),
iThumbnailSize( aThumbnailSize ), iModified(aModified),
- iQualityPreference( aQualityPreference )
+ iQualityPreference( aQualityPreference ), iVirtualUri( aVirtualUri )
{
TN_DEBUG2( "CThumbnailGenerateTask(0x%08x)::CThumbnailGenerateTask()", this);
@@ -125,11 +126,11 @@
aStart.UniversalTime();
#endif
- TParsePtrC parse(iFilename);
- TPtrC ext(parse.Ext());
- TBuf8< KMaxDataTypeLength > mimeType;
- if (ext.CompareF(KNonEmbeddedArtExt)== 0)
- {
+ TBuf8< KMaxDataTypeLength > mimeType;
+
+ if ( (!iVirtualUri && iFilename.Right(KExtLength).CompareF(KNonEmbeddedArtExt) == 0) ||
+ (iVirtualUri && iTargetUri.Right(KExtLength).CompareF(KContactExt) == 0) ) // tparse panics with virtual URI
+ {
mimeType.Copy( KImageMime );
}
else
@@ -138,8 +139,7 @@
}
iProvider = iServer.ResolveProviderL(mimeType);
- TN_DEBUG3( "CThumbnailGenerateTask(0x%08x) -- provider UID 0x%08x", this,
- iProvider->Uid());
+ TN_DEBUG3( "CThumbnailGenerateTask(0x%08x) -- provider UID 0x%08x", this, iProvider->Uid());
__ASSERT_DEBUG(( iProvider ), ThumbnailPanic( EThumbnailNullPointer ));
@@ -197,6 +197,7 @@
void CThumbnailGenerateTask::DoCancel()
{
TN_DEBUG2( "CThumbnailGenerateTask(0x%08x)::DoCancel()", this );
+
if ( iProvider )
{
iProvider->CancelGetThumbnail();
@@ -328,6 +329,25 @@
// compTask is the scale task which returns the bitmap to the client
CThumbnailScaleTask* complTask = NULL;
+ TInt err1 = KErrNone;
+ TInt err2 = KErrNone;
+ TBool isPublic = ETrue;
+ TBool isPublic2 = ETrue;
+
+ if(iFilename != KNullDesC)
+ {
+ TRAP(err1, iServer.StoreForPathL(iFilename));
+
+ isPublic = iServer.IsPublicPath( iFilename );
+ }
+ if(iTargetUri != KNullDesC )
+ {
+ TRAP(err2, iServer.StoreForPathL(iTargetUri));
+
+ isPublic2 = iServer.IsPublicPath( iTargetUri );
+ }
+
+ // check if need to create more than one scale task
if ( iMissingSizes )
{
const TInt count = iMissingSizes->Count();
@@ -359,41 +379,23 @@
CThumbnailScaleTask* complTask = CThumbnailScaleTask::NewL( iProcessor, iServer, iFilename,
aBitmap, iOriginalSize, (*iMissingSizes)[ i ].iSize, (*iMissingSizes)[ i ].iCrop, iDisplayMode,
KMaxPriority, iTargetUri, (*iMissingSizes)[ i ].iType, iModified, iScaledBitmapToPool, iEXIF,
- iRequestId);
+ iRequestId, iVirtualUri);
CleanupStack::PushL( complTask );
- TInt err1 = KErrNone;
- TInt err2 = KErrNone;
-
- if(iFilename != KNullDesC)
- {
- TRAP(err1, iServer.StoreForPathL(iFilename));
- }
-
- if(iTargetUri != KNullDesC )
- {
- TRAP(err2, iServer.StoreForPathL(iTargetUri));
- }
// if trying to access Z drive, don't try to store
// don't want to store custom sizes
- if( err1 == KErrAccessDenied || err2 == KErrAccessDenied ||
- (*iMissingSizes)[ i ].iType == ECustomThumbnailSize ||
- (*iMissingSizes)[ i ].iType == EUnknownThumbnailSize )
+ // don't store if from private directory
+ if( !isPublic || !isPublic2 ||
+ err1 == KErrAccessDenied || err2 == KErrAccessDenied ||
+ (*iMissingSizes)[ i ].iType == ECustomThumbnailSize ||
+ (*iMissingSizes)[ i ].iType == EUnknownThumbnailSize )
{
complTask->SetDoStore( EFalse );
TN_DEBUG2( "CThumbnailGenerateTask(0x%08x)::CreateScaleTasksL() - do not store", this );
}
else
{
- if(iFilename != KNullDesC)
- {
- complTask->SetDoStore(iServer.IsPublicPath( iFilename ));
- }
-
- if(iTargetUri != KNullDesC)
- {
- complTask->SetDoStore(iServer.IsPublicPath( iTargetUri ));
- }
+ complTask->SetDoStore( ETrue );
}
iProcessor.AddTaskL( complTask );
@@ -426,22 +428,14 @@
complTask = CThumbnailScaleTask::NewL( iProcessor, iServer, iFilename,
aBitmap, iOriginalSize, iSize, iFlags& CThumbnailManager
::ECropToAspectRatio, iDisplayMode, KMaxPriority, iTargetUri,
- iThumbnailSize, iModified, iScaledBitmapToPool, iEXIF, iRequestId );
+ iThumbnailSize, iModified, iScaledBitmapToPool, iEXIF, iRequestId,
+ iVirtualUri);
CleanupStack::PushL( complTask );
- TInt err1 = KErrNone;
- TInt err2 = KErrNone;
- if(iFilename != KNullDesC)
- {
- TRAP(err1, iServer.StoreForPathL(iFilename));
- }
- if(iTargetUri != KNullDesC)
- {
- TRAP(err2, iServer.StoreForPathL(iTargetUri));
- }
// if trying to access Z drive, don't try to store
// don't want to store custom sizes
- if( err1 == KErrAccessDenied || err2 == KErrAccessDenied ||
+ if( !isPublic || !isPublic2 ||
+ err1 == KErrAccessDenied || err2 == KErrAccessDenied ||
iThumbnailSize == ECustomThumbnailSize ||
iThumbnailSize == EUnknownThumbnailSize )
{
@@ -450,15 +444,7 @@
}
else
{
- if(iFilename != KNullDesC)
- {
- complTask->SetDoStore(iServer.IsPublicPath( iFilename ));
- }
-
- if(iTargetUri != KNullDesC)
- {
- complTask->SetDoStore(iServer.IsPublicPath( iTargetUri ));
- }
+ complTask->SetDoStore( ETrue );
}
iProcessor.AddTaskL( complTask );
@@ -506,14 +492,14 @@
if(iFilename != KNullDesC)
{
iServer.StoreForPathL( iFilename )->StoreThumbnailL(
- iFilename, tempBitmap, aOriginalSize, EFalse, iThumbnailSize, iModified, EFalse, ETrue );
+ iFilename, tempBitmap, aOriginalSize, EFalse, iThumbnailSize, iModified, !iVirtualUri, ETrue );
//remove result from fetched checker
iServer.FetchedChecker().SetFetchResult( iFilename, KErrNone );
}
else if(iTargetUri != KNullDesC)
{
iServer.StoreForPathL( iTargetUri )->StoreThumbnailL(
- iTargetUri, tempBitmap, aOriginalSize, EFalse, iThumbnailSize, iModified, EFalse, ETrue );
+ iTargetUri, tempBitmap, aOriginalSize, EFalse, iThumbnailSize, iModified, !iVirtualUri, ETrue );
//remove result from fetched checker
iServer.FetchedChecker().SetFetchResult( iTargetUri, KErrNone );
}
--- a/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailscaletask.cpp Wed Jun 23 18:33:48 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailscaletask.cpp Tue Jul 06 14:37:18 2010 +0300
@@ -42,14 +42,15 @@
aBitmap, const TSize& aOriginalSize, const TSize& aTargetSize, TBool aCrop,
TDisplayMode aDisplayMode, TInt aPriority, const TDesC& aTargetUri,
const TThumbnailSize aThumbnailSize, const TInt64 aModified,
- TBool aBitmapToPool, const TBool aEXIF, const TThumbnailServerRequestId aRequestId)
+ TBool aBitmapToPool, const TBool aEXIF, const TThumbnailServerRequestId aRequestId,
+ const TBool aImportVirtual)
{
// We take ownership of aBitmap
CleanupStack::PushL( aBitmap );
CThumbnailScaleTask* self = new( ELeave )CThumbnailScaleTask( aProcessor,
aServer, aFilename, aBitmap, aOriginalSize, aTargetSize, aCrop,
aDisplayMode, aPriority, aTargetUri, aThumbnailSize, aModified,
- aBitmapToPool, aEXIF, aRequestId);
+ aBitmapToPool, aEXIF, aRequestId, aImportVirtual);
CleanupStack::Pop( aBitmap );
CleanupStack::PushL( self );
self->ConstructL();
@@ -68,12 +69,13 @@
const TSize& aOriginalSize, const TSize& aTargetSize, TBool aCrop,
TDisplayMode aDisplayMode, TInt aPriority, const TDesC& aTargetUri,
const TThumbnailSize aThumbnailSize, const TInt64 aModified,
- TBool aBitmapToPool, const TBool aEXIF, const TThumbnailServerRequestId aRequestId):
+ TBool aBitmapToPool, const TBool aEXIF, const TThumbnailServerRequestId aRequestId,
+ const TBool aVirtualUri):
CThumbnailTask( aProcessor, aPriority ), iServer( aServer ), iOwnBitmap( aBitmap ),
iOriginalSize( aOriginalSize ), iTargetSize(aTargetSize), iTargetSizeTN( aTargetSize ), iCrop( aCrop ),
iDisplayMode( aDisplayMode ), iFilename( aFilename ), iTargetUri( aTargetUri ),
iThumbnailSize(aThumbnailSize), iModified(aModified),
- iBitmapToPool(aBitmapToPool), iEXIF(aEXIF)
+ iBitmapToPool(aBitmapToPool), iEXIF(aEXIF), iVirtualUri( aVirtualUri )
{
TN_DEBUG2( "CThumbnailScaleTask(0x%08x)::CThumbnailScaleTask()", this );
@@ -348,17 +350,20 @@
if (iFilename != KNullDesC && iFilename.CompareF(iTargetUri) == 0)
{
// filename and target URI match, so thumb created from associated path
- iServer.StoreThumbnailL( iTargetUri, iScaledBitmap, iOriginalSize, iCrop, iThumbnailSize, iModified, ETrue );
+ iServer.StoreThumbnailL( iTargetUri, iScaledBitmap, iOriginalSize, iCrop,
+ iThumbnailSize, iModified, !iVirtualUri, !iVirtualUri );
}
else
{
// thumb not created from associated path
- iServer.StoreThumbnailL( iTargetUri, iScaledBitmap, iOriginalSize, iCrop, iThumbnailSize, iModified, EFalse, EFalse );
+ iServer.StoreThumbnailL( iTargetUri, iScaledBitmap, iOriginalSize, iCrop,
+ iThumbnailSize, iModified, !iVirtualUri, EFalse );
}
}
else if (iFilename != KNullDesC)
{
- iServer.StoreThumbnailL( iFilename, iScaledBitmap, iOriginalSize, iCrop, iThumbnailSize, iModified, ETrue );
+ iServer.StoreThumbnailL( iFilename, iScaledBitmap, iOriginalSize, iCrop,
+ iThumbnailSize, iModified, !iVirtualUri, !iVirtualUri );
}
}
--- a/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailserver.cpp Wed Jun 23 18:33:48 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailserver.cpp Tue Jul 06 14:37:18 2010 +0300
@@ -43,6 +43,7 @@
_LIT8( KThumbnailMimeImage, "image" );
_LIT8( KThumbnailMimeVideo, "video" );
_LIT8( KThumbnailMimeAudio, "audio" );
+_LIT8( KThumbnailMimeContact, "contact" );
const TChar KThumbnailMimeSeparatorChar = '/';
const TChar KThumbnailMimeWildCardChar = '*';
@@ -285,8 +286,11 @@
iUnmountedDrives.Close();
delete iFetchedChecker;
+ iFetchedChecker = NULL;
delete iShutdownObserver;
+ iShutdownObserver = NULL;
delete iProcessor;
+ iProcessor = NULL;
if(iReconnect)
{
@@ -306,7 +310,9 @@
iUnmountObservers.ResetAndDestroy();
delete iMMCObserver;
+ iMMCObserver = NULL;
delete iFormatObserver;
+ iFormatObserver = NULL;
THashMapIter < TInt, TThumbnailBitmapRef > bpiter( iBitmapPool );
@@ -320,11 +326,13 @@
}
delete iScaler;
+ iScaler = NULL;
iBitmapPool.Close();
iFbsSession.Disconnect();
iRecognizer.Close();
iPluginInfoArray.ResetAndDestroy();
delete iCenrep;
+ iCenrep = NULL;
iFs.Close();
REComSession::FinalClose();
}
@@ -439,8 +447,7 @@
TN_DEBUG2( "CThumbnailServer::DropSession() aSession = 0x%08x", aSession );
- // clean-up bitmap pool
-
+ // clean-up bitmap pool
THashMapIter < TInt, TThumbnailBitmapRef > bpiter( iBitmapPool );
// const pointer to a non-const object
@@ -457,8 +464,8 @@
TN_DEBUG2( "CThumbnailServer::DropSession() - deleted bitmap, left=%d", iBitmapPool.Count());
}
- ref = bpiter.NextValue();
+ ref = bpiter.NextValue();
}
if ( iSessionCount <= 0 )
@@ -549,12 +556,12 @@
if (!aCheckExist)
{
StoreForPathL( aPath )->StoreThumbnailL( aPath, aBitmap, aOriginalSize,
- aCropped, aThumbnailSize, aModified, aThumbFromPath );
+ aCropped, aThumbnailSize, aModified, aThumbFromPath, EFalse );
}
else if(BaflUtils::FileExists( iFs, aPath))
{
StoreForPathL( aPath )->StoreThumbnailL( aPath, aBitmap, aOriginalSize,
- aCropped, aThumbnailSize, aModified, aThumbFromPath );
+ aCropped, aThumbnailSize, aModified, aThumbFromPath, EFalse );
}
else
{
@@ -796,7 +803,7 @@
// -----------------------------------------------------------------------------
-// CThumbnailServer::GetProviderL()
+// CThumbnailServer::PreLoadProviders()
// -----------------------------------------------------------------------------
//
void CThumbnailServer::PreLoadProviders( )
@@ -806,7 +813,7 @@
for(TInt i=0; i< iPluginInfoArray.Count(); i++)
{
- TRAP(err, GetProviderL( iPluginInfoArray[i]->ImplementationUid()));
+ TRAP(err, GetProviderL( iPluginInfoArray[i]->ImplementationUid()));
}
}
@@ -829,20 +836,17 @@
// -----------------------------------------------------------------------------
//
TInt CThumbnailServer::DequeTask( const TThumbnailServerRequestId& aRequestId )
- {
-
+ {
TInt error = iProcessor->RemoveTask( aRequestId );
- // clean-up bitmap pool
-
+ // clean-up bitmap pool
THashMapIter < TInt, TThumbnailBitmapRef > bpiter( iBitmapPool );
// const pointer to a non-const object
const TThumbnailBitmapRef* ref = bpiter.NextValue();
while ( ref )
- {
-
+ {
TN_DEBUG2( "CThumbnailServer::DequeTask() - ref->iRequestId = %d", ref->iRequestId );
if ( ref->iSession == aRequestId.iSession &&
@@ -852,10 +856,10 @@
bpiter.RemoveCurrent();
TN_DEBUG2( "CThumbnailServer::DequeTask() - deleted bitmap, left=%d",
- iBitmapPool.Count());
+ iBitmapPool.Count());
}
- ref = bpiter.NextValue();
+ ref = bpiter.NextValue();
}
return error;
@@ -1335,8 +1339,7 @@
TInt CThumbnailServer::MimeTypeFromFileExt( const TDesC& aFileName, TDataType& aMimeType )
{
TBool found = ETrue;
- TParsePtrC parse( aFileName );
- TPtrC ext( parse.Ext() );
+ TPtrC ext( aFileName.Right(KExtLength) ); // tparse panics with virtual URI
if ( ext.CompareF( KJpegExt ) == 0 || ext.CompareF( KJpgExt ) == 0)
{
@@ -1446,6 +1449,10 @@
{
aMimeType = TDataType( KMatroskaVideoMime );
}
+ else if ( ext.CompareF( KContactExt ) == 0 )
+ {
+ aMimeType = TDataType( KContactMime );
+ }
else
{
aMimeType = TDataType( KNullDesC8 );
@@ -1483,6 +1490,10 @@
{
return TThumbnailPersistentSize::EAudio;
}
+ else if (mediaType.Compare(KThumbnailMimeContact) == 0)
+ {
+ return TThumbnailPersistentSize::EContact;
+ }
return TThumbnailPersistentSize::EUnknownSourceType;
}
@@ -1512,6 +1523,11 @@
case EAudioFullScreenThumbnailSize:
sourceType = TThumbnailPersistentSize::EAudio;
break;
+ case EContactListThumbnailSize:
+ case EContactGridThumbnailSize:
+ case EContactFullScreenThumbnailSize:
+ sourceType = TThumbnailPersistentSize::EContact;
+ break;
default:
sourceType = TThumbnailPersistentSize::EUnknownSourceType;
}
@@ -1531,24 +1547,29 @@
mimeType.CompareF( KJpeg2000Mime ) == 0 ||
mimeType.CompareF( KGifMime ) == 0 ||
mimeType.CompareF( KPngMime ) == 0 ||
- mimeType.CompareF( KBmpMime ) == 0 ||
+ mimeType.CompareF( KSvgMime ) == 0 ||
mimeType.CompareF( KMpgMime1 ) == 0 ||
mimeType.CompareF( KMpeg4Mime ) == 0 ||
mimeType.CompareF( KMp4Mime ) == 0 ||
mimeType.CompareF( KAviMime ) == 0 ||
- mimeType.CompareF( KVideo3gppMime ) == 0 ||
- mimeType.CompareF( KVideoWmvMime ) == 0 ||
- mimeType.CompareF( KRealVideoMime ) == 0 ||
mimeType.CompareF( KMp3Mime ) == 0 ||
+ mimeType.CompareF( KNonEmbeddArtMime ) == 0 ||
+ mimeType.CompareF( KM4aMime ) == 0 ||
mimeType.CompareF( KAacMime ) == 0 ||
mimeType.CompareF( KWmaMime ) == 0 ||
+ mimeType.CompareF( KBmpMime ) == 0 ||
+ mimeType.CompareF( KAudio3gppMime ) == 0 ||
+ mimeType.CompareF( KVideo3gppMime ) == 0 ||
mimeType.CompareF( KAudioAmrMime ) == 0 ||
+ mimeType.CompareF( KVideoWmvMime ) == 0 ||
mimeType.CompareF( KRealAudioMime ) == 0 ||
- mimeType.CompareF( KM4aMime ) == 0 ||
- mimeType.CompareF( KFlashVideoMime ) == 0 ||
+ mimeType.CompareF( KPmRealAudioPluginMime ) == 0 ||
mimeType.CompareF( KPmRealVideoPluginMime ) == 0 ||
mimeType.CompareF( KPmRealVbVideoPluginMime ) == 0 ||
- mimeType.CompareF( KPmRealAudioPluginMime ) == 0 )
+ mimeType.CompareF( KRealVideoMime ) == 0 ||
+ mimeType.CompareF( KFlashVideoMime ) == 0 ||
+ mimeType.CompareF( KMatroskaVideoMime ) == 0 ||
+ mimeType.CompareF( KContactMime ) == 0 )
{
return ETrue;
}
@@ -1770,7 +1791,7 @@
// ---------------------------------------------------------------------------
-// CThumbnailServer::ReconnectCallBack()
+// CThumbnailServer::UnmountCallBack()
// ---------------------------------------------------------------------------
//
TInt CThumbnailServer::UnmountCallBack(TAny* aAny)
--- a/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailserversession.cpp Wed Jun 23 18:33:48 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailserversession.cpp Tue Jul 06 14:37:18 2010 +0300
@@ -55,6 +55,10 @@
CThumbnailServerSession::~CThumbnailServerSession()
{
Server()->DropSession(this);
+ delete iBitmap;
+ iBitmap = NULL;
+ delete iBuffer;
+ iBuffer = NULL;
}
@@ -458,6 +462,12 @@
ModifyThumbnailSize(sourceType);
}
+ // delete existing
+ if(params.iImport && params.iOverwrite)
+ {
+ Server()->DeleteThumbnailsL( params.iTargetUri);
+ }
+
// CreateThumbnails
if (params.iControlFlags == EThumbnailGeneratePersistentSizesOnly)
{
@@ -615,6 +625,19 @@
TN_DEBUG2(
"CThumbnailServerSession::RequestThumbByPathAsyncL() - thumbnail not found, err = %d", err );
+ // don't try to create from virtual URI
+ if ( params.iVirtualUri )
+ {
+ User::Leave(err);
+ }
+
+ // disk space check only for stored sizes
+ if ( params.iThumbnailSize != ECustomThumbnailSize &&
+ Server()->StoreForPathL(params.iFileName)->IsDiskFull() )
+ {
+ User::Leave( KErrDiskFull );
+ }
+
if ( (err == KErrNotFound || err == KErrAccessDenied) &&
!(params.iFlags& CThumbnailManager::EDoNotCreate) )
{
@@ -622,17 +645,6 @@
// and retry the request using file handle
err = KThumbnailErrThumbnailNotFound;
}
- else
- {
- User::Leave(err);
- }
-
- // disk space check only for stored sizes
- if ( params.iThumbnailSize != ECustomThumbnailSize &&
- Server()->StoreForPathL(params.iFileName)->IsDiskFull() )
- {
- User::Leave( KErrDiskFull );
- }
User::Leave(err);
}
@@ -803,7 +815,8 @@
*Server(), params.iTargetUri, bitmap, bitmapSize,
(*missingSizes)[i].iSize, (*missingSizes)[i].iCrop, params.iDisplayMode,
KMaxPriority, KNullDesC, (*missingSizes)[i].iType, params.iModified, EFalse, EFalse,
- reqId);
+ reqId, params.iVirtualUri);
+
CleanupStack::PushL( scaleTask );
scaleTask->SetDoStore( ETrue );
Server()->Processor().AddTaskL( scaleTask );
@@ -851,7 +864,12 @@
"CThumbnailServerSession::CreateGenerateTaskFromFileHandleL() -- create thumbnail generation task for %S", ¶ms.iFileName );
// disk space check only for stored sizes
- if ( params.iThumbnailSize != ECustomThumbnailSize &&
+ if ( params.iImport &&
+ Server()->StoreForPathL(params.iTargetUri)->IsDiskFull() )
+ {
+ User::Leave( KErrDiskFull );
+ }
+ else if ( params.iThumbnailSize != ECustomThumbnailSize &&
Server()->StoreForPathL(params.iFileName)->IsDiskFull() )
{
User::Leave( KErrDiskFull );
@@ -869,13 +887,20 @@
TBool gridSizeOnly(EFalse);
- if ( params.iQualityPreference == CThumbnailManager
- ::EOptimizeForQualityWithPreview )
+ if ( params.iQualityPreference == CThumbnailManager::EOptimizeForQualityWithPreview )
{
gridSizeOnly = ETrue;
}
- Server()->GetMissingSizesL( params.iFileName, sourceType, *missingSizes, gridSizeOnly);
+ // import vs. normal
+ if(params.iImport)
+ {
+ Server()->GetMissingSizesL( params.iTargetUri, sourceType, *missingSizes, gridSizeOnly);
+ }
+ else
+ {
+ Server()->GetMissingSizesL( params.iFileName, sourceType, *missingSizes, gridSizeOnly);
+ }
if ( missingSizes->Count() == 0)
{
@@ -926,7 +951,8 @@
CThumbnailGenerateTask* task = new( ELeave )CThumbnailGenerateTask( Server()
->Processor(), * Server(), aFile, NULL, ¶ms.iMimeType, params.iFlags,
params.iSize, params.iDisplayMode, priority, missingSizes, params.iTargetUri,
- params.iThumbnailSize, params.iModified, params.iQualityPreference );
+ params.iThumbnailSize, params.iModified, params.iQualityPreference,
+ params.iVirtualUri);
// do not store bitmaps to server pool when generating only
if( params.iControlFlags & EThumbnailGeneratePersistentSizesOnly )
@@ -1038,7 +1064,8 @@
CThumbnailGenerateTask* task = new( ELeave )CThumbnailGenerateTask( Server()
->Processor(), * Server(), NULL, aBuffer, ¶ms.iMimeType, params.iFlags,
params.iSize, params.iDisplayMode, priority, missingSizes, params.iTargetUri,
- params.iThumbnailSize, params.iModified, params.iQualityPreference );
+ params.iThumbnailSize, params.iModified, params.iQualityPreference,
+ params.iVirtualUri);
// do not store bitmaps to server pool when generating only
if( params.iControlFlags & EThumbnailGeneratePersistentSizesOnly )
@@ -1332,6 +1359,21 @@
params.iThumbnailSize = EAudioListThumbnailSize;
}
}
+ else if(aSourceType == TThumbnailPersistentSize::EContact)
+ {
+ if(params.iThumbnailSize == EFullScreenThumbnailSize)
+ {
+ params.iThumbnailSize = EContactFullScreenThumbnailSize;
+ }
+ else if(params.iThumbnailSize == EGridThumbnailSize)
+ {
+ params.iThumbnailSize = EContactGridThumbnailSize;
+ }
+ else if(params.iThumbnailSize == EListThumbnailSize)
+ {
+ params.iThumbnailSize = EContactListThumbnailSize;
+ }
+ }
}
//------------------------------------------------------------------------
@@ -1345,34 +1387,42 @@
// mime type
if ( params.iMimeType.Des8() == KNullDesC8 && !Server()->SupportedMimeType(params.iMimeType) )
- {
- // try parsing from file extension
- res = Server()->MimeTypeFromFileExt( params.iFileName, params.iMimeType );
- if ( res == KErrNotFound )
- {
- if( aFile )
- {
- // parsed type not in the list, resolve from file
- params.iMimeType = Server()->ResolveMimeTypeL(*aFile);
- }
- else
- {
- Server()->Fs().ShareProtected();
- RFile64 file;
- CleanupClosePushL( file );
-
- User::LeaveIfError( file.Open( Server()->Fs(), params.iFileName, EFileShareReadersOrWriters ));
- TN_DEBUG2( "CThumbnailServerSession::ResolveMimeType - file handle opened for %S", ¶ms.iFileName );
-
- params.iMimeType = Server()->ResolveMimeTypeL(file);
-
- file.Close();
- TN_DEBUG1("CThumbnailServerSession::ResolveMimeType - file handle closed");
-
- CleanupStack::Pop( &file );
- }
- }
- }
+ {
+ // try parsing from file extension
+ if (params.iImport)
+ {
+ res = Server()->MimeTypeFromFileExt( params.iTargetUri, params.iMimeType );
+ }
+ else
+ {
+ res = Server()->MimeTypeFromFileExt( params.iFileName, params.iMimeType );
+ }
+
+ if ( res == KErrNotFound )
+ {
+ if( aFile )
+ {
+ // parsed type not in the list, resolve from file
+ params.iMimeType = Server()->ResolveMimeTypeL(*aFile);
+ }
+ else
+ {
+ Server()->Fs().ShareProtected();
+ RFile64 file;
+ CleanupClosePushL( file );
+
+ User::LeaveIfError( file.Open( Server()->Fs(), params.iFileName, EFileShareReadersOrWriters ));
+ TN_DEBUG2( "CThumbnailServerSession::ResolveMimeType - file handle opened for %S", ¶ms.iFileName );
+
+ params.iMimeType = Server()->ResolveMimeTypeL(file);
+
+ file.Close();
+ TN_DEBUG1("CThumbnailServerSession::ResolveMimeType - file handle closed");
+
+ CleanupStack::Pop( &file );
+ }
+ }
+ }
}
@@ -1383,12 +1433,20 @@
TInt CThumbnailServerSession::ConvertSqlErrToE32Err( TInt aReason )
{
TN_DEBUG2("CThumbnailServerSession::ConvertSqlErrToE32Err(%d)", aReason);
- TInt e32Err;
+ TInt e32Err(aReason);
+
if ( aReason >= - 144 )
// magic: [-1..-144] is E32 error range
{
// E32 error value or non-negative value
- e32Err = aReason;
+ switch ( aReason )
+ {
+ case KErrServerTerminated:
+ e32Err = KErrCorrupt;
+ break;
+ default:
+ e32Err = aReason;
+ }
}
else
{
@@ -1505,4 +1563,5 @@
}
}
+
// End of file
--- a/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailstore.cpp Wed Jun 23 18:33:48 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailstore.cpp Tue Jul 06 14:37:18 2010 +0300
@@ -47,7 +47,6 @@
//Symbian^4 v5
_LIT( KThumbnailDatabaseName, ":[102830AB]thumbnail_v5.db" );
-_LIT( KDrv, ":");
// Allow access to database only for the server process
const TSecurityPolicy KThumbnailDatabaseSecurityPolicy( TSecureId(
@@ -548,13 +547,15 @@
TInt column = 0;
TInt rowStatus = 0;
TInt64 inforows = -1;
+ TInt64 infocount = -1;
TInt64 datarows = -1;
+ TInt64 datacount = -1;
TInt ret = stmt.Prepare( iDatabase, KGetInfoRowID );
if(ret < 0)
{
stmt.Close();
- TN_DEBUG1( "CThumbnailStore::CheckRowIDs() failed 1 %d");
+ TN_DEBUG1( "CThumbnailStore::CheckRowIDs() KGetInfoRowID failed %d");
return KErrNotSupported;
}
rowStatus = stmt.Next();
@@ -572,14 +573,39 @@
TPtrC errorMsg2 = iDatabase.LastErrorMessage();
TN_DEBUG2( "RThumbnailTransaction::ResetThumbnailIDs() lastError %S, ret = %d" , &errorMsg2);
#endif
- return ret;
+ return KErrNotSupported;
+ }
+
+ ret = stmt.Prepare( iDatabase, KGetInfoCount );
+ if(ret < 0)
+ {
+ stmt.Close();
+ TN_DEBUG1( "CThumbnailStore::CheckRowIDs() KGetInfoCount failed %d");
+ return KErrNotSupported;
+ }
+ rowStatus = stmt.Next();
+
+ if ( rowStatus == KSqlAtRow)
+ {
+ infocount = stmt.ColumnInt64( column );
+ }
+
+ stmt.Close();
+
+ if(rowStatus < 0)
+ {
+#ifdef _DEBUG
+ TPtrC errorMsg2 = iDatabase.LastErrorMessage();
+ TN_DEBUG2( "RThumbnailTransaction::ResetThumbnailIDs() lastError %S, ret = %d" , &errorMsg2);
+#endif
+ return KErrNotSupported;
}
ret = stmt.Prepare( iDatabase, KGetDataRowID );
if(ret < 0)
{
stmt.Close();
- TN_DEBUG1( "CThumbnailStore::CheckRowIDs() failed 2");
+ TN_DEBUG1( "CThumbnailStore::CheckRowIDs() KGetDataRowID failed");
return KErrNotSupported;
}
rowStatus = stmt.Next();
@@ -597,10 +623,40 @@
TPtrC errorMsg2 = iDatabase.LastErrorMessage();
TN_DEBUG2( "RThumbnailTransaction::ResetThumbnailIDs() lastError %S, ret = %d" , &errorMsg2);
#endif
- return ret;
+ return KErrNotSupported;
+ }
+
+ ret = stmt.Prepare( iDatabase, KGetInfoDataCount );
+ if(ret < 0)
+ {
+ stmt.Close();
+ TN_DEBUG1( "CThumbnailStore::CheckRowIDs() KGetInfoDataCount failed %d");
+ return KErrNotSupported;
+ }
+ rowStatus = stmt.Next();
+
+ if ( rowStatus == KSqlAtRow)
+ {
+ datacount = stmt.ColumnInt64( column );
}
+
+ stmt.Close();
+
+ if(rowStatus < 0)
+ {
+#ifdef _DEBUG
+ TPtrC errorMsg2 = iDatabase.LastErrorMessage();
+ TN_DEBUG2( "RThumbnailTransaction::ResetThumbnailIDs() lastError %S, ret = %d" , &errorMsg2);
+#endif
+ return KErrNotSupported;
+ }
+
+ TN_DEBUG2( "CThumbnailStore::CheckRowIDsL() - inforows %Ld", inforows );
+ TN_DEBUG2( "CThumbnailStore::CheckRowIDsL() - infocount %Ld", infocount );
+ TN_DEBUG2( "CThumbnailStore::CheckRowIDsL() - datarows %Ld", datarows );
+ TN_DEBUG2( "CThumbnailStore::CheckRowIDsL() - datacount %Ld", datacount );
- if( inforows != datarows)
+ if( inforows != datarows || datacount != infocount)
{
TN_DEBUG1( "CThumbnailStore::CheckRowIDsL() - tables out of sync" );
return KErrNotSupported;
@@ -1355,7 +1411,7 @@
StoreThumbnailL( *path, buf->Ptr( 0 ), aThumbnail->SizeInPixels(),
aOriginalSize, EThumbnailFormatFbsBitmap, flags,
- aThumbnailSize, aModified);
+ aThumbnailSize, aModified, aThumbFromPath);
CleanupStack::PopAndDestroy( buf );
}
@@ -2613,11 +2669,21 @@
void CThumbnailStore::StripDriveLetterL( TDes& aPath )
{
TInt pos = aPath.Find(KDrv);
+ TInt pos2 = aPath.Find(KBackSlash);
// if URI contains drive letter
if ( pos == 1 )
{
- aPath.Delete(0,pos+1);
+ // normal URI
+ if ( pos2 == 2 )
+ {
+ aPath.Delete(0,pos+1);
+ }
+ // virtual URI
+ else
+ {
+ aPath.Replace(0,2,KBackSlash);
+ }
}
}
--- a/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailtask.cpp Wed Jun 23 18:33:48 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailtask.cpp Tue Jul 06 14:37:18 2010 +0300
@@ -211,7 +211,6 @@
void CThumbnailTask::ResetMessageData()
{
iMessage = RMessage2();
- iRequestId = TThumbnailServerRequestId();
}
--- a/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailtaskprocessor.cpp Wed Jun 23 18:33:48 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailtaskprocessor.cpp Tue Jul 06 14:37:18 2010 +0300
@@ -183,6 +183,11 @@
TaskComplete(NULL);
}
+ if(!iTasks.Count())
+ {
+ iTasks.Compress();
+ }
+
TN_DEBUG2( "CThumbnailTaskProcessor::RemoveTask() - remaining task count: %d", iTasks.Count());
return res;