harvester/monitorplugins/fileplugin/src/fileeventhandlerao.cpp
changeset 25 8e4539ab1889
parent 21 50bf9db68373
child 40 910a23996aa0
child 45 a93990e5815e
child 54 a3cc46f37772
--- a/harvester/monitorplugins/fileplugin/src/fileeventhandlerao.cpp	Mon May 03 12:55:01 2010 +0300
+++ b/harvester/monitorplugins/fileplugin/src/fileeventhandlerao.cpp	Fri May 14 16:17:23 2010 +0300
@@ -561,16 +561,34 @@
     // check if not in mde, harvest
     if ( !oldObject && !newObject )
         {
-        HBufC* fn = NULL;        
+        HBufC* fn = NULL; 
+    
+        // ignore created file event if extension is not supported by any harverter plugin
+        if( aNewUrl.Length() > 0 )
+            {
+            if( iHarvesterPluginFactory->IsSupportedFileExtension( aNewUrl ) )
+                {
+                fn = aNewUrl.AllocLC();
+                }
+            else
+                {
+                WRITELOG1( "CFileEventHandlerAO::ReplaceL - file extension not supported: %S", &aNewUrl );
+                return;           
+                }
+            }
+        else
+            {
+            if( iHarvesterPluginFactory->IsSupportedFileExtension( aOldUrl ) )
+                {
+                fn = aOldUrl.AllocLC();
+                }
+            else
+                {
+                WRITELOG1( "CFileEventHandlerAO::ReplaceL - file extension not supported: %S", &aOldUrl );
+                return;           
+                }        
+            }
 
-        if (aNewUrl.Length() > 0)
-        	{
-        	fn = aNewUrl.AllocLC();
-        	}
-        else
-        	{
-        	fn = aOldUrl.AllocLC();
-        	}
         CHarvesterData* hd = CHarvesterData::NewL( fn );
         CleanupStack::Pop( fn );
         hd->SetEventType( EHarvesterAdd );