--- a/clfwrapper/ClientSrc/CCLFServerProxy.cpp Tue Feb 02 00:24:33 2010 +0200
+++ b/clfwrapper/ClientSrc/CCLFServerProxy.cpp Fri Feb 19 23:14:48 2010 +0200
@@ -32,7 +32,7 @@
// CONSTANTS
const TInt KCLFDefaultBufferLength( 64 );
const TInt KCLFDefaultArrayGranularity( 4 );
-const TInt KCLFExtensionArrayGranularity( 49 );
+const TInt KCLFExtensionArrayGranularity( 50 );
_LIT( KCLFDriveLetterFormatString, ":\\" );
const TInt KCLFDriveC( 'C' );
@@ -92,6 +92,7 @@
_LIT( KExtensionRv, "rv" );
_LIT( KExtensionWmv, "wmv" );
_LIT( KExtensionAvi, "avi" );
+_LIT( KExtensionDivx, "divx" );
// ======== MEMBER FUNCTIONS ========
@@ -733,16 +734,10 @@
//
TBool CUpdateFoldersHandler::IsSupportedType( const TDesC& aExtension )
{
- TCollationMethod m = *Mem::CollationMethodByIndex( 0 );
- m.iFlags = ( TCollationMethod::EIgnoreNone | TCollationMethod::EFoldCase );
-
- for( TInt i( 0 ); i < iExtensionArray->Count(); i++ )
+ TInt pos( 0 );
+ if ( iExtensionArray->FindIsq( aExtension, pos ) == 0 ) // found
{
- const TDesC& ext = iExtensionArray->MdcaPoint( i );
- if ( ext.CompareC( aExtension, 3, &m ) == 0 )
- {
- return ETrue;
- }
+ return ETrue;
}
return EFalse;
}
@@ -1238,58 +1233,59 @@
void CCLFServerProxy::PopulateSupportedExtensionL()
{
iExtensionArray = new ( ELeave ) CDesCArraySeg( KCLFExtensionArrayGranularity );
- iExtensionArray->AppendL( KExtensionMp3 );
- iExtensionArray->AppendL( KExtensionAac );
- iExtensionArray->AppendL( KExtensionAmr );
- iExtensionArray->AppendL( KExtensionAwb );
- iExtensionArray->AppendL( KExtensionMid );
- iExtensionArray->AppendL( KExtensionMidi );
- iExtensionArray->AppendL( KExtensionSpMid );
- iExtensionArray->AppendL( KExtensionRng );
- iExtensionArray->AppendL( KExtensionMxmf );
- iExtensionArray->AppendL( KExtensionWav );
- iExtensionArray->AppendL( KExtensionAu );
- iExtensionArray->AppendL( KExtensionNrt );
- iExtensionArray->AppendL( KExtensionWma );
- iExtensionArray->AppendL( KExtensionRa );
+ iExtensionArray->InsertIsqL( KExtensionMp3 );
+ iExtensionArray->InsertIsqL( KExtensionAac );
+ iExtensionArray->InsertIsqL( KExtensionAmr );
+ iExtensionArray->InsertIsqL( KExtensionAwb );
+ iExtensionArray->InsertIsqL( KExtensionMid );
+ iExtensionArray->InsertIsqL( KExtensionMidi );
+ iExtensionArray->InsertIsqL( KExtensionSpMid );
+ iExtensionArray->InsertIsqL( KExtensionRng );
+ iExtensionArray->InsertIsqL( KExtensionMxmf );
+ iExtensionArray->InsertIsqL( KExtensionWav );
+ iExtensionArray->InsertIsqL( KExtensionAu );
+ iExtensionArray->InsertIsqL( KExtensionNrt );
+ iExtensionArray->InsertIsqL( KExtensionWma );
+ iExtensionArray->InsertIsqL( KExtensionRa );
- iExtensionArray->AppendL( KExtJpg );
- iExtensionArray->AppendL( KExtJpeg );
- iExtensionArray->AppendL( KExtJp2 );
- iExtensionArray->AppendL( KExtJ2k );
- iExtensionArray->AppendL( KExtJpx );
- iExtensionArray->AppendL( KExtJpf );
- iExtensionArray->AppendL( KExtMbm );
- iExtensionArray->AppendL( KExtPng );
- iExtensionArray->AppendL( KExtGif );
- iExtensionArray->AppendL( KExtBmp );
- iExtensionArray->AppendL( KExtTif );
- iExtensionArray->AppendL( KExtTiff );
- iExtensionArray->AppendL( KExtOta );
- iExtensionArray->AppendL( KExtWbmp );
- iExtensionArray->AppendL( KExtWmf );
- iExtensionArray->AppendL( KExtOtb );
+ iExtensionArray->InsertIsqL( KExtJpg );
+ iExtensionArray->InsertIsqL( KExtJpeg );
+ iExtensionArray->InsertIsqL( KExtJp2 );
+ iExtensionArray->InsertIsqL( KExtJ2k );
+ iExtensionArray->InsertIsqL( KExtJpx );
+ iExtensionArray->InsertIsqL( KExtJpf );
+ iExtensionArray->InsertIsqL( KExtMbm );
+ iExtensionArray->InsertIsqL( KExtPng );
+ iExtensionArray->InsertIsqL( KExtGif );
+ iExtensionArray->InsertIsqL( KExtBmp );
+ iExtensionArray->InsertIsqL( KExtTif );
+ iExtensionArray->InsertIsqL( KExtTiff );
+ iExtensionArray->InsertIsqL( KExtOta );
+ iExtensionArray->InsertIsqL( KExtWbmp );
+ iExtensionArray->InsertIsqL( KExtWmf );
+ iExtensionArray->InsertIsqL( KExtOtb );
- iExtensionArray->AppendL( KExtOma1 );
- iExtensionArray->AppendL( KExtOma2 );
- iExtensionArray->AppendL( KExtOma3 );
- iExtensionArray->AppendL( KExtOma4 );
- iExtensionArray->AppendL( KExtOma5 );
+ iExtensionArray->InsertIsqL( KExtOma1 );
+ iExtensionArray->InsertIsqL( KExtOma2 );
+ iExtensionArray->InsertIsqL( KExtOma3 );
+ iExtensionArray->InsertIsqL( KExtOma4 );
+ iExtensionArray->InsertIsqL( KExtOma5 );
- iExtensionArray->AppendL( KExtensionMp4 );
- iExtensionArray->AppendL( KExtensionMpg4 );
- iExtensionArray->AppendL( KExtensionMpeg4 );
- iExtensionArray->AppendL( KExtensionM4v );
- iExtensionArray->AppendL( KExtensionM4a );
- iExtensionArray->AppendL( KExtension3gp );
- iExtensionArray->AppendL( KExtension3gpp );
- iExtensionArray->AppendL( KExtension3g2 );
- iExtensionArray->AppendL( KExtensionRm );
- iExtensionArray->AppendL( KExtensionRmvb );
- iExtensionArray->AppendL( KExtensionRam );
- iExtensionArray->AppendL( KExtensionRv );
- iExtensionArray->AppendL( KExtensionWmv );
- iExtensionArray->AppendL( KExtensionAvi );
+ iExtensionArray->InsertIsqL( KExtensionMp4 );
+ iExtensionArray->InsertIsqL( KExtensionMpg4 );
+ iExtensionArray->InsertIsqL( KExtensionMpeg4 );
+ iExtensionArray->InsertIsqL( KExtensionM4v );
+ iExtensionArray->InsertIsqL( KExtensionM4a );
+ iExtensionArray->InsertIsqL( KExtension3gp );
+ iExtensionArray->InsertIsqL( KExtension3gpp );
+ iExtensionArray->InsertIsqL( KExtension3g2 );
+ iExtensionArray->InsertIsqL( KExtensionRm );
+ iExtensionArray->InsertIsqL( KExtensionRmvb );
+ iExtensionArray->InsertIsqL( KExtensionRam );
+ iExtensionArray->InsertIsqL( KExtensionRv );
+ iExtensionArray->InsertIsqL( KExtensionWmv );
+ iExtensionArray->InsertIsqL( KExtensionAvi );
+ iExtensionArray->InsertIsqL( KExtensionDivx );
}
// End of File
--- a/contextengine/group/contextengine.mmp Tue Feb 02 00:24:33 2010 +0200
+++ b/contextengine/group/contextengine.mmp Fri Feb 19 23:14:48 2010 +0200
@@ -54,4 +54,5 @@
PAGED
BYTEPAIRCOMPRESSTARGET
+OPTION ARMCC -O3 -OTime
--- a/contextengine/plugins/calendarplugin/group/calendarcontextplugin.mmp Tue Feb 02 00:24:33 2010 +0200
+++ b/contextengine/plugins/calendarplugin/group/calendarcontextplugin.mmp Fri Feb 19 23:14:48 2010 +0200
@@ -61,4 +61,5 @@
PAGED
BYTEPAIRCOMPRESSTARGET
+OPTION ARMCC -O3 -OTime
--- a/contextengine/src/contextengineao.cpp Tue Feb 02 00:24:33 2010 +0200
+++ b/contextengine/src/contextengineao.cpp Fri Feb 19 23:14:48 2010 +0200
@@ -131,7 +131,8 @@
{
iMdESession = aSession;
- for ( TInt i = 0; i < iPlugins.Count(); ++i )
+ const TInt count( iPlugins.Count() );
+ for ( TInt i = 0; i < count; ++i )
{
iPlugins[i]->SetMdeSession( *aSession );
}
--- a/harvester/blacklistserver/src/blacklistserver.cpp Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/blacklistserver/src/blacklistserver.cpp Fri Feb 19 23:14:48 2010 +0200
@@ -747,14 +747,16 @@
WRITELOG( "CBlacklistServer::CommitBufferedItemsL - begin" );
// First, removed items
- for ( TInt i( 0 ); i < iBufferedRemoveItems.Count(); ++i )
+ const TInt removedCount( iBufferedRemoveItems.Count() );
+ for ( TInt i( 0 ); i < removedCount; ++i )
{
iSqLiteConnection->ExecuteL( KMdsBlacklistDelete, *iBufferedRemoveItems[i] );
iBufferedRemoveItems[i]->Column( 0 ).Free();
}
// Second, added items
- for ( TInt i( 0 ); i < iBufferedAddedItems.Count(); ++i )
+ const TInt addedCount( iBufferedAddedItems.Count() );
+ for ( TInt i( 0 ); i < addedCount; ++i )
{
iSqLiteConnection->ExecuteL( KMdsBlacklistUpdate, *iBufferedAddedItems[i] );
iBufferedAddedItems[i]->Column( 0 ).Free();
--- a/harvester/client/group/harvesterclient.mmp Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/client/group/harvesterclient.mmp Fri Feb 19 23:14:48 2010 +0200
@@ -41,7 +41,6 @@
SOURCEPATH ../src
SOURCE harvesterclient.cpp
SOURCE harvesterclientao.cpp
-SOURCE clientharvestitem.cpp
SOURCE harvestereventobserverao.cpp
SOURCE harvesterrequestactive.cpp
SOURCE harvesterrequestqueue.cpp
--- a/harvester/client/inc/clientharvestitem.h Tue Feb 02 00:24:33 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-/*
-* Copyright (c) 2007-2009 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"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Client harvest item
-*
-*/
-
-
-#ifndef __CCLIENTHARVESTITEM_H__
-#define __CCLIENTHARVESTITEM_H__
-
-#include <e32base.h>
-
-#include "mdccommon.h"
-
-NONSHARABLE_CLASS( RClientHarvestItem )
- {
- public:
- /**
- * Constructor.
- */
- RClientHarvestItem();
-
- /**
- * Copy constructor.
- */
- RClientHarvestItem( const RClientHarvestItem& aItem );
-
- /**
- * Initialize with data.
- */
- void InitL( const TDesC& aURI, RArray<TItemId>& aAlbumIds );
-
- /**
- * Close (release memory).
- */
- void Close();
-
- /**
- * Resets the item. Releases memory.
- */
- void Reset();
-
- private:
-
- /** @var HBufC16* iUri;
- * @brief URI to harvest
- */
- HBufC16* iUri;
-
- /** @var TTime iTimeStamp;
- * @brief Timestamp for the file
- */
- TTime iTimeStamp;
-
- /** @var RArray<TInt> iAlbumIds;
- * @brief Album IDs
- */
- RArray<TItemId> iAlbumIds;
- };
-
-#endif
--- a/harvester/client/inc/harvesterclientao.h Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/client/inc/harvesterclientao.h Fri Feb 19 23:14:48 2010 +0200
@@ -24,7 +24,6 @@
#include <badesca.h>
#include "harvesterclient.h"
-#include "clientharvestitem.h"
class RHarvesterClient;
class MHarvestObserver;
--- a/harvester/client/src/clientharvestitem.cpp Tue Feb 02 00:24:33 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,99 +0,0 @@
-/*
-* Copyright (c) 2007-2009 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"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Client harvest item implementation
-*
-*/
-
-
-#include "clientharvestitem.h"
-#include "harvesterlog.h"
-
-// ---------------------------------------------------------------------------
-// Constructor
-// ---------------------------------------------------------------------------
-//
-RClientHarvestItem::RClientHarvestItem()
- {
- WRITELOG( "RClientHarvestItem::RClientHarvestItem()" );
- iUri = NULL;
- }
-
-// ---------------------------------------------------------------------------
-// Copy constructor
-// ---------------------------------------------------------------------------
-//
-RClientHarvestItem::RClientHarvestItem( const RClientHarvestItem& aItem )
- {
- iUri = aItem.iUri;
- iTimeStamp = aItem.iTimeStamp;
- const TInt count = aItem.iAlbumIds.Count();
- iAlbumIds.Reserve( count );
- for ( TInt i = 0; i < count; i++ )
- {
- iAlbumIds.Append( aItem.iAlbumIds[i] );
- }
- }
-
-// ---------------------------------------------------------------------------
-// InitL
-// ---------------------------------------------------------------------------
-//
-void RClientHarvestItem::InitL( const TDesC& aUri, RArray<TItemId>& aAlbumIds )
- {
- if ( aUri.Length() <= 0 || aUri.Length() > KMaxFileName )
- {
- User::Leave( KErrArgument );
- }
-
- this->Reset();
-
- iTimeStamp.UniversalTime();
- iUri = aUri.AllocL();
- const TInt count = aAlbumIds.Count();
-
- iAlbumIds.Reserve( count );
- for ( TInt i = 0; i < count; i++ )
- {
- iAlbumIds.Append( aAlbumIds[i] );
- }
- }
-
-// ---------------------------------------------------------------------------
-// Reset
-// ---------------------------------------------------------------------------
-//
-void RClientHarvestItem::Reset()
- {
- if ( iUri )
- {
- delete iUri;
- iUri = NULL;
- }
-
- iAlbumIds.Reset();
- }
-
-// ---------------------------------------------------------------------------
-// Close
-// ---------------------------------------------------------------------------
-//
-void RClientHarvestItem::Close()
- {
- Reset();
- iAlbumIds.Close();
- }
-
-
-
-
--- a/harvester/client/src/harvesterclient.cpp Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/client/src/harvesterclient.cpp Fri Feb 19 23:14:48 2010 +0200
@@ -114,11 +114,11 @@
#ifdef _DEBUG
if ( err != KErrNone )
{
- WRITELOG( "RHarvesterClient::Connect() - Server is not running or could not be started" );
+ WRITELOG1( "RHarvesterClient::Connect() - Server is not running or could not be started, error &d", err );
}
else
{
- WRITELOG1( "RHarvesterClient::Connect() - no errors: %d", err );
+ WRITELOG( "RHarvesterClient::Connect() - no errors" );
}
WRITELOG( "RHarvesterClient::Connect() - end" );
#endif
@@ -463,8 +463,9 @@
{
WRITELOG( "RHarvesterClient::Version()" );
- return TVersion( KHarvesterServerMajorVersion, KHarvesterServerMinorVersion,
- KHarvesterServerBuildVersion );
+ TVersion version( KHarvesterServerMajorVersion, KHarvesterServerMinorVersion,
+ KHarvesterServerBuildVersion );
+ return version;
}
// ----------------------------------------------------------------------------------------
@@ -486,10 +487,19 @@
// Server already running
return KErrNone;
}
+#ifdef _DEBUG
else
{
- WRITELOG1( "StartServer() error - error code: %d", result );
+ if( result == KErrNotFound )
+ {
+ WRITELOG( "StartServer() - server not found running" );
+ }
+ else
+ {
+ WRITELOG1( "StartServer() error - error code: %d", result );
+ }
}
+#endif
result = CreateServerProcess();
if ( result != KErrNone )
--- a/harvester/client/src/harvestereventobserverao.cpp Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/client/src/harvestereventobserverao.cpp Fri Feb 19 23:14:48 2010 +0200
@@ -135,6 +135,8 @@
Cancel();
iHarvesterEventQueue.Close();
}
+
+ iObservers.Compress();
}
void CHarvesterEventObserverAO::RunL()
@@ -144,7 +146,8 @@
THarvesterEventNotification received;
while( iHarvesterEventQueue.Receive( received ) != KErrUnderflow )
{
- for(TInt i = iObservers.Count(); --i >= 0;)
+ const TInt count( iObservers.Count() );
+ for(TInt i = count; --i >= 0;)
{
THarvesterEventObserver& observer = *(iObservers[i]);
if( observer.iObserverInfo.iObserverId == received.iObserverId )
--- a/harvester/common/bwincw/harvestercommonwinscw.def Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/common/bwincw/harvestercommonwinscw.def Fri Feb 19 23:14:48 2010 +0200
@@ -64,4 +64,5 @@
?RegisterEventObserverL@CHarvesterEventManager@@QAEXABVRMessage2@@@Z @ 63 NONAME ; void CHarvesterEventManager::RegisterEventObserverL(class RMessage2 const &)
?UnregisterEventObserver@CHarvesterEventManager@@QAEHABVRMessage2@@@Z @ 64 NONAME ; int CHarvesterEventManager::UnregisterEventObserver(class RMessage2 const &)
?HandleObjectPropertyL@CMdeObjectWrapper@@SAXAAVCMdEObject@@AAVCMdEPropertyDef@@PAXH@Z @ 65 NONAME ; void CMdeObjectWrapper::HandleObjectPropertyL(class CMdEObject &, class CMdEPropertyDef &, void *, int)
+ ?SendHarvestingStatusEventL@CHarvesterPluginFactory@@QAEXH@Z @ 66 NONAME ; void CHarvesterPluginFactory::SendHarvestingStatusEventL(int)
--- a/harvester/common/bwincw/harvesterplugininterfacewinscw.def Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/common/bwincw/harvesterplugininterfacewinscw.def Fri Feb 19 23:14:48 2010 +0200
@@ -10,4 +10,6 @@
?SetQueue@CHarvesterPlugin@@UAEXAAV?$RPointerArray@VCHarvesterData@@@@@Z @ 9 NONAME ; void CHarvesterPlugin::SetQueue(class RPointerArray<class CHarvesterData> &)
?StartHarvest@CHarvesterPlugin@@UAEXXZ @ 10 NONAME ; void CHarvesterPlugin::StartHarvest(void)
?SetBlacklist@CHarvesterPlugin@@UAEXAAVCHarvesterBlacklist@@@Z @ 11 NONAME ; void CHarvesterPlugin::SetBlacklist(class CHarvesterBlacklist &)
+ ?GetMimeType@CHarvesterPlugin@@UAEXABVTDesC16@@AAVTDes16@@@Z @ 12 NONAME ; void CHarvesterPlugin::GetMimeType(class TDesC16 const &, class TDes16 &)
+ ?SetHarvesterPluginFactory@CHarvesterPlugin@@QAEXAAVCHarvesterPluginFactory@@@Z @ 13 NONAME ; void CHarvesterPlugin::SetHarvesterPluginFactory(class CHarvesterPluginFactory &)
--- a/harvester/common/eabi/harvestercommonarm.def Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/common/eabi/harvestercommonarm.def Fri Feb 19 23:14:48 2010 +0200
@@ -81,4 +81,5 @@
_ZN22CHarvesterEventManager22RegisterEventObserverLERK9RMessage2 @ 80 NONAME
_ZN22CHarvesterEventManager23UnregisterEventObserverERK9RMessage2 @ 81 NONAME
_ZN17CMdeObjectWrapper21HandleObjectPropertyLER10CMdEObjectR15CMdEPropertyDefPvi @ 82 NONAME
+ _ZN23CHarvesterPluginFactory26SendHarvestingStatusEventLEi @ 83 NONAME
--- a/harvester/common/eabi/harvesterplugininterfacearm.def Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/common/eabi/harvesterplugininterfacearm.def Fri Feb 19 23:14:48 2010 +0200
@@ -14,4 +14,6 @@
_ZTI16CHarvesterPlugin @ 13 NONAME ; #<TI>#
_ZTV16CHarvesterPlugin @ 14 NONAME ; #<VT>#
_ZN16CHarvesterPlugin12SetBlacklistER19CHarvesterBlacklist @ 15 NONAME
+ _ZN16CHarvesterPlugin11GetMimeTypeERK7TDesC16R6TDes16 @ 16 NONAME
+ _ZN16CHarvesterPlugin25SetHarvesterPluginFactoryER23CHarvesterPluginFactory @ 17 NONAME
--- a/harvester/common/inc/harvestdata.inl Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/common/inc/harvestdata.inl Fri Feb 19 23:14:48 2010 +0200
@@ -101,6 +101,21 @@
iMdeObjectArray.Remove( aIndex );
iLocationArray.Remove( aIndex );
iQueryArray.Remove( aIndex );
+
+ if( iMdeObjectArray.Count() == 0 )
+ {
+ iMdeObjectArray.Compress();
+ }
+
+ if( iLocationArray.Count() == 0 )
+ {
+ iLocationArray.Compress();
+ }
+
+ if( iQueryArray.Count() == 0 )
+ {
+ iQueryArray.Compress();
+ }
}
// ---------------------------------------------------------------------------
--- a/harvester/common/inc/harvesterpluginfactory.h Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/common/inc/harvesterpluginfactory.h Fri Feb 19 23:14:48 2010 +0200
@@ -25,6 +25,7 @@
class CHarvesterPlugin;
class CHarvesterData;
class CHarvesterBlacklist;
+class CHarvesterEventManager;
NONSHARABLE_CLASS( CHarvesterPluginFactory ) : public CBase
{
@@ -40,6 +41,8 @@
IMPORT_C void SetBlacklist( CHarvesterBlacklist& aBlacklist );
IMPORT_C TBool IsSupportedFileExtension( const TDesC& aFileName );
IMPORT_C TBool IsContainerFileL( const TDesC& aURI );
+
+ IMPORT_C void SendHarvestingStatusEventL( TBool aStarted );
private:
CHarvesterPluginFactory();
@@ -47,10 +50,14 @@
void SetupHarvesterPluginInfoL();
void AddNewPluginL( const TDesC8& aType, const TDesC8& aOpaque, TUid aPluginUid );
void GetSupportedPluginsL( RPointerArray<CHarvesterPluginInfo>& aSupportedPlugins, const TDesC& aExt );
+ void SetPluginInfo( CHarvesterData* aHD );
private:
RPointerArray<CHarvesterPluginInfo> iHarvesterPluginInfoArray;
CHarvesterBlacklist* iBlacklist;
+
+ TBool iHarvesting;
+ CHarvesterEventManager* iHarvesterEventManager;
};
#endif
--- a/harvester/common/src/harvestereventmanager.cpp Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/common/src/harvestereventmanager.cpp Fri Feb 19 23:14:48 2010 +0200
@@ -407,8 +407,10 @@
break;
}
}
+ iEventQueues.Compress();
}
+ iRegisteredObservers.Compress();
return KErrNone;
}
else
--- a/harvester/common/src/harvesterplugin.cpp Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/common/src/harvesterplugin.cpp Fri Feb 19 23:14:48 2010 +0200
@@ -24,11 +24,9 @@
#include "harvesterlog.h"
#include "harvestercommon.h"
#include "harvesterblacklist.h"
-#include "harvestereventmanager.h"
+#include "harvesterpluginfactory.h"
#include "mdsutils.h"
-const TInt KCacheItemCountForEventCaching = 1;
-
// ---------------------------------------------------------------------------
// NewL
// ---------------------------------------------------------------------------
@@ -52,7 +50,6 @@
{
User::LeaveIfError( iFs.Connect() );
iState = EHarvesterIdle;
- iHarvesterEventManager = CHarvesterEventManager::GetInstanceL();
CActiveScheduler::Add( this );
}
@@ -67,9 +64,9 @@
iBlacklist( NULL ),
iDtor_ID_Key( KNullUid ),
iOriginPropertyDef( NULL ),
- iTitlePropertyDef( NULL )
+ iTitlePropertyDef( NULL ),
+ iHarvesting( NULL )
{
-
}
// ---------------------------------------------------------------------------
@@ -90,11 +87,6 @@
EXPORT_C CHarvesterPlugin::~CHarvesterPlugin() // destruct - virtual
{
Cancel();
-
- if (iHarvesterEventManager)
- {
- iHarvesterEventManager->ReleaseInstance();
- }
iFs.Close();
REComSession::DestroyedImplementation( iDtor_ID_Key );
@@ -148,20 +140,19 @@
if( iQueue->Count() == 0 )
{
SetNextRequest( EHarvesterIdle );
- iHarvesting = EFalse;
- iHarvesterEventManager->SendEventL( EHEObserverTypeOverall, EHEStateFinished );
- iHarvesterEventManager->DecreaseItemCountL( EHEObserverTypeOverall, KCacheItemCountForEventCaching );
+ if( iHarvesting )
+ {
+ TRAP_IGNORE( iFactory->SendHarvestingStatusEventL( EFalse ) );
+ iHarvesting = EFalse;
+ }
iQueue->Compress();
}
else
{
if ( !iHarvesting )
{
+ TRAP_IGNORE( iFactory->SendHarvestingStatusEventL( ETrue ) );
iHarvesting = ETrue;
- iHarvesterEventManager->SendEventL( EHEObserverTypeOverall, EHEStateStarted );
- // This next line is for caching the harvester started event for observers registering
- // after harvesting has already started
- iHarvesterEventManager->IncreaseItemCount( EHEObserverTypeOverall, KCacheItemCountForEventCaching );
}
CHarvesterData* hd = (*iQueue)[0];
@@ -169,6 +160,16 @@
const TDesC& uri = hd->Uri();
TUint32 mediaId = hd->MdeObject().MediaId();
+ if( hd->ObjectType() == EFastHarvest || hd->Origin() == MdeConstants::Object::ECamera )
+ {
+ iFastModeEnabled = ETrue;
+ }
+ else if( iFastModeEnabled )
+ {
+ iFastModeEnabled = EFalse;
+ SetPriority( KHarvesterPriorityHarvestingPlugin + 1 );
+ }
+
if( iBlacklist )
{
WRITELOG( "CHarvesterPlugin::RunL - Adding URI to blacklist" );
@@ -313,6 +314,24 @@
}
// ---------------------------------------------------------------------------
+// GetMimeType
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CHarvesterPlugin::GetMimeType( const TDesC& /*aUri*/, TDes& aMimeType )
+ {
+ aMimeType.Zero();
+ }
+
+// ---------------------------------------------------------------------------
+// SetHarvesterPluginFactory
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CHarvesterPlugin::SetHarvesterPluginFactory( CHarvesterPluginFactory& aFactory )
+ {
+ iFactory = &aFactory;
+ }
+
+// ---------------------------------------------------------------------------
// E32Dll
// ---------------------------------------------------------------------------
//
--- a/harvester/common/src/harvesterpluginfactory.cpp Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/common/src/harvesterpluginfactory.cpp Fri Feb 19 23:14:48 2010 +0200
@@ -22,18 +22,22 @@
#include <harvesterplugin.h>
#include <mdeobject.h>
#include <harvesterdata.h>
-
+#include "harvestereventmanager.h"
#include "harvesterpluginfactory.h"
#include "harvesterplugininfo.h"
#include "mdsutils.h"
#include "harvesterlog.h"
+const TInt KCacheItemCountForEventCaching = 1;
+
// ---------------------------------------------------------------------------
// Constructor
// ---------------------------------------------------------------------------
//
CHarvesterPluginFactory::CHarvesterPluginFactory() :
- iBlacklist( NULL )
+ iBlacklist( NULL ),
+ iHarvesting( NULL ),
+ iHarvesterEventManager( NULL )
{
WRITELOG( "CHarvesterPluginFactory::CHarvesterPluginFactory()" );
}
@@ -60,6 +64,12 @@
CHarvesterPluginFactory::~CHarvesterPluginFactory()
{
WRITELOG( "CHarvesterPluginFactory::~CHarvesterPluginFactory()" );
+
+ if (iHarvesterEventManager)
+ {
+ iHarvesterEventManager->ReleaseInstance();
+ }
+
iHarvesterPluginInfoArray.ResetAndDestroy();
iHarvesterPluginInfoArray.Close();
REComSession::FinalClose();
@@ -72,6 +82,7 @@
void CHarvesterPluginFactory::ConstructL()
{
WRITELOG( "CHarvesterPluginFactory::ConstructL()" );
+ iHarvesterEventManager = CHarvesterEventManager::GetInstanceL();
SetupHarvesterPluginInfoL();
}
@@ -107,6 +118,8 @@
{
info->iPlugin = CHarvesterPlugin::NewL( info->iPluginUid );
info->iPlugin->SetQueue( info->iQueue );
+ info->iPlugin->SetHarvesterPluginFactory( *this );
+ info->iPlugin->SetBlacklist( *iBlacklist );
}
info->iPlugin->GetObjectType( aHD.Uri(), aObjectDef );
if( aObjectDef.Length() > 0 )
@@ -127,10 +140,42 @@
// GetMimeType
// ---------------------------------------------------------------------------
//
-EXPORT_C void CHarvesterPluginFactory::GetMimeType(const TDesC& /*aUri*/, TDes& aMimeType)
+EXPORT_C void CHarvesterPluginFactory::GetMimeType(const TDesC& aUri, TDes& aMimeType)
{
- _LIT( KJPGMimeType, "image/jpeg" );
- aMimeType.Copy( KJPGMimeType );
+ TPtrC extPtr;
+ if( MdsUtils::GetExt( aUri, extPtr ) )
+ {
+ RPointerArray<CHarvesterPluginInfo> supportedPlugins;
+ TRAP_IGNORE( GetSupportedPluginsL( supportedPlugins, extPtr ) );
+
+ const TInt sCount = supportedPlugins.Count();
+ for( TInt i = 0; i < sCount; i++ )
+ {
+ CHarvesterPluginInfo* info = supportedPlugins[i];
+ if ( !(info->iPlugin) )
+ {
+ TRAPD( error, info->iPlugin = CHarvesterPlugin::NewL( info->iPluginUid ) );
+ if( error != KErrNone )
+ {
+ aMimeType.Zero();
+ return;
+ }
+ info->iPlugin->SetQueue( info->iQueue );
+ info->iPlugin->SetHarvesterPluginFactory( *this );
+ info->iPlugin->SetBlacklist( *iBlacklist );
+ }
+ info->iPlugin->GetMimeType( aUri, aMimeType );
+ if( aMimeType.Length() > 0 )
+ {
+ break;
+ }
+ }
+ supportedPlugins.Close();
+ }
+ else
+ {
+ aMimeType.Zero();
+ }
}
// ---------------------------------------------------------------------------
@@ -143,20 +188,31 @@
WRITELOG1("CHarvesterPluginFactory::HarvestL - aHD->Uri: %S", &aHD->Uri() );
#endif
CHarvesterPluginInfo* hpi = aHD->HarvesterPluginInfo();
-
+
+ if( !hpi )
+ {
+ SetPluginInfo( aHD );
+ hpi = aHD->HarvesterPluginInfo();
+ }
+
if ( hpi )
{
if ( ! hpi->iPlugin )
{
hpi->iPlugin = CHarvesterPlugin::NewL( hpi->iPluginUid );
hpi->iPlugin->SetQueue( hpi->iQueue );
+ hpi->iPlugin->SetHarvesterPluginFactory( *this );
hpi->iPlugin->SetBlacklist( *iBlacklist );
}
if( aHD->ObjectType() == EFastHarvest || aHD->Origin() == MdeConstants::Object::ECamera )
{
hpi->iQueue.Insert( aHD, 0 );
- }
+ if( !hpi->iPlugin->IsActive() )
+ {
+ hpi->iPlugin->SetPriority( KHarvesterPriorityHarvestingPlugin + 2 );
+ }
+ }
else
{
hpi->iQueue.AppendL( aHD );
@@ -270,7 +326,8 @@
// Load plugin
pluginInfo->iPlugin = CHarvesterPlugin::NewL( pluginInfo->iPluginUid );
- pluginInfo->iPlugin->SetQueue( pluginInfo->iQueue );
+ pluginInfo->iPlugin->SetQueue( pluginInfo->iQueue );
+ pluginInfo->iPlugin->SetHarvesterPluginFactory( *this );
iHarvesterPluginInfoArray.AppendL( pluginInfo );
CleanupStack::Pop( pluginInfo );
@@ -279,7 +336,7 @@
void CHarvesterPluginFactory::GetSupportedPluginsL(
RPointerArray<CHarvesterPluginInfo>& aSupportedPlugins, const TDesC& aExt )
{
- TInt pluginInfoCount = iHarvesterPluginInfoArray.Count();
+ const TInt pluginInfoCount = iHarvesterPluginInfoArray.Count();
TInt extCount = 0;
for ( TInt i = pluginInfoCount; --i >= 0; )
{
@@ -351,3 +408,53 @@
}
return isContainerFile;
}
+
+void CHarvesterPluginFactory::SetPluginInfo( CHarvesterData* aHD )
+ {
+ TPtrC extPtr;
+ if( MdsUtils::GetExt( aHD->Uri(), extPtr ) )
+ {
+ RPointerArray<CHarvesterPluginInfo> supportedPlugins;
+ TRAP_IGNORE( GetSupportedPluginsL( supportedPlugins, extPtr ) );
+
+ if( supportedPlugins.Count() > 0 )
+ {
+ CHarvesterPluginInfo* info = supportedPlugins[0];
+ aHD->SetHarvesterPluginInfo( info );
+ }
+
+ supportedPlugins.Close();
+ }
+ }
+
+EXPORT_C void CHarvesterPluginFactory::SendHarvestingStatusEventL( TBool aStarted )
+ {
+ const TInt pluginInfoCount = iHarvesterPluginInfoArray.Count();
+ TBool itemsLeft( EFalse );
+ for ( TInt i = pluginInfoCount; --i >= 0; )
+ {
+ CHarvesterPluginInfo* info = iHarvesterPluginInfoArray[i];
+ if( info && info->iQueue.Count() )
+ {
+ itemsLeft = ETrue;
+ break;
+ }
+ }
+
+ if( !iHarvesting && itemsLeft && aStarted )
+ {
+ iHarvesting = ETrue;
+ iHarvesterEventManager->SendEventL( EHEObserverTypeOverall, EHEStateStarted );
+ // This next line is for caching the harvester started event for observers registering
+ // after harvesting has already started
+ iHarvesterEventManager->IncreaseItemCount( EHEObserverTypeOverall, KCacheItemCountForEventCaching );
+ return;
+ }
+ else if( iHarvesting && !itemsLeft && !aStarted )
+ {
+ iHarvesting = EFalse;
+ iHarvesterEventManager->SendEventL( EHEObserverTypeOverall, EHEStateFinished );
+ iHarvesterEventManager->DecreaseItemCountL( EHEObserverTypeOverall, KCacheItemCountForEventCaching );
+ }
+ }
+
--- a/harvester/common/src/propertywatcher.cpp Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/common/src/propertywatcher.cpp Fri Feb 19 23:14:48 2010 +0200
@@ -203,7 +203,8 @@
TInt listenerIndex ( KErrNotFound );
- for ( TInt i = iListenersArray.Count(); --i >= 0; )
+ const TInt count( iListenersArray.Count() );
+ for ( TInt i = count; --i >= 0; )
{
CListener& listenerItem = *iListenersArray[i];
--- a/harvester/composerplugins/imagecomposer/src/imagecomposerao.cpp Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/composerplugins/imagecomposer/src/imagecomposerao.cpp Fri Feb 19 23:14:48 2010 +0200
@@ -88,7 +88,7 @@
// ---------------------------------------------------------------------------
//
CImageComposerAO::CImageComposerAO() : // first-phase C++ constructor
- CActive( KHarvesterPriorityComposerPlugin )
+ CActive( KHarvesterPriorityComposerPlugin + 1 ) // To match image harvester plugin
{
WRITELOG( "CImageComposerAO::CImageComposerAO()" );
}
@@ -240,6 +240,7 @@
{
if( iItemQueue.Count() <= 0 )
{
+ iItemQueue.Compress();
SetNextRequest( ERequestReady );
}
else
@@ -294,6 +295,7 @@
case ERequestReady:
{
+ iForceObjectIds.Compress();
}
break;
@@ -359,10 +361,6 @@
aMdEObjectId = objectId;
iItemQueue.Remove( 0 );
}
- else
- {
- iItemQueue.Compress();
- }
// get object from db (NULL if not found)
CMdEObject* mdeObject = iSession->GetObjectL( objectId, *iImageObjectDef );
--- a/harvester/data/default_origin_mappings.db Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/data/default_origin_mappings.db Fri Feb 19 23:14:48 2010 +0200
@@ -28,9 +28,10 @@
10281FA5 4
10281FA6 4
101FFA91 254
-10208A29 254
20026F35 254
20026F2F 254
200009F5 255
2000A7AE 255
200071BE 255
+101f7771 255
+1020e519 255
--- a/harvester/harvesterplugins/AudioPlugin/inc/harvesteraudioplugin.h Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/harvesterplugins/AudioPlugin/inc/harvesteraudioplugin.h Fri Feb 19 23:14:48 2010 +0200
@@ -109,7 +109,11 @@
void ThumbnailReady( TInt aError, MThumbnailData& aThumbnail,
TThumbnailRequestId aId );
-
+
+ protected: // from CHarvesterPlugin
+
+ void GetMimeType( const TDesC& aUri, TDes& aMimeType );
+
private:
/**
--- a/harvester/harvesterplugins/AudioPlugin/src/harvesteraudioplugin.cpp Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/harvesterplugins/AudioPlugin/src/harvesteraudioplugin.cpp Fri Feb 19 23:14:48 2010 +0200
@@ -23,6 +23,7 @@
#include <mdeobject.h>
#include <centralrepository.h>
+#include "harvestercommon.h"
#include "harvesteraudioplugin.h"
#include "harvesteraudiopluginutils.h"
#include "mdsutils.h"
@@ -129,12 +130,13 @@
CleanupStack::PopAndDestroy( rep );
iAudioParser = CAudioMDParser::NewL( iHarvestAlbumArt );
- iAudioParser->ResetL();
if( iHarvestAlbumArt )
{
TRAP_IGNORE( iTNM = CThumbnailManager::NewL( *this ) );
}
+
+ SetPriority( KHarvesterPriorityHarvestingPlugin - 1);
}
// ---------------------------------------------------------------------------
@@ -168,7 +170,7 @@
}
// ---------------------------------------------------------------------------
-// CHarvesterAudioPlugin::HarvestL (from CHarvesterPlugin)
+// CHarvesterAudioPlugin::ThumbnailReady
// ---------------------------------------------------------------------------
//
void CHarvesterAudioPlugin::ThumbnailReady( TInt /*aError*/,
@@ -179,6 +181,25 @@
}
// ---------------------------------------------------------------------------
+// CHarvesterAudioPlugin::GetMimeType (from CHarvesterPlugin)
+// ---------------------------------------------------------------------------
+//
+void CHarvesterAudioPlugin::GetMimeType( const TDesC& aUri, TDes& aMimeType )
+ {
+ aMimeType.Zero();
+
+ const TMimeTypeMapping<TAudioMetadataHandling>* mapping =
+ iAudioParser->ParseMimeType( aUri );
+
+ if ( !mapping )
+ {
+ return;
+ }
+
+ aMimeType = mapping->iMimeType;
+ }
+
+// ---------------------------------------------------------------------------
// CHarvesterAudioPlugin::DoHarvestL
// ---------------------------------------------------------------------------
//
@@ -279,7 +300,7 @@
const TMimeTypeMapping<TAudioMetadataHandling>* mapping =
iAudioParser->ParseMimeType( mdeObject.Uri() );
- if ( mapping )
+ if ( mapping && !mdeObject.Placeholder() )
{
if( !iPropDefs )
{
@@ -343,17 +364,9 @@
if ( song.Length() > 0
&& song.Length() < iPropDefs->iTitlePropertyDef->MaxTextLengthL() )
- {
- TRAPD( error, CMdeObjectWrapper::HandleObjectPropertyL( mdeObject,
- *iPropDefs->iTitlePropertyDef, &song, aIsAdd ) );
- if( error != KErrNone )
- {
- CMdEProperty* prop = NULL;
- const TInt index = mdeObject.Property( *iPropDefs->iTitlePropertyDef, prop );
- mdeObject.RemoveProperty( index );
- CMdeObjectWrapper::HandleObjectPropertyL( mdeObject,
- *iPropDefs->iTitlePropertyDef, &song, aIsAdd );
- }
+ {
+ CMdeObjectWrapper::HandleObjectPropertyL( mdeObject,
+ *iPropDefs->iTitlePropertyDef, &song, EFalse );
}
if ( artist.Length() > 0
--- a/harvester/harvesterplugins/ImagePlugin/inc/harvesterimageplugin.h Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/harvesterplugins/ImagePlugin/inc/harvesterimageplugin.h Fri Feb 19 23:14:48 2010 +0200
@@ -129,6 +129,10 @@
*/
void HarvestL( CHarvesterData* aHD );
+ protected:
+
+ void GetMimeType( const TDesC& aUri, TDes& aMimeType );
+
private:
/**
* The method that actually extracts the metadata.
--- a/harvester/harvesterplugins/ImagePlugin/src/harvesterimageplugin.cpp Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/harvesterplugins/ImagePlugin/src/harvesterimageplugin.cpp Fri Feb 19 23:14:48 2010 +0200
@@ -25,6 +25,7 @@
#include "mdsutils.h"
#include "harvesterexifutil.h"
#include "harvesterimageplugin.h"
+#include "harvestercommon.h"
#include "mdeobjectwrapper.h"
using namespace MdeConstants;
@@ -254,6 +255,8 @@
User::LeaveIfError( iMimeTypeMappings.InsertInOrder( TMimeTypeMapping<TImageMetadataHandling>(
KExtOtb(), KOtbMime(), EOtherHandling ), cmp ) );
+
+ SetPriority( KHarvesterPriorityHarvestingPlugin + 1 );
}
void CHarvesterImagePlugin::HarvestL( CHarvesterData* aHD )
@@ -329,6 +332,34 @@
}
// ---------------------------------------------------------------------------
+// CHarvesterImagePlugin::GetMimeType (from CHarvesterPlugin)
+// ---------------------------------------------------------------------------
+//
+void CHarvesterImagePlugin::GetMimeType( const TDesC& aUri, TDes& aMimeType )
+ {
+ aMimeType.Zero();
+
+ TPtrC ext;
+ if( !MdsUtils::GetExt( aUri, ext ) )
+ {
+ return;
+ }
+
+ TMimeTypeMapping<TImageMetadataHandling> finder(ext);
+ TLinearOrder< TMimeTypeMapping<TImageMetadataHandling> > cmp(
+ TMimeTypeMapping<TImageMetadataHandling>::CompareFunction);
+
+ const TInt pos = iMimeTypeMappings.FindInOrder( finder, cmp );
+
+ if ( pos == KErrNotFound )
+ {
+ return;
+ }
+
+ aMimeType = iMimeTypeMappings[pos].iMimeType;
+ }
+
+// ---------------------------------------------------------------------------
// GatherData
// ---------------------------------------------------------------------------
//
@@ -417,8 +448,6 @@
// Exif couldn't be found. Open the image with ICL decoder instead.
WRITELOG( "CHarvesterImagePlugin::GatherData() - Exif could not be read. Using ICL." );
- iDecoder->Reset();
-
TPtr8 imageDataPtr = aFileData.iImageData->Des();
TRAP( err, iDecoder->OpenL(imageDataPtr, aFileData.iMime8,
CImageDecoder::TOptions( CImageDecoder::EPreferFastDecode | CImageDecoder::EOptionIgnoreExifMetaData ) ) );
@@ -427,6 +456,7 @@
if ( err != KErrNone )
{
WRITELOG1( "CHarvesterImagePlugin::GatherData() - ERROR: Decoder could not open image data! Code %d", err );
+ iDecoder->Reset();
return KErrCompletion; // metadata item still can be created, thus KErrCompletion
}
@@ -448,6 +478,7 @@
if ( readStatus != KErrNone )
{
CleanupStack::PopAndDestroy( additionalData );
+ iDecoder->Reset();
return KErrCompletion;
}
@@ -463,6 +494,7 @@
if ( err || !iDecoder->ValidDecoder() )
{
WRITELOG( "CHarvesterImagePlugin::GatherData() - ERROR: no valid decoder" );
+ iDecoder->Reset();
return KErrCompletion; // metadata item still can be created, thus KErrCompletion
}
}
@@ -475,6 +507,8 @@
aFileData.iImageWidth = imageSize.iWidth;
aFileData.iImageHeight = imageSize.iHeight;
aFileData.iBitsPerPixel = info.iBitsPerPixel;
+
+ iDecoder->Reset();
}
WRITELOG( "CHarvesterImagePlugin::GatherData() - end" );
@@ -504,7 +538,7 @@
TLinearOrder< TMimeTypeMapping<TImageMetadataHandling> > cmp(
TMimeTypeMapping<TImageMetadataHandling>::CompareFunction);
- TInt pos = iMimeTypeMappings.FindInOrder( finder, cmp );
+ const TInt pos = iMimeTypeMappings.FindInOrder( finder, cmp );
TImageMetadataHandling handler( EOtherHandling );
@@ -608,9 +642,9 @@
TTime localModifiedDate = aFileData.iModified + timeOffsetSeconds;
- // Object - Creation date
if( ! mdeObject.Placeholder() )
{
+ // Object - Creation date
if ( aFileData.iExifSupported && aHd.iDateOriginal8 )
{
TTime originalTime = iExifUtil->ConvertExifDateTimeToSymbianTimeL(
@@ -621,12 +655,15 @@
{
CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iCreationDatePropertyDef, &localModifiedDate, aIsAdd );
}
- }
-
- // Object - last aFileData.iModified date
- if( ! mdeObject.Placeholder() )
- {
- CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iLastModifiedDatePropertyDef, &aFileData.iModified, aIsAdd );
+
+ // Object - last aFileData.iModified date
+ CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iLastModifiedDatePropertyDef, &aFileData.iModified, aIsAdd );
+
+ // Object - Size
+ CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iSizePropertyDef, &aFileData.iFileSize, aIsAdd );
+
+ // Item Type
+ CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iItemTypePropertyDef, &aFileData.iMime16, aIsAdd );
}
if( aFileData.iJpeg )
@@ -635,15 +672,6 @@
TInt16 timeOffsetMinutes = timeOffsetSeconds.Int() / 60;
CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iTimeOffsetPropertyDef, &timeOffsetMinutes, aIsAdd );
}
-
- // Object - Size
- if( ! mdeObject.Placeholder() )
- {
- CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iSizePropertyDef, &aFileData.iFileSize, aIsAdd );
- }
-
- // Item Type
- CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iItemTypePropertyDef, &aFileData.iMime16, aIsAdd );
// MediaObject - Width
if ( aFileData.iExifSupported )
--- a/harvester/harvesterplugins/OMADRMPlugin/inc/harvesteromadrmplugin.h Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/harvesterplugins/OMADRMPlugin/inc/harvesteromadrmplugin.h Fri Feb 19 23:14:48 2010 +0200
@@ -117,6 +117,10 @@
/** */
void GetObjectType( const TDesC& aUri, TDes& aObjectType );
+ protected: // from CHarvesterPlugin
+
+ void GetMimeType( const TDesC& aUri, TDes& aMimeType );
+
private:
/**
* C++ constructor - not exported;
--- a/harvester/harvesterplugins/OMADRMPlugin/src/harvesteromadrmplugin.cpp Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/harvesterplugins/OMADRMPlugin/src/harvesteromadrmplugin.cpp Fri Feb 19 23:14:48 2010 +0200
@@ -266,16 +266,25 @@
CMdeObjectWrapper::HandleObjectPropertyL(mdeObject,
*iPropDefs->iSizePropertyDef, &aVHD.iFileSize, aIsAdd );
}
+
+ // Item Type
+ if(aVHD.iMimetype.Length() > 0)
+ {
+ TBool isAdd( EFalse );
+ CMdEProperty* prop = NULL;
+ TInt index = mdeObject.Property( *iPropDefs->iItemTypePropertyDef, prop );
+ if( index < 0 )
+ {
+ isAdd = ETrue;
+ }
+ CMdeObjectWrapper::HandleObjectPropertyL(mdeObject,
+ *iPropDefs->iItemTypePropertyDef, &aVHD.iMimetype, isAdd );
+ }
+
// DRM protection
CMdeObjectWrapper::HandleObjectPropertyL(mdeObject,
*iPropDefs->iDrmPropertyDef, &aVHD.iDrmProtected, aIsAdd );
- // Item Type
- if(aVHD.iMimetype.Length() > 0)
- {
- CMdeObjectWrapper::HandleObjectPropertyL(mdeObject,
- *iPropDefs->iItemTypePropertyDef, &aVHD.iMimetype, aIsAdd );
- }
// Title (is set from URI by default)
if(aVHD.iTitle.Length() > 0)
{
@@ -357,3 +366,22 @@
WRITELOG1( "CHarvesterOMADRMPlugin::GetObjectType - ERROR: mimetype %S. No object type found", &mime );
aObjectType.Zero();
}
+
+// ---------------------------------------------------------------------------
+// CHarvesterOMADRMPlugin::GetMimeType (from CHarvesterPlugin)
+// ---------------------------------------------------------------------------
+//
+void CHarvesterOMADRMPlugin::GetMimeType( const TDesC& aUri, TDes& aMimeType )
+ {
+ aMimeType.Zero();
+
+ ContentAccess::CContent* content = NULL;
+
+ TRAPD( err, content = ContentAccess::CContent::NewL( aUri ) );
+ if (err == KErrNone)
+ {
+ err = content->GetStringAttribute( ContentAccess::EMimeType, aMimeType );
+ delete content;
+ }
+ }
+
--- a/harvester/harvesterplugins/RTPPlugin/inc/harvesterrtpplugin.h Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/harvesterplugins/RTPPlugin/inc/harvesterrtpplugin.h Fri Feb 19 23:14:48 2010 +0200
@@ -181,6 +181,10 @@
*/
void HarvestL( CHarvesterData* aHarvesterData );
+protected: // from CHarvesterPlugin
+
+ void GetMimeType( const TDesC& aUri, TDes& aMimeType );
+
private:
/**
--- a/harvester/harvesterplugins/RTPPlugin/src/harvesterrtpplugin.cpp Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/harvesterplugins/RTPPlugin/src/harvesterrtpplugin.cpp Fri Feb 19 23:14:48 2010 +0200
@@ -153,6 +153,15 @@
}
// ---------------------------------------------------------------------------
+// CHarvesterAudioPlugin::GetMimeType (from CHarvesterPlugin)
+// ---------------------------------------------------------------------------
+//
+void CHarvesterRtpPlugin::GetMimeType( const TDesC& /*aUri*/, TDes& aMimeType )
+ {
+ aMimeType = KRtpClipMimetype;
+ }
+
+// ---------------------------------------------------------------------------
// Gather metadata
// ---------------------------------------------------------------------------
//
@@ -271,6 +280,9 @@
// File size
CMdeObjectWrapper::HandleObjectPropertyL(mdeObject,
*iPropDefs->iSizePropertyDef, &aClipDetails.iFileSize, aIsAdd );
+ // Mime Type
+ CMdeObjectWrapper::HandleObjectPropertyL(mdeObject,
+ *iPropDefs->iItemTypePropertyDef, &aClipDetails.iMimeType, aIsAdd );
}
// Title (is set from URI by default)
@@ -280,10 +292,6 @@
*iPropDefs->iTitlePropertyDef, &aClipDetails.iTitle, EFalse );
}
- // Mime Type
- CMdeObjectWrapper::HandleObjectPropertyL(mdeObject,
- *iPropDefs->iItemTypePropertyDef, &aClipDetails.iMimeType, aIsAdd );
-
// Capture date
CMdeObjectWrapper::HandleObjectPropertyL(mdeObject,
*iPropDefs->iCaptureDatePropertyDef, &localModifiedTime, aIsAdd );
--- a/harvester/harvesterplugins/VideoPlugin/data/200009f9.rss Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/harvesterplugins/VideoPlugin/data/200009f9.rss Fri Feb 19 23:14:48 2010 +0200
@@ -42,7 +42,7 @@
version_no = 1;
display_name = "Harvester video plugin";
default_data = "Video Audio";
- opaque_data = "mp4 mpg4 mpeg4 m4v m4a 3gp 3gpp rm rv rmvb 3g2 avi mkv ra";
+ opaque_data = "mp4 mpg4 mpeg4 m4v m4a 3gp 3gpp rm rv rmvb 3g2 avi mkv ra wmv divx";
rom_only = 0;
}
};
--- a/harvester/harvesterplugins/VideoPlugin/inc/harvestervideoplugin.h Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/harvesterplugins/VideoPlugin/inc/harvestervideoplugin.h Fri Feb 19 23:14:48 2010 +0200
@@ -86,6 +86,7 @@
HBufC* iGenre;
HBufC* iPerformer; // Artist
HBufC* iDescription;
+ HBufC* iTitle;
HBufC* iMimeBuf;
TUint32 iCodec;
@@ -101,6 +102,7 @@
delete iGenre;
delete iPerformer;
delete iDescription;
+ delete iTitle;
delete iMimeBuf;
}
@@ -119,6 +121,7 @@
CMdEPropertyDef* iSizePropertyDef;
CMdEPropertyDef* iTimeOffsetPropertyDef;
CMdEPropertyDef* iItemTypePropertyDef;
+ CMdEPropertyDef* iTitlePropertyDef;
// Media property definitions
CMdEPropertyDef* iReleaseDatePropertyDef;
@@ -175,6 +178,10 @@
*/
void HarvestL( CHarvesterData* aHD );
+ protected: // from CHarvesterPlugin
+
+ void GetMimeType( const TDesC& aUri, TDes& aMimeType );
+
private:
/**
* C++ constructor - not exported;
--- a/harvester/harvesterplugins/VideoPlugin/src/harvestervideoplugin.cpp Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/harvesterplugins/VideoPlugin/src/harvestervideoplugin.cpp Fri Feb 19 23:14:48 2010 +0200
@@ -25,6 +25,7 @@
#include "harvestervideoplugin.h"
#include "harvesterlog.h"
#include "harvesterblacklist.h"
+#include "harvestercommon.h"
#include "mdeobjectwrapper.h"
#include <mdenamespacedef.h>
@@ -47,6 +48,8 @@
_LIT( KMimeTypeAvi, "video/avi");
_LIT( KMimeTypeVideoMatroska, "video/x-matroska");
_LIT( KMimeTypeAudioMatroska, "audio/x-matroska");
+_LIT( KMimeTypeWmv, "video/x-ms-wmv");
+_LIT( KMimeTypeDivx, "video/x-hx-divx");
_LIT( KExtensionMp4, "mp4" );
_LIT( KExtensionMpg4, "mpg4" );
@@ -62,6 +65,8 @@
_LIT( KExtensionAvi, "avi" );
_LIT( KExtensionMkv, "mkv" );
_LIT( KExtensionRa, "ra" );
+_LIT( KExtensionWmv, "wmv" );
+_LIT( KExtensionDivx, "divx" );
_LIT(KVideo, "Video");
_LIT(KAudio, "Audio");
@@ -91,6 +96,7 @@
iSizePropertyDef = &objectDef.GetPropertyDefL( Object::KSizeProperty );
iTimeOffsetPropertyDef = &objectDef.GetPropertyDefL( Object::KTimeOffsetProperty );
iItemTypePropertyDef = &objectDef.GetPropertyDefL( Object::KItemTypeProperty );
+ iTitlePropertyDef = &objectDef.GetPropertyDefL( Object::KTitleProperty );
CMdEObjectDef& mediaDef = nsDef.GetObjectDefL( MediaObject::KMediaObject );
iReleaseDatePropertyDef = &mediaDef.GetPropertyDefL( MediaObject::KReleaseDateProperty );
@@ -239,12 +245,28 @@
KMimeTypeAvi(), KMimeTypeAvi() ) ),
cmp ) );
+ // Divx
+ User::LeaveIfError( iMimeTypeMappings.InsertInOrder( THarvestingHandling(
+ KExtensionDivx(), KMimeTypeDivx(),
+ TVideoMetadataHandling( TVideoMetadataHandling::EHexilMetadataHandling, KVideo(),
+ KMimeTypeDivx(), KMimeTypeDivx() ) ),
+ cmp ) );
+
// Matroska
User::LeaveIfError( iMimeTypeMappings.InsertInOrder( THarvestingHandling(
KExtensionMkv(), KNullDesC(),
TVideoMetadataHandling( TVideoMetadataHandling::EHexilMetadataHandling, KNullDesC(),
KMimeTypeVideoMatroska(), KMimeTypeAudioMatroska() ) ),
cmp ) );
+
+ // Wmv
+ User::LeaveIfError( iMimeTypeMappings.InsertInOrder( THarvestingHandling(
+ KExtensionWmv(), KMimeTypeWmv(),
+ TVideoMetadataHandling( TVideoMetadataHandling::EHexilMetadataHandling, KVideo(),
+ KMimeTypeWmv(), KMimeTypeWmv() ) ),
+ cmp ) );
+
+ SetPriority( KHarvesterPriorityHarvestingPlugin + 1 );
}
@@ -342,6 +364,25 @@
}
// ---------------------------------------------------------------------------
+// CHarvesterVideoPlugin::GetMimeType (from CHarvesterPlugin)
+// ---------------------------------------------------------------------------
+//
+void CHarvesterVideoPlugin::GetMimeType( const TDesC& aUri, TDes& aMimeType )
+ {
+ aMimeType.Zero();
+
+ const THarvestingHandling* mapping = FindHandler( aUri );
+
+ // no matching extension found
+ if( !mapping )
+ {
+ return;
+ }
+
+ aMimeType = mapping->iMimeType;
+ }
+
+// ---------------------------------------------------------------------------
// GatherDataL
// ---------------------------------------------------------------------------
//
@@ -461,6 +502,11 @@
helixMetadata->GetMetaDataAt( i, metaid, buf );
switch (metaid)
{
+ case HXMetaDataKeys::EHXTitle:
+ {
+ aVHD.iTitle = buf->Alloc();
+ break;
+ }
case HXMetaDataKeys::EHXVideoBitRate:
{
WRITELOG( "CHarvesterVideoPlugin - found videobitrate" );
@@ -759,6 +805,19 @@
CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iSizePropertyDef, &aVHD.iFileSize, aIsAdd );
}
+ // Item Type
+ if( aVHD.iMimeBuf )
+ {
+ TBool isAdd( EFalse );
+ CMdEProperty* prop = NULL;
+ TInt index = mdeObject.Property( *iPropDefs->iItemTypePropertyDef, prop );
+ if( index < 0 )
+ {
+ isAdd = ETrue;
+ }
+ CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iItemTypePropertyDef, aVHD.iMimeBuf, isAdd );
+ }
+
// Release date
CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iReleaseDatePropertyDef, &localModifiedDate, aIsAdd );
@@ -769,12 +828,6 @@
TInt16 timeOffsetMinutes = timeOffsetSeconds.Int() / 60;
CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iTimeOffsetPropertyDef, &timeOffsetMinutes, aIsAdd );
- // Item Type
- if( aVHD.iMimeBuf )
- {
- CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iItemTypePropertyDef, aVHD.iMimeBuf, aIsAdd );
- }
-
// Duration
if( aVHD.iDuration != 0.0f )
{
@@ -862,6 +915,12 @@
{
CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iAudioFourCCDef, &aVHD.iCodec, aIsAdd );
}
+
+ // Title
+ if( aVHD.iTitle )
+ {
+ CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iTitlePropertyDef, aVHD.iTitle, EFalse );
+ }
}
void CHarvesterVideoPlugin::GetMp4Type( RFile64& aFile, TDes& aType )
--- a/harvester/harvesterplugins/WMVPlugin/data/2000B431.rss Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/harvesterplugins/WMVPlugin/data/2000B431.rss Fri Feb 19 23:14:48 2010 +0200
@@ -44,7 +44,7 @@
version_no = 1;
display_name = "Harvester WMV Plugin";
default_data = "Video";
- opaque_data = "wm wmv asf";
+ opaque_data = "wm asf";
rom_only = 0;
}
};
--- a/harvester/harvesterplugins/WMVPlugin/inc/harvesterwmvplugin.h Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/harvesterplugins/WMVPlugin/inc/harvesterwmvplugin.h Fri Feb 19 23:14:48 2010 +0200
@@ -134,6 +134,10 @@
*/
void HarvestL( CHarvesterData* aHarvesterData );
+protected: // from CHarvesterPlugin
+
+ void GetMimeType( const TDesC& aUri, TDes& aMimeType );
+
private:
/**
--- a/harvester/harvesterplugins/WMVPlugin/src/harvesterwmvplugin.cpp Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/harvesterplugins/WMVPlugin/src/harvesterwmvplugin.cpp Fri Feb 19 23:14:48 2010 +0200
@@ -122,6 +122,24 @@
}
// ---------------------------------------------------------------------------
+// CHarvesterWMVPlugin::GetMimeType (from CHarvesterPlugin)
+// ---------------------------------------------------------------------------
+//
+void CHarvesterWMVPlugin::GetMimeType( const TDesC& aUri, TDes& aMimeType )
+ {
+ aMimeType.Zero();
+
+ ContentAccess::CContent* content = NULL;
+
+ TRAPD( err, content = ContentAccess::CContent::NewL( aUri ) );
+ if (err == KErrNone)
+ {
+ err = content->GetStringAttribute( ContentAccess::EMimeType, aMimeType );
+ delete content;
+ }
+ }
+
+// ---------------------------------------------------------------------------
// Default constructor
// ---------------------------------------------------------------------------
//
@@ -204,9 +222,9 @@
// File size
CMdeObjectWrapper::HandleObjectPropertyL(mdeObject,
*iPropDefs->iSizePropertyDef, &aClipDetails.iFileSize, aIsAdd );
+ // Mime Type
+ CMdeObjectWrapper::HandleObjectPropertyL(mdeObject,
+ *iPropDefs->iItemTypePropertyDef, &aClipDetails.iMimeType, aIsAdd );
}
+ }
- // Mime Type
- CMdeObjectWrapper::HandleObjectPropertyL(mdeObject,
- *iPropDefs->iItemTypePropertyDef, &aClipDetails.iMimeType, aIsAdd );
- }
--- a/harvester/monitorplugins/fileplugin/inc/fileeventhandlerao.h Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/monitorplugins/fileplugin/inc/fileeventhandlerao.h Fri Feb 19 23:14:48 2010 +0200
@@ -76,13 +76,6 @@
void DoCancel();
/**
- * Sets a list of paths not monitor to.
- *
- * @param aList Contains list of paths not monitor to.
- */
- void SetIgnoreListL( RPointerArray<TDesC>& aList );
-
- /**
* Gets a reference to process / origin mapper, which
* can be used to register and match which process ids
* with a mde object's Origin value.
@@ -198,12 +191,6 @@
RFs iFs;
/**
- * @var An ignore list. Contains paths not to monitor.
- */
- RPointerArray<TDesC> iIgnoreList;
-
-
- /**
*
*/
TMdsFSPStatusPckg iStatusPckg;
--- a/harvester/monitorplugins/fileplugin/inc/filemonitorao.h Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/monitorplugins/fileplugin/inc/filemonitorao.h Fri Feb 19 23:14:48 2010 +0200
@@ -132,11 +132,6 @@
* @var Flag to signal if iFs is connected.
*/
TBool iFsConnectOk;
-
- /**
- * @var An ignore list. Contains paths not to monitor.
- */
- RPointerArray<TDesC> iIgnoreList;
/**
*
--- a/harvester/monitorplugins/fileplugin/src/fileeventhandlerao.cpp Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/monitorplugins/fileplugin/src/fileeventhandlerao.cpp Fri Feb 19 23:14:48 2010 +0200
@@ -37,7 +37,7 @@
const TUid KRepositoryUid = { 0x20007182 };
const TUint32 KCacheSizeKey = 0x00000001;
-const TInt KMaxEventsAtTime = 20;
+const TInt KMaxEventsAtTime = 25;
const TInt KMaxEventsGranularity = 20;
// ---------------------------------------------------------------------------
@@ -101,9 +101,6 @@
Cancel();
- iIgnoreList.ResetAndDestroy();
- iIgnoreList.Close();
-
iFs.Close();
delete iMapper;
@@ -128,6 +125,9 @@
{
case ( ERequestIdle ):
{
+ iQueue.Compress();
+ iEventArray->Compress();
+ iUriArray.Compress();
break;
}
@@ -218,33 +218,26 @@
TOrigin origin = MdeConstants::Object::EOther;
if ( iMapper )
{
- TRAPD( originErr, origin = iMapper->OriginL( status.iProcessId ) );
- if( originErr == KErrNone )
- {
- if ( origin == KOriginIgnored )
- {
- WRITELOG1( "CFileEventHandlerAO::HandleNotificationL - ignored origin for %S", &status.iFileName );
- return;
- }
- else if( origin == KOriginFastHarvest )
- {
- WRITELOG( "CFileEventHandlerAO::HandleNotificationL - potential fast harvest file detected" );
- fastHarvest = ETrue;
- }
+ origin = iMapper->OriginL( status.iProcessId );
+ if ( origin == KOriginIgnored )
+ {
+ WRITELOG1( "CFileEventHandlerAO::HandleNotificationL - ignored origin for %S", &status.iFileName );
+ return;
+ }
+ else if( origin == KOriginFastHarvest )
+ {
+ WRITELOG( "CFileEventHandlerAO::HandleNotificationL - potential fast harvest file detected" );
+ fastHarvest = ETrue;
+ }
- _LIT(KCameraTemp,"camcordertmp");
- if ( origin == MdeConstants::Object::ECamera &&
- (aEvent.iFileEventType == EMdsFileCreated ||
- aEvent.iFileName.FindF(KCameraTemp) != KErrNotFound) )
- {
- WRITELOG1( "CFileEventHandlerAO::HandleNotificationL - ignored camera origin for %S", &status.iFileName );
- return;
- }
- }
- else
- {
- origin = MdeConstants::Object::EOther;
- }
+ _LIT(KCameraTemp,"camcordertmp");
+ if ( origin == MdeConstants::Object::ECamera &&
+ (aEvent.iFileEventType == EMdsFileCreated ||
+ aEvent.iFileName.FindF(KCameraTemp) != KErrNotFound) )
+ {
+ WRITELOG1( "CFileEventHandlerAO::HandleNotificationL - ignored camera origin for %S", &status.iFileName );
+ return;
+ }
}
// ignore created file event if extension is not supported by any harverter plugin
@@ -307,8 +300,10 @@
RenameToMDEL( status.iFileName, hd->Uri(), hd->Origin() );
CleanupStack::PopAndDestroy( hd );
}
-
- DeleteFromMDEL( status.iFileName );
+ else
+ {
+ DeleteFromMDEL( status.iFileName );
+ }
}
break;
@@ -349,14 +344,12 @@
TOrigin origin = MdeConstants::Object::EOther;
if ( iMapper )
{
- TRAPD( originErr, origin = iMapper->OriginL( status.iProcessId ) );
- if( originErr == KErrNone )
+ origin = iMapper->OriginL( status.iProcessId );
+ // Used only for delete events so fast harvest origin is not used
+ if ( origin == KOriginIgnored )
{
- if ( origin == KOriginIgnored )
- {
- WRITELOG1( "CFileEventHandlerAO::HandleMultideletionL - ignored origin for %S", &status.iFileName );
- continue;
- }
+ WRITELOG1( "CFileEventHandlerAO::HandleMultideletionL - ignored origin for %S", &status.iFileName );
+ continue;
}
}
@@ -369,7 +362,10 @@
RenameToMDEL( status.iFileName, hd->Uri(), hd->Origin() );
CleanupStack::PopAndDestroy( hd );
}
- iUriArray.Append( &(status.iFileName) );
+ else
+ {
+ iUriArray.Append( &(status.iFileName) );
+ }
}
MultiDeleteFromMDEL( iUriArray );
}
@@ -803,29 +799,6 @@
}
// ---------------------------------------------------------------------------
-// CFileEventHandlerAO::SetIgnoreListL()
-// ---------------------------------------------------------------------------
-//
-void CFileEventHandlerAO::SetIgnoreListL( RPointerArray<TDesC>& aList )
- {
- WRITELOG( "CFileEventHandlerAO::SetIgnoreListL" );
-
- iIgnoreList.ResetAndDestroy();
-
- const TInt count( aList.Count() );
- for ( TInt i = count; --i >= 0; )
- {
- TDesC* listPath = aList[i];
-
- HBufC* name = listPath->AllocLC();
-
- iIgnoreList.AppendL( name );
-
- CleanupStack::Pop( name );
- }
- }
-
-// ---------------------------------------------------------------------------
// CFileEventHandlerAO::Mapper()
// Returns a handle to CProcessOriginMapper.
// ---------------------------------------------------------------------------
--- a/harvester/monitorplugins/fileplugin/src/filemonitorao.cpp Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/monitorplugins/fileplugin/src/filemonitorao.cpp Fri Feb 19 23:14:48 2010 +0200
@@ -69,11 +69,7 @@
Cancel();
StopMonitoring();
-
- iIgnoreList.ResetAndDestroy();
- iIgnoreList.Close();
-
delete iMdeSession;
}
--- a/harvester/monitorplugins/fileplugin/src/processoriginmapper.cpp Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/monitorplugins/fileplugin/src/processoriginmapper.cpp Fri Feb 19 23:14:48 2010 +0200
@@ -151,11 +151,6 @@
{
origin = iProcessOriginMap[index].iOrigin;
}
- else
- {
- WRITELOG( "CProcessOriginMapper::OriginL - search for processId: not found !!" );
- User::Leave( KErrNotFound );
- }
WRITELOG2( "CProcessOriginMapper::OriginL - processId: 0x%.8x, origin: %d", aProcessId.iUid, (TInt)origin );
return origin;
--- a/harvester/monitorplugins/mdsfileserverplugin/inc/mdsfileserverplugin.h Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/monitorplugins/mdsfileserverplugin/inc/mdsfileserverplugin.h Fri Feb 19 23:14:48 2010 +0200
@@ -156,6 +156,7 @@
RFs iFsSession;
RPointerArray<TDesC> iCreatedFiles;
+ RPointerArray<TDesC> iModifiedFiles;
TUint32 iFormatOldMediaId;
TInt iFormatDriveNumber;
--- a/harvester/monitorplugins/mdsfileserverplugin/src/mdsfileserverplugin.cpp Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/monitorplugins/mdsfileserverplugin/src/mdsfileserverplugin.cpp Fri Feb 19 23:14:48 2010 +0200
@@ -50,6 +50,9 @@
iCreatedFiles.ResetAndDestroy();
iCreatedFiles.Close();
+
+ iModifiedFiles.ResetAndDestroy();
+ iModifiedFiles.Close();
iPaths.ResetAndDestroy();
iPaths.Close();
@@ -181,6 +184,7 @@
TInt function = aRequest.Function();
iFileName.Zero();
+ iNewFileName.Zero();
#ifdef _DEBUG_EVENTS
PrintDebugEvents( function );
@@ -198,7 +202,6 @@
}
const TBool formatFunction = function == EFsFormatOpen || function == EFsFormatSubClose;
- iNewFileName.Zero();
WRITELOG1( "----- CMdsFileServerPlugin::DoRequestL() - plugin function: %d -----", function );
@@ -374,11 +377,42 @@
break;
case EFsFileSetModified:
- case EFsSetEntry:
+
WRITELOG( "CMdsFileServerPlugin::DoRequestL() - EFsFileSetModified" );
+ iModifiedFiles.Append( iFileName.AllocL() );
fileEventType = EMdsFileModified;
break;
+ case EFsSetEntry:
+ {
+ WRITELOG( "CMdsFileServerPlugin::DoRequestL() - EFsSetEntry" );
+
+ TBool found = EFalse;
+
+ for ( TInt i = iModifiedFiles.Count(); --i >= 0; )
+ {
+ if ( MdsUtils::Compare( iFileName, *(iModifiedFiles[i]) ) == 0 )
+ {
+ delete iModifiedFiles[i];
+ iModifiedFiles.Remove( i );
+ found = ETrue;
+ }
+ }
+
+ if( iModifiedFiles.Count() == 0 )
+ {
+ iModifiedFiles.GranularCompress();
+ }
+
+ if ( found )
+ {
+ return KErrNone;
+ }
+
+ fileEventType = EMdsFileModified;
+ }
+ break;
+
case EFsFileReplace:
case EFsReplace:
WRITELOG1( "CMdsFileServerPlugin::DoRequestL() - EFsReplace/EFsFileReplace, new file: %S", &iNewFileName );
@@ -543,7 +577,7 @@
/**
-* The destructor for the test virus scanner hook.
+* The destructor.
* @internalComponent
*/
CMdsFileServerPluginConn::~CMdsFileServerPluginConn()
@@ -734,7 +768,8 @@
if ( status.iFileName.Length() > 0 )
{
// check if already exists
- for ( TInt i = iPaths.Count(); --i >= 0; )
+ const TInt count( iPaths.Count() );
+ for ( TInt i = count; --i >= 0; )
{
TDesC* tf = iPaths[i];
if ( MdsUtils::Compare( status.iFileName, *tf ) == 0 )
@@ -779,21 +814,18 @@
if ( status.iFileName.Length() > 0 )
{
- // check if already exist
- if ( iPaths.Count() > 0 )
+ for ( TInt i = iPaths.Count(); --i >= 0; )
{
- for ( TInt i = iPaths.Count(); --i >= 0; )
+ TDesC* tf = iPaths[i];
+ if ( MdsUtils::Compare( status.iFileName, *tf ) == 0 )
{
- TDesC* tf = iPaths[i];
- if ( MdsUtils::Compare( status.iFileName, *tf ) == 0 )
- {
- WRITELOG1( "CMdsFileServerPlugin::RemoveNotificationPath() - remove path: %S", &status.iFileName );
- delete tf;
- tf = NULL;
- iPaths.Remove( i );
- }
+ WRITELOG1( "CMdsFileServerPlugin::RemoveNotificationPath() - remove path: %S", &status.iFileName );
+ delete tf;
+ tf = NULL;
+ iPaths.Remove( i );
}
}
+ iPaths.Compress();
}
else
{
@@ -882,6 +914,7 @@
iIgnorePaths.Remove( i );
}
}
+ iIgnorePaths.Compress();
}
else
{
--- a/harvester/monitorplugins/messageplugin/src/messagemonitorplugin.cpp Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/monitorplugins/messageplugin/src/messagemonitorplugin.cpp Fri Feb 19 23:14:48 2010 +0200
@@ -334,28 +334,27 @@
#ifdef __WINSCW__
else if (!err && KMsvDraftEntryId == aFolderId2 && KMsvGlobalOutBoxIndexEntryId == aFolderId1 )
{
- CClientMtmRegistry* clientMtmReg;
- clientMtmReg = CClientMtmRegistry::NewL(*iMsvSession);
- CleanupStack::PushL(clientMtmReg);
-
-
- CSmsClientMtm* smsMtm = static_cast<CSmsClientMtm*>(clientMtmReg->NewMtmL(KUidMsgTypeSMS));
- CleanupStack::PushL(smsMtm);
- smsMtm->SwitchCurrentEntryL( msgId );
-
- TMsvSelectionOrdering selection;
- selection.SetShowInvisibleEntries(ETrue);
-
- CMsvEntry* parentEntry = CMsvEntry::NewL( smsMtm->Session(),
- smsMtm->Entry().Entry().Parent(), selection );
+ if( entry.iMtm.iUid != KUidMsgTypeMultimedia.iUid )
+ {
+ CClientMtmRegistry* clientMtmReg;
+ clientMtmReg = CClientMtmRegistry::NewL(*iMsvSession);
+ CleanupStack::PushL(clientMtmReg);
+
+ CSmsClientMtm* smsMtm = static_cast<CSmsClientMtm*>(clientMtmReg->NewMtmL(KUidMsgTypeSMS));
+ CleanupStack::PushL(smsMtm);
+ smsMtm->SwitchCurrentEntryL( msgId );
+
+ TMsvSelectionOrdering selection;
+ selection.SetShowInvisibleEntries(ETrue);
+
+ CMsvEntry* parentEntry = CMsvEntry::NewL( smsMtm->Session(),
+ smsMtm->Entry().Entry().Parent(), selection );
- CleanupStack::PushL(parentEntry);
- // Move the message
- TRAP_IGNORE( parentEntry->MoveL( msgId, KMsvSentEntryId ) );
- CleanupStack::PopAndDestroy(3,clientMtmReg); // parentEntry
-
-
-
+ CleanupStack::PushL(parentEntry);
+ // Move the message
+ TRAP_IGNORE( parentEntry->MoveL( msgId, KMsvSentEntryId ) );
+ CleanupStack::PopAndDestroy(3,clientMtmReg); // parentEntry
+ }
}
#endif
Binary file harvester/monitorplugins/mmcplugin/data/20007183.txt has changed
--- a/harvester/monitorplugins/mmcplugin/inc/mmcmonitorao.h Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/monitorplugins/mmcplugin/inc/mmcmonitorao.h Fri Feb 19 23:14:48 2010 +0200
@@ -62,6 +62,7 @@
* Starts monitoring the MMC insertions and removals.
*
* @param aObserver Both events are notified via the aObserver.
+ * @param aMedias Array of present medias
* @return ETrue if success, EFalse if not
*/
TBool StartMonitoring( MMMCMonitorObserver& aObserver, RArray<TMdEMediaInfo>& aMedias );
--- a/harvester/monitorplugins/mmcplugin/inc/mmcmonitorplugin.h Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/monitorplugins/mmcplugin/inc/mmcmonitorplugin.h Fri Feb 19 23:14:48 2010 +0200
@@ -138,6 +138,8 @@
CMmcScannerAO* iMmcScanner;
CMmcScannerAO* iHddScanner;
+
+ RFs iFs;
};
--- a/harvester/monitorplugins/mmcplugin/inc/mmcscannerao.h Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/monitorplugins/mmcplugin/inc/mmcscannerao.h Fri Feb 19 23:14:48 2010 +0200
@@ -23,6 +23,7 @@
#include <harvesterdata.h>
#include "mdeharvestersession.h"
#include "mmcfilelist.h"
+#include "harvestereventmanager.h"
// FORWARD DECLARATION
class MMonitorPluginObserver;
@@ -98,6 +99,8 @@
MMonitorPluginObserver* iObserver;
RPointerArray<CHarvesterData> iHdArray;
+
+ CHarvesterEventManager* iHEM;
};
#endif // CMMCSCANNERAO_H
--- a/harvester/monitorplugins/mmcplugin/src/mmcmonitorplugin.cpp Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/monitorplugins/mmcplugin/src/mmcmonitorplugin.cpp Fri Feb 19 23:14:48 2010 +0200
@@ -22,6 +22,10 @@
#include "harvestercenreputil.h"
#include <driveinfo.h>
+#ifdef __WINSCW__
+#include <pathinfo.h>
+#endif
+
#include <e32cmn.h>
_LIT( KColon, ":" );
@@ -40,6 +44,8 @@
{
WRITELOG( "CMMCMonitorPlugin::ConstructL" );
+ User::LeaveIfError( iFs.Connect() );
+
iMMCMonitor = CMMCMonitorAO::NewL();
iMountTask = CMMCMountTaskAO::NewL();
iUsbMonitor = CMMCUsbAO::NewL();
@@ -69,6 +75,8 @@
delete iMmcScanner;
delete iHddScanner;
+
+ iFs.Close();
}
TBool CMMCMonitorPlugin::StartMonitoring( MMonitorPluginObserver& aObserver,
@@ -120,6 +128,12 @@
}
}
+ if( hdMediaId == 0 )
+ {
+ // Try to fetch internall mass storage media id again if it was not mounted
+ hdMediaId = iMountTask->GetInternalDriveMediaId();
+ }
+
// scan mass storage to catch all chances even if battery dies during operation that should be catched
if( hdMediaId )
{
@@ -207,18 +221,10 @@
}
if( aMediaID != 0 && aEventType == EMounted)
{
- RFs fs;
- const TInt err = fs.Connect();
- if ( err != KErrNone )
- {
- delete mountData;
- return;
- }
-
TUint status;
TInt drive;
- fs.CharToDrive( aDriveChar, drive );
- if( DriveInfo::GetDriveStatus( fs, drive, status ) == KErrNone )
+ iFs.CharToDrive( aDriveChar, drive );
+ if( DriveInfo::GetDriveStatus( iFs, drive, status ) == KErrNone )
{
//The "Out of disk space" mde query uses the MdE_Preferences table
if( !(status & DriveInfo::EDriveInternal) )
@@ -226,8 +232,6 @@
iMdEClient->AddMemoryCard( aMediaID );
}
}
-
- fs.Close();
}
mountData->iDrivePath.Append( aDriveChar );
@@ -240,6 +244,10 @@
{
WRITELOG( "CMMCMonitorPlugin::MountEvent with parameter EMounted" );
mountData->iMountType = TMountData::EMount;
+ if( !iMountTask->IsActive() )
+ {
+ iMountTask->SetPriority( KHarvesterPriorityMonitorPlugin );
+ }
iMountTask->StartMount( *mountData );
}
break;
@@ -254,6 +262,10 @@
{
WRITELOG( "CMMCMonitorPlugin::MountEvent with parameter EDismounted" );
mountData->iMountType = TMountData::EUnmount;
+ if( !iMountTask->IsActive() )
+ {
+ iMountTask->SetPriority( KHarvesterPriorityMonitorPlugin );
+ }
iMountTask->StartUnmount( *mountData );
}
}
@@ -263,6 +275,10 @@
{
WRITELOG( "CMMCMonitorPlugin::MountEvent with parameter EFormatted" );
mountData->iMountType = TMountData::EFormat;
+ if( !iMountTask->IsActive() )
+ {
+ iMountTask->SetPriority( KHarvesterPriorityMonitorPlugin );
+ }
iMountTask->StartUnmount( *mountData );
}
break;
@@ -279,18 +295,20 @@
void CMMCMonitorPlugin::StartMonitoringAllMMCsL( RArray<TMdEMediaInfo>& aMedias )
{
WRITELOG( "CMMCMonitorPlugin::StartMonitoringAllMMCs" );
-
- RFs fs;
- User::LeaveIfError( fs.Connect() );
- CleanupClosePushL( fs );
-
+
TDriveInfo driveInfo;
TDriveList driveList;
TInt numOfElements( 0 );
- DriveInfo::GetUserVisibleDrives( fs,
+ DriveInfo::GetUserVisibleDrives( iFs,
driveList,
numOfElements,
KDriveAttExclude | KDriveAttRemote | KDriveAttRom );
+
+#ifdef __WINSCW__
+ TFileName systemPath = PathInfo::GetPath( PathInfo::EPhoneMemoryRootPath );
+ TInt systemDriveNum( -1 );
+ iFs.CharToDrive( systemPath[0], systemDriveNum );
+#endif
TInt i( 0 );
TChar drive;
@@ -302,8 +320,8 @@
for ( i = 0; i < mediaCount; i++ )
{
TInt driveNum(0);
- fs.CharToDrive( aMedias[i].iDrive, driveNum );
- TUint32 mediaId = FSUtil::MediaID( fs, driveNum );
+ iFs.CharToDrive( aMedias[i].iDrive, driveNum );
+ TUint32 mediaId = FSUtil::MediaID( iFs, driveNum );
if ( mediaId != aMedias[i].iMediaId )
{
iMdEClient->SetMediaL( aMedias[i].iMediaId, aMedias[i].iDrive, EFalse );
@@ -312,10 +330,17 @@
for ( i = 0; i < acount; i++ )
{
+#ifdef __WINSCW__
+ if ( i == systemDriveNum )
+ {
+ continue;
+ }
+#endif
+
if ( driveList[i] > 0 )
{
TUint driveStatus( 0 );
- DriveInfo::GetDriveStatus( fs, i, driveStatus );
+ DriveInfo::GetDriveStatus( iFs, i, driveStatus );
if ( driveStatus & DriveInfo::EDriveUsbMemory )
{
@@ -323,15 +348,17 @@
continue;
}
- fs.Drive( driveInfo, i );
- if ( driveInfo.iDriveAtt & KDriveAttRemovable && driveInfo.iType != EMediaNotPresent )
+ iFs.Drive( driveInfo, i );
+ if ( ((driveInfo.iDriveAtt & KDriveAttRemovable) || (driveInfo.iDriveAtt & KDriveAttLogicallyRemovable) ||
+ (driveInfo.iType == EMediaHardDisk && driveStatus & DriveInfo::EDriveInternal) ) &&
+ (driveInfo.iType != EMediaNotPresent) )
{
count++; // DEBUG INFO
- fs.DriveToChar( i, drive );
+ iFs.DriveToChar( i, drive );
// set media id to MdE
- TUint32 mediaId = FSUtil::MediaID( fs, i );
+ TUint32 mediaId = FSUtil::MediaID( iFs, i );
if ( mediaId != 0 )
{
iMdEClient->SetMediaL( mediaId, drive, ETrue );
@@ -342,7 +369,6 @@
}
}
- CleanupStack::PopAndDestroy( &fs );
-
WRITELOG1( "CMMCMonitorPlugin::StartMonitoringAllMMCs found %d MMCs", count );
}
+
--- a/harvester/monitorplugins/mmcplugin/src/mmcmounttaskao.cpp Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/monitorplugins/mmcplugin/src/mmcmounttaskao.cpp Fri Feb 19 23:14:48 2010 +0200
@@ -16,6 +16,10 @@
#include <driveinfo.h>
+#ifdef __WINSCW__
+#include <pathinfo.h>
+#endif
+
#include <placeholderdata.h>
#include "mmcmounttaskao.h"
#include "mmcmonitorplugin.h"
@@ -56,7 +60,7 @@
}
CMMCMountTaskAO::CMMCMountTaskAO() :
- CActive( KHarvesterCustomImportantPriority )
+ CActive( KHarvesterPriorityMonitorPlugin )
{
WRITELOG( "CMMCMountTaskAO::CMMCMountTaskAO" );
}
@@ -182,6 +186,7 @@
}
else
{
+ SetPriority( KHarvesterCustomImportantPriority );
SetNextRequest( ERequestIdle );
iMountDataQueue.Compress();
}
@@ -281,7 +286,7 @@
}
Deinitialize();
SetNextRequest( ERequestStartTask );
- return;
+ break;
}
if ( iEntryArray.Count() > 0 )
@@ -342,6 +347,7 @@
WRITELOG( "CMMCMountTaskAO::RunL - ERequestCleanup" );
TBool present = (iMountData->iMountType == TMountData::EMount);
iMdeSession->SetMediaL( iMountData->iMediaID, iMountData->iDrivePath[0], present );
+ SetPriority( KHarvesterCustomImportantPriority );
Deinitialize();
SetNextRequest( ERequestStartTask );
}
@@ -522,12 +528,26 @@
{
return 0;
}
+
+#ifdef __WINSCW__
+ TFileName systemPath = PathInfo::GetPath( PathInfo::EPhoneMemoryRootPath );
+ TInt systemDriveNum( -1 );
+ iFs.CharToDrive( systemPath[0], systemDriveNum );
+#endif
TUint32 hdMediaId = 0;
TInt i( 0 );
- for ( i = 0; i < driveList.Length(); i++ )
+ const TInt acount = driveList.Length();
+ for ( i = 0; i < acount; i++ )
{
+#ifdef __WINSCW__
+ if ( i == systemDriveNum )
+ {
+ continue;
+ }
+#endif
+
if ( driveList[i] > 0 )
{
iFs.Drive( driveInfo, i );
--- a/harvester/monitorplugins/mmcplugin/src/mmcscannerao.cpp Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/monitorplugins/mmcplugin/src/mmcscannerao.cpp Fri Feb 19 23:14:48 2010 +0200
@@ -22,7 +22,7 @@
_LIT( KColon, ":" );
-const TInt KDefaultDelay = 4;
+const TInt KDefaultDelay = 3;
const TInt KMillion = 1000000;
const TUid KRepositoryUid = { 0x20007183 };
@@ -78,6 +78,8 @@
TTimeIntervalMicroSeconds32 delay( 5 );
After( delay );
}
+
+ iHEM = CHarvesterEventManager::GetInstanceL();
}
CMmcScannerAO::~CMmcScannerAO()
@@ -95,6 +97,11 @@
iHdArray.ResetAndDestroy();
iHdArray.Close();
+
+ if (iHEM)
+ {
+ iHEM->ReleaseInstance();
+ }
iFs.Close();
}
@@ -136,6 +143,15 @@
WRITELOG("CMmcScannerAO::RunL - build file list");
iMmcFileList->BuildFileListL( iFs, iDrive, iEntryArray );
+
+ // send start event
+ const TInt entryCount = iEntryArray.Count();
+ if( entryCount > 0 )
+ {
+ iHEM->IncreaseItemCount( EHEObserverTypeMMC, entryCount );
+ iHEM->SendEventL( EHEObserverTypeMMC, EHEStateStarted, iHEM->ItemCount( EHEObserverTypeMMC ) );
+ }
+
SetState( EProcessFiles );
break;
}
--- a/harvester/server/group/harvesterserver.mmp Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/server/group/harvesterserver.mmp Fri Feb 19 23:14:48 2010 +0200
@@ -71,6 +71,7 @@
LIBRARY harvestercommon.lib
LIBRARY locationmanager.lib
LIBRARY platformenv.lib
+LIBRARY bafl.lib
UNPAGED
--- a/harvester/server/inc/harvesterao.h Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/server/inc/harvesterao.h Fri Feb 19 23:14:48 2010 +0200
@@ -20,6 +20,7 @@
#include <e32cmn.h>
#include <e32base.h>
+#include <badesca.h>
#include "contextengine.h"
#include "mdeharvestersession.h"
@@ -59,6 +60,8 @@
CMdEPropertyDef* iLastModifiedDatePropertyDef;
CMdEPropertyDef* iSizePropertyDef;
CMdEPropertyDef* iOriginPropertyDef;
+ CMdEPropertyDef* iItemTypePropertyDef;
+ CMdEPropertyDef* iTitlePropertyDef;
// Media property definitions
CMdEPropertyDef* iPreinstalledPropertyDef;
@@ -292,6 +295,10 @@
*/
void MemoryGood();
+ private:
+
+ TBool CheckForCameraItem( CHarvesterData* aHd, TDes& aObjectDef );
+
private:
struct THarvestFileRequest
@@ -536,6 +543,9 @@
CHarvesterAoPropertyDefs* iPropDefs;
TBool iMassMemoryIdChecked;
+
+ // Own.
+ CDesCArray* iCameraExtensionArray;
};
#endif //__CHARVESTERAO_H__
--- a/harvester/server/src/harvesterao.cpp Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/server/src/harvesterao.cpp Fri Feb 19 23:14:48 2010 +0200
@@ -51,8 +51,16 @@
_LIT( KTAGDaemonName, "ThumbAGDaemon" );
_LIT( KTAGDaemonExe, "thumbagdaemon.exe" );
+_LIT(KVideo, "Video");
_LIT(KInUse, "InUse");
+_LIT( KExtensionMp4, "mp4" );
+_LIT( KExtensionMpg4, "mpg4" );
+_LIT( KExtensionMpeg4, "mpeg4" );
+_LIT( KExtension3gp, "3gp" );
+_LIT( KExtension3gpp, "3gpp" );
+_LIT( KExtension3g2, "3g2" );
+
CHarvesterAoPropertyDefs::CHarvesterAoPropertyDefs() : CBase()
{
}
@@ -67,6 +75,8 @@
iLastModifiedDatePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KLastModifiedDateProperty );
iSizePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KSizeProperty );
iOriginPropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KOriginProperty );
+ iItemTypePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KItemTypeProperty );
+ iTitlePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KTitleProperty );
CMdEObjectDef& mediaDef = nsDef.GetObjectDefL( MdeConstants::MediaObject::KMediaObject );
iPreinstalledPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KPreinstalledProperty );
@@ -113,7 +123,7 @@
// CHarvesterAO
// ---------------------------------------------------------------------------
//
-CHarvesterAO::CHarvesterAO() : CActive( KHarvesterCustomImportantPriority)
+CHarvesterAO::CHarvesterAO() : CActive( KHarvesterCustomImportantPriority )
{
WRITELOG( "CHarvesterAO::CHarvesterAO() - begin" );
@@ -186,7 +196,8 @@
iContainerPHArray.ResetAndDestroy();
iContainerPHArray.Close();
-
+
+ delete iHarvesterOomAO;
delete iRestoreWatcher;
delete iOnDemandAO;
delete iMdEHarvesterSession;
@@ -197,6 +208,7 @@
delete iUnmountHandlerAO;
delete iPropDefs;
+ delete iCameraExtensionArray;
RMediaIdUtil::ReleaseInstance();
@@ -250,6 +262,14 @@
iHarvesterPluginFactory = CHarvesterPluginFactory::NewL();
iHarvesterPluginFactory->SetBlacklist( *iBlacklist );
+
+ iCameraExtensionArray = new ( ELeave ) CDesCArraySeg( 6 );
+ iCameraExtensionArray->InsertIsqL( KExtensionMp4 );
+ iCameraExtensionArray->InsertIsqL( KExtensionMpg4 );
+ iCameraExtensionArray->InsertIsqL( KExtensionMpeg4 );
+ iCameraExtensionArray->InsertIsqL( KExtension3gp );
+ iCameraExtensionArray->InsertIsqL( KExtension3gpp );
+ iCameraExtensionArray->InsertIsqL( KExtension3g2 );
WRITELOG( "CHarvesterAO::ConstructL() - end" );
}
@@ -704,8 +724,12 @@
continue;
}
TBuf<KObjectDefStrSize> objDefStr;
- iHarvesterPluginFactory->GetObjectDefL( *hd, objDefStr );
-
+
+ if( !CheckForCameraItem( hd, objDefStr ) )
+ {
+ iHarvesterPluginFactory->GetObjectDefL( *hd, objDefStr );
+ }
+
if( objDefStr.Length() == 0 ||
( objDefStr == KInUse ) )
{
@@ -788,7 +812,7 @@
if( !iPropDefs )
{
- iPropDefs = CHarvesterAoPropertyDefs::NewL( mdeObjectDef );
+ iPropDefs = CHarvesterAoPropertyDefs::NewL( defNS.GetObjectDefL( MdeConstants::Object::KBaseObject ) );
}
// set file size
@@ -803,7 +827,30 @@
// set origin
mdeObject->AddUint8PropertyL( *iPropDefs->iOriginPropertyDef, hd->Origin() );
-
+
+ TBuf<KMaxDataTypeLength> mimeType;
+ iHarvesterPluginFactory->GetMimeType( hd->Uri(), mimeType );
+ if( mimeType.Length() > 0 )
+ {
+ mdeObject->AddTextPropertyL( *iPropDefs->iItemTypePropertyDef, mimeType );
+ }
+ else
+ {
+ mdeObject->AddTextPropertyL( *iPropDefs->iItemTypePropertyDef, KNullDesC );
+ }
+
+ TPtrC name;
+ TBool nameFound = MdsUtils::GetName( hd->Uri(), name );
+
+ if ( nameFound )
+ {
+ mdeObject->AddTextPropertyL( *iPropDefs->iTitlePropertyDef, name );
+ }
+ else
+ {
+ mdeObject->AddTextPropertyL( *iPropDefs->iTitlePropertyDef, KNullDesC );
+ }
+
CPlaceholderData* ph = NULL;
if( hd->TakeSnapshot() )
{
@@ -1119,7 +1166,6 @@
delete aHD;
aHD = NULL;
- return;
}
else
{
@@ -1160,14 +1206,14 @@
{
WRITELOG( "CHarvesterAO::HandleSessionOpened() - error creating mde harvester session" );
}
-
- TRAPD( ohTrap, iMdeObjectHandler = CMdeObjectHandler::NewL( *iMdESession ) );
- if ( ohTrap != KErrNone )
+
+#ifdef _DEBUG
+ TRAP( errorTrap, iMdeObjectHandler = CMdeObjectHandler::NewL( *iMdESession ) );
+ if ( errorTrap != KErrNone )
{
WRITELOG( "CHarvesterAO::HandleSessionOpened() - ObjectHandler creation failed" );
}
-#ifdef _DEBUG
TRAP( errorTrap, PreallocateNamespaceL( aSession.GetDefaultNamespaceDefL() ) );
if ( errorTrap != KErrNone )
{
@@ -1187,12 +1233,12 @@
WRITELOG( "CHarvesterAO::HandleSessionOpened() - couldn't start composer plugins" );
}
#else
- // The idea here is that all of these three methods needs to be called,
- // even if some leave, thus the three TRAPs
+ // The idea here is that all of these methods needs to be called,
+ // even if some leave, thus the several TRAPs
+ TRAP_IGNORE( iMdeObjectHandler = CMdeObjectHandler::NewL( *iMdESession ) );
TRAP_IGNORE( PreallocateNamespaceL( aSession.GetDefaultNamespaceDefL() ) );
TRAP_IGNORE( LoadMonitorPluginsL() );
- TRAP_IGNORE( StartComposersL() );
-
+ TRAP_IGNORE( StartComposersL() );
#endif
if ( iContextEngineInitialized )
@@ -1220,6 +1266,7 @@
// Initializing pause indicator
iServerPaused = EFalse;
+
#ifdef _DEBUG
WRITELOG( "HarvesterThread::HandleSessionOpened() - Succeeded!" );
@@ -1386,7 +1433,6 @@
// no more items to harvest
else
{
-
// if container files to harvest, handle those
if( iContainerPHArray.Count() > 0 )
{
@@ -1394,12 +1440,12 @@
break;
}
- if(iReadyPHArray.Count() > 0)
+ const TInt arrayCount( iReadyPHArray.Count() );
+ if( arrayCount > 0 )
{
#ifdef _DEBUG
- WRITELOG1("CHarvesterAO::RunL - items in ready pharray: %d", iReadyPHArray.Count() );
+ WRITELOG1("CHarvesterAO::RunL - items in ready pharray: %d", arrayCount );
#endif
- const TInt arrayCount( iReadyPHArray.Count() );
TInt endIndex( KPlaceholderQueueSize );
if( arrayCount < KPlaceholderQueueSize )
{
@@ -2593,3 +2639,22 @@
TRAP_IGNORE( ResumeHarvesterL() );
}
+TBool CHarvesterAO::CheckForCameraItem( CHarvesterData* aHd, TDes& aObjectDef )
+ {
+ if( aHd->Origin() == MdeConstants::Object::ECamera )
+ {
+ TPtrC ext;
+ if( !MdsUtils::GetExt( aHd->Uri(), ext ) )
+ {
+ return EFalse;
+ }
+ TInt pos( 0 );
+ if( iCameraExtensionArray->FindIsq( ext, pos ) == 0 ) // video extension matched
+ {
+ aObjectDef.Copy( KVideo );
+ return ETrue;
+ }
+ }
+ return EFalse;
+ }
+
--- a/harvester/server/src/harvesteroomao.cpp Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/server/src/harvesteroomao.cpp Fri Feb 19 23:14:48 2010 +0200
@@ -49,6 +49,7 @@
//
CHarvesterOomAO::~CHarvesterOomAO()
{
+ Cancel();
iOomMsgQueue.Close();
}
--- a/harvester/server/src/harvesterqueue.cpp Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/server/src/harvesterqueue.cpp Fri Feb 19 23:14:48 2010 +0200
@@ -115,7 +115,8 @@
item = iItemQueue[0];
iItemQueue.Remove( 0 );
}
- else
+
+ if( iItemQueue.Count() == 0 )
{
WRITELOG( "Harvester queue items zero!" );
iItemQueue.Compress();
@@ -134,7 +135,7 @@
void CHarvesterQueue::Append( CHarvesterData* aItem )
{
WRITELOG( "CHarvesterQueue::Append()" );
- TInt err = KErrNone;
+ TInt err( KErrNone );
if ( iBlacklist )
{
@@ -152,24 +153,20 @@
}
}
- if ( err == KErrNone )
- {
- // check if fast harvest file and add to start of queue
- if ( aItem->ObjectType() == EFastHarvest || aItem->Origin() == MdeConstants::Object::ECamera )
- {
- err = iItemQueue.Insert( aItem, 0 );
- }
- else
- {
- err = iItemQueue.Append( aItem );
- }
+ // check if fast harvest file and add to start of queue
+ if ( aItem->ObjectType() == EFastHarvest || aItem->Origin() == MdeConstants::Object::ECamera )
+ {
+ err = iItemQueue.Insert( aItem, 0 );
+ }
+ else
+ {
+ err = iItemQueue.Append( aItem );
+ }
- if( err != KErrNone )
- {
- delete aItem;
- aItem = NULL;
- return;
- }
+ if( err != KErrNone )
+ {
+ delete aItem;
+ aItem = NULL;
}
}
--- a/layers.sysdef.50.xml Tue Feb 02 00:24:33 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE SystemDefinition SYSTEM "sysdef_1_4_0.dtd" [
- <!ENTITY layer_real_source_path "s60/mw/mds" >
-]>
-
-<SystemDefinition name="mds" schema="1.4.0">
- <systemModel>
- <layer name="mw_layer">
- <module name="mds">
- <unit unitID="imm.mds" mrp="" bldFile="&layer_real_source_path;/group" name="mds" />
- </module>
- </layer>
-
- <layer name="api_test_layer">
- <module name="mds_api_tests">
- <unit unitID="imm.mds.content_listing_framework_collection_manager_api" mrp="" bldFile="s60/mw/mds/mds_plat/content_listing_framework_collection_manager_api/tsrc/group" name="content_listing_framework_collection_manager_api" />
- <unit unitID="imm.mds.context_engine_plugin_api" mrp="" bldFile="s60/mw/mds/mds_plat/context_engine_plugin_api/tsrc/group" name="context_engine_plugin_api" />
- <unit unitID="imm.mds.harvester_framework_api.composerplugin" mrp="" bldFile="s60/mw/mds/mds_plat/harvester_framework_api/tsrc/ComposerPluginTest/group" name="harvester_framework_api.composerplugin" />
- <unit unitID="imm.mds.harvester_framework_api.harvesterclient" mrp="" bldFile="s60/mw/mds/mds_plat/harvester_framework_api/tsrc/HarvesterClientTest/group" name="harvester_framework_api.harvesterclient" />
- <unit unitID="imm.mds.harvester_framework_api.harvesterdata" mrp="" bldFile="s60/mw/mds/mds_plat/harvester_framework_api/tsrc/HarvesterDataTest/group" name="harvester_framework_api.harvesterdata" />
- <unit unitID="imm.mds.harvester_framework_api.harvesterplugin" mrp="" bldFile="s60/mw/mds/mds_plat/harvester_framework_api/tsrc/HarvesterPluginTest/group" name="harvester_framework_api.harvesterplugin" />
- <unit unitID="imm.mds.harvester_framework_api.monitorplugin" mrp="" bldFile="s60/mw/mds/mds_plat/harvester_framework_api/tsrc/MonitorPluginTest/group" name="harvester_framework_api.monitorplugin" />
- <unit unitID="imm.mds.location_manager_api" mrp="" bldFile="s60/mw/mds/mds_plat/location_manager_api/tsrc/group" name="location_manager_api" />
- <unit unitID="imm.mds.metadata_engine_api" mrp="" bldFile="s60/mw/mds/mds_plat/metadata_engine_api/tsrc/group" name="metadata_engine_api" />
-
- <unit unitID="imm.mds.content_listing_framework" mrp="" bldFile="s60/mw/mds/mds_pub/content_listing_framework_api/tsrc/group" name="content_listing_framework_api" />
- </module>
- </layer>
-
- <layer name="module_test_layer">
- <module name="mds_module_tests">
- <unit unitID="imm.mds.performance_test" mrp="" bldFile="s60/mw/mds/internal/tsrc/MDSPerfTest/group" name="mds_performance_test" />
- </module>
- </layer>
-
- <layer name="unit_test_layer">
- <module name="mds_unit_tests">
- </module>
- </layer>
-
- </systemModel>
-</SystemDefinition>
--- a/layers.sysdef.xml Tue Feb 02 00:24:33 2010 +0200
+++ b/layers.sysdef.xml Fri Feb 19 23:14:48 2010 +0200
@@ -22,8 +22,6 @@
<unit unitID="imm.mds.harvester_framework_api.monitorplugin" mrp="" bldFile="sf/mw/mds/mds_plat/harvester_framework_api/tsrc/MonitorPluginTest/group" name="harvester_framework_api.monitorplugin" />
<unit unitID="imm.mds.location_manager_api" mrp="" bldFile="sf/mw/mds/mds_plat/location_manager_api/tsrc/group" name="location_manager_api" />
<unit unitID="imm.mds.metadata_engine_api" mrp="" bldFile="sf/mw/mds/mds_plat/metadata_engine_api/tsrc/group" name="metadata_engine_api" />
-
- <unit unitID="imm.mds.content_listing_framework" mrp="" bldFile="sf/mw/mds/mds_pub/content_listing_framework_api/tsrc/group" name="content_listing_framework_api" />
</module>
</layer>
--- a/locationmanager/client/src/rlocationmanager.cpp Tue Feb 02 00:24:33 2010 +0200
+++ b/locationmanager/client/src/rlocationmanager.cpp Fri Feb 19 23:14:48 2010 +0200
@@ -117,9 +117,10 @@
//
TVersion RLocationManager::Version() const
{
- return TVersion( KLocationManagerServerMajor,
- KLocationManagerServerMinor,
- KLocationManagerServerBuild );
+ TVersion version( KLocationManagerServerMajor,
+ KLocationManagerServerMinor,
+ KLocationManagerServerBuild );
+ return version;
}
// --------------------------------------------------------------------------
Binary file locationmanager/conf/locationmanager.confml has changed
Binary file locationmanager/conf/locationmanager_200071BE.crml has changed
Binary file locationmanager/data/200071BE.txt has changed
--- a/locationmanager/locationtrail/inc/clocationrecord.h Tue Feb 02 00:24:33 2010 +0200
+++ b/locationmanager/locationtrail/inc/clocationrecord.h Fri Feb 19 23:14:48 2010 +0200
@@ -340,11 +340,6 @@
*/
TInt iInterval;
- /**
- * Buffer size for tracklog
- */
- TInt iBufferSize;
-
TBool iRequestCurrentLoc;
TBool iTrailStarted;
--- a/locationmanager/locationtrail/inc/locationtraildefs.h Tue Feb 02 00:24:33 2010 +0200
+++ b/locationmanager/locationtrail/inc/locationtraildefs.h Fri Feb 19 23:14:48 2010 +0200
@@ -34,11 +34,15 @@
const TInt KTrackLogBufSize = 10;
-const TInt KLocationTrailShutdownDelay = 180;
+const TInt KLocationTrailShutdownDelay = 60;
+
+const TInt KLocationTrailRemappingCheckDelay = 15;
-const TInt KLocationDelta = 30;
+const TInt KLocationTrailRemapShutdownDelay = 360;
-const TInt KRemappingTime = 600;
+const TInt KLocationDelta = 20;
+
+const TInt KRemappingTime = 480;
const TInt KFirstInterval = 1000000; // 1 second
@@ -116,6 +120,12 @@
*/
const TUint32 KRemappingTimeKey = 0x00000006;
+/**
+ * Key for reading location trail timeout value from
+ * Central repository if items are still to be remapped.
+ */
+const TUint32 KLocationTrailRemapShutdownTimer = 0x00000007;
+
#endif // __LOCATIONTRAILDEFS_H__
// End of file.
--- a/locationmanager/locationtrail/src/clocationrecord.cpp Tue Feb 02 00:24:33 2010 +0200
+++ b/locationmanager/locationtrail/src/clocationrecord.cpp Fri Feb 19 23:14:48 2010 +0200
@@ -85,7 +85,7 @@
TRAP(err, ReadCenRepValueL(KIntervalKey, interval));
LOG1("CLocationManagerServer::ConstructL, cenrep interval value:%d", interval);
- if (interval == 0)
+ if (interval == 0 || err != KErrNone )
{
LOG1("CLocationManagerServer::ConstructL, cenrep interval err:%d", err);
iInterval = KUpdateInterval;
@@ -94,20 +94,6 @@
{
iInterval = interval * KMillion;
}
-
- TInt trailLength( 0 );
- TRAP(err, ReadCenRepValueL(KTrailLengthKey, trailLength));
- LOG1("CLocationManagerServer::ConstructL, cenrep trail length value:%d", trailLength);
-
- if ( err != KErrNone )
- {
- LOG1("CLocationManagerServer::ConstructL, cenrep trail length err:%d", err);
- iBufferSize = KMaxTrailLength / iInterval;
- }
- else
- {
- iBufferSize = trailLength * KMillion / iInterval;
- }
TRAP(err, ReadCenRepValueL(KLocationDeltaKey, iLocationDelta));
LOG1("CLocationManagerServer::ConstructL, location delta value:%d", iLocationDelta);
@@ -160,6 +146,10 @@
iTrailCaptureSetting = aCaptureSetting;
if ( aCaptureSetting == RLocationTrail::ECaptureAll && !iPositionInfo->IsActive() )
{
+ if( iState == RLocationTrail::ETrailStopped )
+ {
+ iTrail.Reset();
+ }
iPositionInfo->StartL( aCaptureSetting, iInterval );
}
else if ( aCaptureSetting == RLocationTrail::ECaptureNetworkInfo )
--- a/locationmanager/locationtrail/src/cpositioninfo.cpp Tue Feb 02 00:24:33 2010 +0200
+++ b/locationmanager/locationtrail/src/cpositioninfo.cpp Fri Feb 19 23:14:48 2010 +0200
@@ -149,7 +149,9 @@
{
Cancel();
- // Start shutdown timer...
+ iFirstInterval = ETrue;
+ iUpdateOptions.SetUpdateInterval( TTimeIntervalMicroSeconds(KFirstInterval) );
+
iPositioner.Close();
iPosServer.Close();
}
@@ -161,17 +163,10 @@
void CPositionInfo::RunL()
{
iTrail->Position( iPositionInfo, iStatus.Int() );
- if ( iFirstInterval && IsActive() )
+ if ( iFirstInterval && iTrailCaptureSetting == RLocationTrail::ECaptureAll )
{
- Cancel();
- iUpdateOptions.SetUpdateInterval( iUpdateInterval );
- if ( iTrailCaptureSetting == RLocationTrail::ECaptureAll )
- {
- User::LeaveIfError( iPositioner.SetUpdateOptions( iUpdateOptions ) );
- iPositioner.NotifyPositionUpdate( iPositionInfo, iStatus );
- }
- SetActive();
-
+ iUpdateOptions.SetUpdateInterval( TTimeIntervalMicroSeconds( iUpdateInterval ) );
+ User::LeaveIfError( iPositioner.SetUpdateOptions( iUpdateOptions ) );
iFirstInterval = EFalse;
}
}
--- a/locationmanager/server/inc/clocationmanagerserver.h Tue Feb 02 00:24:33 2010 +0200
+++ b/locationmanager/server/inc/clocationmanagerserver.h Fri Feb 19 23:14:48 2010 +0200
@@ -387,6 +387,13 @@
static TInt PositioningStopTimeout( TAny* aAny );
/**
+ * Callback function to check if files were added to remapping queue with delay
+ * @param aAny, a pointer to CLocationRecord object
+ * @return Error code
+ */
+ static TInt CheckForRemappingCallback( TAny* aAny );
+
+ /**
* Stops location trail and deletes the positioning stop timer.
*/
void StopRecording();
@@ -456,6 +463,7 @@
RArray<TItemId> iTargetObjectIds;
TItemId iTagId;
TInt iLocManStopDelay;
+ TInt iLocManStopRemapDelay;
RLocationTrail::TTrailCaptureSetting iCaptureSetting;
TBool iRemoveLocation;
--- a/locationmanager/server/src/clocationmanagerserver.cpp Tue Feb 02 00:24:33 2010 +0200
+++ b/locationmanager/server/src/clocationmanagerserver.cpp Fri Feb 19 23:14:48 2010 +0200
@@ -98,6 +98,7 @@
iSessionReady( EFalse ),
iTagId( 0 ),
iLocManStopDelay( 0 ),
+ iLocManStopRemapDelay( 0 ),
iCaptureSetting( RLocationTrail::EOff ),
iRemoveLocation( EFalse )
{
@@ -133,7 +134,6 @@
CRepository* repository = CRepository::NewLC( KRepositoryUid );
TInt err = repository->Get( KLocationTrailShutdownTimer, iLocManStopDelay );
- CleanupStack::PopAndDestroy( repository );
LOG1("CLocationManagerServer::ConstructL, iLocManStopDelay:%d", iLocManStopDelay);
@@ -142,6 +142,17 @@
LOG1("CLocationManagerServer::ConstructL, iLocManStopDelay err:%d", err);
iLocManStopDelay = KLocationTrailShutdownDelay;
}
+
+ err = repository->Get( KLocationTrailRemapShutdownTimer, iLocManStopRemapDelay );
+ CleanupStack::PopAndDestroy( repository );
+
+ LOG1("CLocationManagerServer::ConstructL, iLocManStopRemapDelay:%d", iLocManStopRemapDelay);
+
+ if ( err != KErrNone )
+ {
+ LOG1("CLocationManagerServer::ConstructL, iLocManStopRemapDelay err:%d", err);
+ iLocManStopRemapDelay = KLocationTrailRemapShutdownDelay;
+ }
LOG ("CLocationManagerServer::ConstructL() end");
}
@@ -308,6 +319,7 @@
{
User::Leave( KErrAlreadyExists );
}
+
if ( iTimer )
{
delete iTimer;
@@ -329,27 +341,35 @@
GetLocationTrailState( state );
if( state == RLocationTrail::ETrailStarted || state == RLocationTrail::ETrailStarting )
{
- iLocationRecord->Stop();
+ TRAPD( error, iTimer = CPeriodic::NewL( CActive::EPriorityStandard ) );
+ if ( error != KErrNone )
+ {
+ // If timer can't be created we stop the location trail immediately.
+ iLocationRecord->Stop();
+ StopTrackLogL();
+ return;
+ }
+ iLocationRecord->SetStateToStopping();
+ iTimer->Start( KLocationTrailRemappingCheckDelay * 1000000, 0, TCallBack( CheckForRemappingCallback, this ) );
}
else if ( state != RLocationTrail::ETrailStopped && state != RLocationTrail::ETrailStopping )
{
+ TInt delay( iLocManStopDelay );
if ( iLocationRecord->RemappingNeeded() )
{
- TRAPD( error, iTimer = CPeriodic::NewL( CActive::EPriorityStandard ) );
- if ( error != KErrNone )
- {
- // If timer can't be created we stop the location trail immediately.
- iLocationRecord->Stop();
- StopTrackLogL();
- return;
- }
- iLocationRecord->SetStateToStopping();
- iTimer->Start( iLocManStopDelay * 1000000, 0, TCallBack( PositioningStopTimeout, this ) );
+ delay = iLocManStopRemapDelay;
}
- else
+
+ TRAPD( error, iTimer = CPeriodic::NewL( CActive::EPriorityStandard ) );
+ if ( error != KErrNone )
{
+ // If timer can't be created we stop the location trail immediately.
iLocationRecord->Stop();
+ StopTrackLogL();
+ return;
}
+ iLocationRecord->SetStateToStopping();
+ iTimer->Start( delay * 1000000, 0, TCallBack( PositioningStopTimeout, this ) );
}
// Always stop tracklog.
@@ -380,6 +400,32 @@
}
// --------------------------------------------------------------------------
+// CLocationUtilityServer::PositioningStopTimeout
+// --------------------------------------------------------------------------
+//
+TInt CLocationManagerServer::CheckForRemappingCallback( TAny* aAny )
+ {
+ CLocationManagerServer* self = STATIC_CAST( CLocationManagerServer*, aAny );
+
+ self->iTimer->Cancel();
+
+ TInt delay( self->iLocManStopDelay );
+ if ( self->iLocationRecord->RemappingNeeded() )
+ {
+ delay = self->iLocManStopRemapDelay;
+ self->iTimer->Start( delay * 1000000, 0, TCallBack( PositioningStopTimeout, self ) );
+ }
+ else
+ {
+ delete self->iTimer;
+ self->iTimer = NULL;
+ self->iLocationRecord->Stop();
+ }
+
+ return KErrNone;
+ }
+
+// --------------------------------------------------------------------------
// CLocationManagerServer::GetLocationTrailState
// --------------------------------------------------------------------------
//
--- a/mds_plat/harvester_framework_api/inc/harvesterplugin.h Tue Feb 02 00:24:33 2010 +0200
+++ b/mds_plat/harvester_framework_api/inc/harvesterplugin.h Fri Feb 19 23:14:48 2010 +0200
@@ -25,7 +25,7 @@
class CHarvesterBlacklist;
class CHarvesterData;
class CMdEPropertyDef;
-class CHarvesterEventManager;
+class CHarvesterPluginFactory;
// Uid for this interface
const TUid KCHarvesterPluginInterfaceUid = { 0x200009F8 };
@@ -195,6 +195,18 @@
* Constuctor
*/
IMPORT_C CHarvesterPlugin();
+
+public:
+
+ /**
+ * Method for getting the mime type for given uri
+ */
+ IMPORT_C virtual void GetMimeType( const TDesC& aUri, TDes& aMimeType );
+
+ /**
+ * Method for adding reference to harvester plugin factory
+ */
+ IMPORT_C void SetHarvesterPluginFactory( CHarvesterPluginFactory& aFactory );
private:
@@ -233,7 +245,12 @@
* Pointer to blacklisting functionality
*/
CHarvesterBlacklist* iBlacklist;
-
+
+ // Not own
+ CHarvesterPluginFactory* iFactory;
+
+ TBool iFastModeEnabled;
+
private:
/* Identification on cleanup */
@@ -244,7 +261,6 @@
TBool iHarvesting;
- CHarvesterEventManager* iHarvesterEventManager;
};
#endif // __CHARVESTERPLUGIN_H__
--- a/mds_plat/metadata_engine_api/inc/mdeobject.h Tue Feb 02 00:24:33 2010 +0200
+++ b/mds_plat/metadata_engine_api/inc/mdeobject.h Fri Feb 19 23:14:48 2010 +0200
@@ -699,18 +699,6 @@
*/
TUint32 ModifiedPropertiesCount() const;
- /**
- * Compares two properties.
- *
- * @param aFirst First property.
- * @param aSecond Second property.
- *
- * @return 0, if the properties are equal;
- * a negative value, if the first property is less than the second;
- * a positive value, if the first property is greater than the second.
- */
- static TInt CompareProperties(const CMdEPropertyDef* aPropertyDef, const CMdEProperty& aProperty);
-
private:
/** Object definition.
--- a/mds_plat/metadata_engine_api/inc/mdeobjectdef.h Tue Feb 02 00:24:33 2010 +0200
+++ b/mds_plat/metadata_engine_api/inc/mdeobjectdef.h Fri Feb 19 23:14:48 2010 +0200
@@ -116,31 +116,9 @@
CMdEPropertyDef* GetPropertyDefL(const TDesC& aName, CMdEObjectDef* aChild);
void ConstructL(CMdCSerializationBuffer& aSchemaBuffer);
+
+ static TInt CompareProperties(const CMdEPropertyDef& aFirst, const CMdEPropertyDef& aSecond);
- /**
- * Compares two properties.
- *
- * @param aFirst First property.
- * @param aSecond Second property.
- *
- * @return 0, if the properties are equal;
- * a negative value, if the first property is less than the second;
- * a positive value, if the first property is greater than the second.
- */
- static TInt CompareProperties( const CMdEPropertyDef& aFirst, const CMdEPropertyDef& aSecond );
-
- /**
- * Compares two properties.
- *
- * @param aFirst First property id.
- * @param aSecond Second property.
- *
- * @return 0, if the properties are equal;
- * a negative value, if the first property is less than the second;
- * a positive value, if the first property is greater than the second.
- */
- static TInt CompareProperties( const TDefId* aFirst, const CMdEPropertyDef& aSecond );
-
private:
const TMdCObjectDef& iObjectDef;
CMdENamespaceDef& iNamespaceDef;
--- a/metadataengine/client/src/mdeasynchronousfindao.cpp Tue Feb 02 00:24:33 2010 +0200
+++ b/metadataengine/client/src/mdeasynchronousfindao.cpp Fri Feb 19 23:14:48 2010 +0200
@@ -312,6 +312,7 @@
// get rid of local results list
iResultList.Reset();
+ iResultList.Compress();
}
// Notify result ids
else if ( ( aStatus == EAsyncFindSetReady ||
--- a/metadataengine/client/src/mdeobject.cpp Tue Feb 02 00:24:33 2010 +0200
+++ b/metadataengine/client/src/mdeobject.cpp Fri Feb 19 23:14:48 2010 +0200
@@ -347,18 +347,39 @@
EXPORT_C TInt CMdEObject::Property(const CMdEPropertyDef& aDef, CMdEProperty*& aProperty, TInt aStartAt) const
{
- if (aStartAt <= 0)
+ const TInt count = iPropertyArray.Count();
+
+ if( aStartAt >= 0 )
{
- const TInt i = iPropertyArray.FindInOrder(aDef, CMdEObject::CompareProperties );
- if (i >= 0 && i < iPropertyArray.Count() && !iPropertyArray[i]->Removed())
+ TInt low( aStartAt );
+ TInt high( count );
+
+ while( low < high )
{
- aProperty = iPropertyArray[i];
- return i;
+ TInt mid( (low+high)>>1 );
+
+ TInt compare( aDef.Compare( iPropertyArray[mid]->Def() ) );
+ if( compare == 0 )
+ {
+ if( !iPropertyArray[mid]->Removed() )
+ {
+ aProperty = iPropertyArray[mid];
+ return mid;
+ }
+ }
+ else if( compare > 0 )
+ {
+ low = mid + 1;
+ }
+ else
+ {
+ high = mid;
+ }
}
}
return KErrNotFound;
}
-
+
EXPORT_C CMdEProperty& CMdEObject::AddBoolPropertyL(CMdEPropertyDef& aDef, TBool aValue)
{
if( aDef.PropertyType() != EPropertyBool )
@@ -545,7 +566,7 @@
TLinearOrder<CMdEProperty>(CMdEObject::CompareProperties));
if (err == KErrAlreadyExists)
{
- TInt f = iPropertyArray.FindInOrder(&aProperty,
+ const TInt f = iPropertyArray.FindInOrder(&aProperty,
TLinearOrder<CMdEProperty>(CMdEObject::CompareProperties));
// this must never happen
@@ -704,13 +725,29 @@
// but don't remove yet from other object
for ( TInt i = 0; i < arraySize; ++i )
{
- TRAPD( err, iPropertyArray.AppendL( aObject.iPropertyArray[i] ) );
- if (err != KErrNone)
- {
- // restore this objects to original state
- iPropertyArray.Reset();
- User::Leave( err );
- }
+ TInt err = iPropertyArray.InsertInOrder(aObject.iPropertyArray[i],
+ TLinearOrder<CMdEProperty>(CMdEObject::CompareProperties));
+
+ if (err == KErrAlreadyExists)
+ {
+ const TInt f = iPropertyArray.FindInOrder(aObject.iPropertyArray[i],
+ TLinearOrder<CMdEProperty>(CMdEObject::CompareProperties));
+
+ if( !iPropertyArray[f]->Removed() )
+ {
+ continue;
+ }
+
+ CMdEProperty* oldProperty = iPropertyArray[f];
+ iPropertyArray[f] = aObject.iPropertyArray[i];
+ delete oldProperty;
+ }
+ else if (err < KErrNone)
+ {
+ // restore this objects to original state
+ iPropertyArray.Reset();
+ User::Leave(err);
+ }
}
// remove properties from other object
@@ -1000,7 +1037,27 @@
+ i * sizeof(TMdCProperty) );
CMdEProperty* property = CMdEProperty::NewLC( *newObject, aBuffer );
- newObject->iPropertyArray.AppendL( property );
+ TInt err = newObject->iPropertyArray.InsertInOrder(property,
+ TLinearOrder<CMdEProperty>(CMdEObject::CompareProperties));
+
+ if (err == KErrAlreadyExists)
+ {
+ const TInt f = newObject->iPropertyArray.FindInOrder(property,
+ TLinearOrder<CMdEProperty>(CMdEObject::CompareProperties));
+
+ if( !newObject->iPropertyArray[f]->Removed() )
+ {
+ continue;
+ }
+
+ CMdEProperty* oldProperty = newObject->iPropertyArray[f];
+ newObject->iPropertyArray[f] = property;
+ delete oldProperty;
+ }
+ else if (err < KErrNone)
+ {
+ User::Leave(err);
+ }
CleanupStack::Pop( property );
}
}
@@ -1028,8 +1085,3 @@
return EMdETypeObject;
}
-TInt CMdEObject::CompareProperties(const CMdEPropertyDef* aPropertyDef, const CMdEProperty& aProperty)
- {
- return aPropertyDef->Compare( aProperty.Def() );
- }
-
--- a/metadataengine/client/src/mdeobjectdef.cpp Tue Feb 02 00:24:33 2010 +0200
+++ b/metadataengine/client/src/mdeobjectdef.cpp Fri Feb 19 23:14:48 2010 +0200
@@ -59,8 +59,9 @@
{
aSchemaBuffer.PositionL( propertyOffset + i * sizeof(TMdCPropertyDef) );
const TMdCPropertyDef& propertyDef = TMdCPropertyDef::GetFromBufferL(aSchemaBuffer);
- CMdEPropertyDef* propertyDefImpl = CMdEPropertyDef::NewL( propertyDef, aSchemaBuffer, *this );
- iPropertyDefs.InsertInOrder( propertyDefImpl, TLinearOrder<CMdEPropertyDef>(CMdEObjectDef::CompareProperties) );
+
+ CMdEPropertyDef* defImpl = CMdEPropertyDef::NewL( propertyDef, aSchemaBuffer, *this );
+ iPropertyDefs.InsertInOrder(defImpl, TLinearOrder<CMdEPropertyDef>(CMdEObjectDef::CompareProperties));
}
}
@@ -157,11 +158,48 @@
CMdEPropertyDef* CMdEObjectDef::GetPropertyDefL(TDefId aId, CMdEObjectDef* aChild)
{
- const TInt i = iPropertyDefs.FindInOrder(aId, CMdEObjectDef::CompareProperties );
+ const TInt count = iPropertyDefs.Count();
+
+ TInt low( 0 );
+ TInt high( count );
+ TBool linearSearchRequired( EFalse );
- if (i >= 0 && i < iPropertyDefs.Count() && iPropertyDefs[i] )
+ while( low < high )
{
- return iPropertyDefs[i];
+ TInt mid( (low+high)>>1 );
+
+ if( !iPropertyDefs[mid] )
+ {
+ linearSearchRequired = ETrue;
+ break;
+ }
+
+ TInt compare( aId - iPropertyDefs[mid]->Id() );
+ if( compare == 0 )
+ {
+ return iPropertyDefs[mid];
+ }
+ else if( compare > 0 )
+ {
+ low = mid + 1;
+ }
+ else
+ {
+ high = mid;
+ }
+ }
+
+ if( linearSearchRequired )
+ {
+ for ( TInt i = 0; i < count; ++i )
+ {
+ CMdEPropertyDef* propDef = iPropertyDefs[i];
+
+ if( propDef && propDef->Id() == aId )
+ {
+ return propDef;
+ }
+ }
}
CMdEObjectDef* parent = ParentL();
@@ -189,13 +227,8 @@
return iPropertyDefs[aIndex];
}
-TInt CMdEObjectDef::CompareProperties( const CMdEPropertyDef& aFirst, const CMdEPropertyDef& aSecond )
+TInt CMdEObjectDef::CompareProperties(const CMdEPropertyDef& aFirst, const CMdEPropertyDef& aSecond)
{
return aFirst.Id() - aSecond.Id();
}
-TInt CMdEObjectDef::CompareProperties( const TDefId* aFirst, const CMdEPropertyDef& aSecond )
- {
- return *aFirst - aSecond.Id();
- }
-
--- a/metadataengine/server/src/mdsshutdownobserver.cpp Tue Feb 02 00:24:33 2010 +0200
+++ b/metadataengine/server/src/mdsshutdownobserver.cpp Fri Feb 19 23:14:48 2010 +0200
@@ -32,7 +32,7 @@
// CMDSShutdownObserver::NewL()
// ---------------------------------------------------------------------------
//
-CMDSShutdownObserver* CMDSShutdownObserver::NewL( MMDSShutdownObserver& aObserver/*, const TUid& aKeyCategory */)
+EXPORT_C CMDSShutdownObserver* CMDSShutdownObserver::NewL( MMDSShutdownObserver& aObserver/*, const TUid& aKeyCategory */)
{
CMDSShutdownObserver* self = new( ELeave )CMDSShutdownObserver( aObserver/*, aKeyCategory */);
CleanupStack::PushL( self );
Binary file sis/mds/mds_stub.sis has changed
--- a/sis/mds/package.pkg Tue Feb 02 00:24:33 2010 +0200
+++ b/sis/mds/package.pkg Fri Feb 19 23:14:48 2010 +0200
@@ -17,7 +17,7 @@
&EN
;packet-header (name, uid, major, minor, build, type)
-#{"Metadata System Upgrade"},(0x200009F5), 9, 20, 2, TYPE=SA, RU
+#{"Metadata System Upgrade"},(0x200009F5), 9, 20, 4, TYPE=SA, RU
; Localised vendor name
%{"Nokia"}
--- a/sis/mds/package_separate.pkg Tue Feb 02 00:24:33 2010 +0200
+++ b/sis/mds/package_separate.pkg Fri Feb 19 23:14:48 2010 +0200
@@ -17,7 +17,7 @@
&EN
;packet-header (name, uid, major, minor, build, type)
-#{"Metadata System Upgrade"},(0x200009F5), 9, 20, 2, TYPE=SA, RU
+#{"Metadata System Upgrade"},(0x200009F5), 9, 20, 4, TYPE=SA, RU
; Localised vendor name
%{"Nokia"}
--- a/sis/mds/stub.pkg Tue Feb 02 00:24:33 2010 +0200
+++ b/sis/mds/stub.pkg Fri Feb 19 23:14:48 2010 +0200
@@ -17,7 +17,7 @@
&EN
; Header
-#{"Metadata System"}, (0x200009F5), 9, 20, 2, TYPE=SA
+#{"Metadata System"}, (0x200009F5), 9, 20, 4, TYPE=SA
; Localised Vendor name
%{"Nokia"}
--- a/watchdog/src/wdselfshutdownobserver.cpp Tue Feb 02 00:24:33 2010 +0200
+++ b/watchdog/src/wdselfshutdownobserver.cpp Fri Feb 19 23:14:48 2010 +0200
@@ -31,7 +31,7 @@
// CWDSelfShutdownObserver::NewL()
// ---------------------------------------------------------------------------
//
-CWDSelfShutdownObserver* CWDSelfShutdownObserver::NewL( MWDSelfShutdownObserver& aObserver/*, const TUid& aKeyCategory */)
+EXPORT_C CWDSelfShutdownObserver* CWDSelfShutdownObserver::NewL( MWDSelfShutdownObserver& aObserver/*, const TUid& aKeyCategory */)
{
CWDSelfShutdownObserver* self = new( ELeave )CWDSelfShutdownObserver( aObserver/*, aKeyCategory */);
CleanupStack::PushL( self );