--- a/camerauis/cameraxui/cxengine/src/cxethumbnailmanagersymbian.cpp Thu May 13 21:30:19 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxethumbnailmanagersymbian.cpp Thu Jul 15 01:55:05 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -21,7 +21,7 @@
#include "cxutils.h"
#include "cxethumbnailmanagersymbian.h"
-//#define CXE_USE_THUMBNAIL_MANAGER
+
/*!
@@ -31,14 +31,11 @@
{
CX_DEBUG_ENTER_FUNCTION();
-#ifdef CXE_USE_THUMBNAIL_MANAGER
-
mThumbnailManager = new ThumbnailManager();
// connect thumbnail ready signal from thumbnailmanager
connect(mThumbnailManager, SIGNAL(thumbnailReady(QPixmap, void *, int, int)),
this, SLOT(thumbnailReady(QPixmap, void *, int, int)));
-#endif
CX_DEBUG_EXIT_FUNCTION();
}
@@ -51,10 +48,8 @@
{
CX_DEBUG_ENTER_FUNCTION();
-#ifdef CXE_USE_THUMBNAIL_MANAGER
mThumbnailRequests.clear();
delete mThumbnailManager;
-#endif
CX_DEBUG_EXIT_FUNCTION();
}
@@ -66,20 +61,17 @@
@param filename - name of the image/video filename
@param snapshot - snapshot data from image/video
*/
-void CxeThumbnailManagerSymbian::createThumbnail(const QString& filename,
- QPixmap /*snapshot*/)
+void CxeThumbnailManagerSymbian::createThumbnail(const QString &filename,
+ const QImage &snapshot)
{
CX_DEBUG_ENTER_FUNCTION();
-#ifdef CXE_USE_THUMBNAIL_MANAGER
TPtrC16 fName(reinterpret_cast<const TUint16*>(filename.utf16()));
CX_DEBUG(("Create thumbnail! filename = %s", filename.toAscii().constData()));
if (mThumbnailManager) {
CX_DEBUG(("creating thumbnails"));
- //!@todo Thumbnail manager interface needs to be changed to use QImage
- // instead of QPixmap for setThumbnail. Until then, using qetThumbnail.
- int thumbnailId = mThumbnailManager->getThumbnail(filename, 0);
+ int thumbnailId = mThumbnailManager->setThumbnail(snapshot, filename);
if (thumbnailId != -1) {
CX_DEBUG(("Thumbnail ID = %d", thumbnailId));
mThumbnailRequests.insert(filename, thumbnailId);
@@ -87,9 +79,6 @@
CX_DEBUG(("error initializing data to thumbnail manager"));
}
}
-#else
- Q_UNUSED(filename);
-#endif
CX_DEBUG_EXIT_FUNCTION();
}
@@ -103,7 +92,6 @@
{
CX_DEBUG_ENTER_FUNCTION();
-#ifdef CXE_USE_THUMBNAIL_MANAGER
if (mThumbnailRequests.contains(filename)) {
int thumbnailId = mThumbnailRequests.value(filename);
if (mThumbnailManager &&
@@ -112,9 +100,7 @@
mThumbnailRequests.remove(filename);
}
}
-#else
- Q_UNUSED(filename);
-#endif
+
CX_DEBUG_EXIT_FUNCTION();
}
@@ -131,8 +117,9 @@
CX_DEBUG_ENTER_FUNCTION();
+ Q_UNUSED(thumbnail);
Q_UNUSED(data);
-#ifdef CXE_USE_THUMBNAIL_MANAGER
+
CX_DEBUG(("CxeThumbnailManagerSymbian::thumbnailReady error = %d", error));
QString key;
@@ -149,13 +136,7 @@
if (mThumbnailRequests.contains(key)) {
CX_DEBUG(("Thumbnail created for filename = %s", key.toAscii().constData()));
mThumbnailRequests.remove(key);
- emit thumbnailReady(thumbnail, error);
}
-#else
- Q_UNUSED(thumbnail);
- Q_UNUSED(id);
- Q_UNUSED(error);
-#endif
CX_DEBUG_EXIT_FUNCTION();
}