48 TRAP_IGNORE( DisableL() ); |
48 TRAP_IGNORE( DisableL() ); |
49 iFsSession.Close(); |
49 iFsSession.Close(); |
50 |
50 |
51 iCreatedFiles.ResetAndDestroy(); |
51 iCreatedFiles.ResetAndDestroy(); |
52 iCreatedFiles.Close(); |
52 iCreatedFiles.Close(); |
|
53 |
|
54 iModifiedFiles.ResetAndDestroy(); |
|
55 iModifiedFiles.Close(); |
53 |
56 |
54 iPaths.ResetAndDestroy(); |
57 iPaths.ResetAndDestroy(); |
55 iPaths.Close(); |
58 iPaths.Close(); |
56 |
59 |
57 iIgnorePaths.ResetAndDestroy(); |
60 iIgnorePaths.ResetAndDestroy(); |
372 WRITELOG1( "CMdsFileServerPlugin::DoRequestL() - EFsFileRename, new file: %S", &iNewFileName ); |
375 WRITELOG1( "CMdsFileServerPlugin::DoRequestL() - EFsFileRename, new file: %S", &iNewFileName ); |
373 fileEventType = EMdsFileRenamed; |
376 fileEventType = EMdsFileRenamed; |
374 break; |
377 break; |
375 |
378 |
376 case EFsFileSetModified: |
379 case EFsFileSetModified: |
|
380 |
|
381 WRITELOG( "CMdsFileServerPlugin::DoRequestL() - EFsFileSetModified" ); |
|
382 iModifiedFiles.Append( iFileName.AllocL() ); |
|
383 fileEventType = EMdsFileModified; |
|
384 break; |
|
385 |
377 case EFsSetEntry: |
386 case EFsSetEntry: |
378 WRITELOG( "CMdsFileServerPlugin::DoRequestL() - EFsFileSetModified" ); |
387 { |
|
388 WRITELOG( "CMdsFileServerPlugin::DoRequestL() - EFsSetEntry" ); |
|
389 |
|
390 TBool found = EFalse; |
|
391 |
|
392 for ( TInt i = iModifiedFiles.Count(); --i >= 0; ) |
|
393 { |
|
394 if ( MdsUtils::Compare( iFileName, *(iModifiedFiles[i]) ) == 0 ) |
|
395 { |
|
396 delete iModifiedFiles[i]; |
|
397 iModifiedFiles.Remove( i ); |
|
398 found = ETrue; |
|
399 } |
|
400 } |
|
401 |
|
402 if( iModifiedFiles.Count() == 0 ) |
|
403 { |
|
404 iModifiedFiles.GranularCompress(); |
|
405 } |
|
406 |
|
407 if ( found ) |
|
408 { |
|
409 return KErrNone; |
|
410 } |
|
411 |
379 fileEventType = EMdsFileModified; |
412 fileEventType = EMdsFileModified; |
380 break; |
413 } |
381 |
414 break; |
|
415 |
382 case EFsFileReplace: |
416 case EFsFileReplace: |
383 case EFsReplace: |
417 case EFsReplace: |
384 WRITELOG1( "CMdsFileServerPlugin::DoRequestL() - EFsReplace/EFsFileReplace, new file: %S", &iNewFileName ); |
418 WRITELOG1( "CMdsFileServerPlugin::DoRequestL() - EFsReplace/EFsFileReplace, new file: %S", &iNewFileName ); |
385 fileEventType = EMdsFileReplaced; |
419 fileEventType = EMdsFileReplaced; |
386 break; |
420 break; |
732 TMdsFSPStatus& status = pckg(); |
766 TMdsFSPStatus& status = pckg(); |
733 |
767 |
734 if ( status.iFileName.Length() > 0 ) |
768 if ( status.iFileName.Length() > 0 ) |
735 { |
769 { |
736 // check if already exists |
770 // check if already exists |
737 for ( TInt i = iPaths.Count(); --i >= 0; ) |
771 const TInt count( iPaths.Count() ); |
|
772 for ( TInt i = count; --i >= 0; ) |
738 { |
773 { |
739 TDesC* tf = iPaths[i]; |
774 TDesC* tf = iPaths[i]; |
740 if ( MdsUtils::Compare( status.iFileName, *tf ) == 0 ) |
775 if ( MdsUtils::Compare( status.iFileName, *tf ) == 0 ) |
741 { |
776 { |
742 return KErrNone; |
777 return KErrNone; |
777 |
812 |
778 TMdsFSPStatus& status = pckg(); |
813 TMdsFSPStatus& status = pckg(); |
779 |
814 |
780 if ( status.iFileName.Length() > 0 ) |
815 if ( status.iFileName.Length() > 0 ) |
781 { |
816 { |
782 // check if already exist |
817 for ( TInt i = iPaths.Count(); --i >= 0; ) |
783 if ( iPaths.Count() > 0 ) |
818 { |
784 { |
819 TDesC* tf = iPaths[i]; |
785 for ( TInt i = iPaths.Count(); --i >= 0; ) |
820 if ( MdsUtils::Compare( status.iFileName, *tf ) == 0 ) |
786 { |
821 { |
787 TDesC* tf = iPaths[i]; |
822 WRITELOG1( "CMdsFileServerPlugin::RemoveNotificationPath() - remove path: %S", &status.iFileName ); |
788 if ( MdsUtils::Compare( status.iFileName, *tf ) == 0 ) |
823 delete tf; |
789 { |
824 tf = NULL; |
790 WRITELOG1( "CMdsFileServerPlugin::RemoveNotificationPath() - remove path: %S", &status.iFileName ); |
825 iPaths.Remove( i ); |
791 delete tf; |
|
792 tf = NULL; |
|
793 iPaths.Remove( i ); |
|
794 } |
|
795 } |
826 } |
796 } |
827 } |
|
828 iPaths.Compress(); |
797 } |
829 } |
798 else |
830 else |
799 { |
831 { |
800 err = KErrNotFound; |
832 err = KErrNotFound; |
801 } |
833 } |