filemanager/App/src/CFileManagerFileSelectionFilter.cpp
branchRCL_3
changeset 21 65326cf895ed
parent 0 6a9f87576119
equal deleted inserted replaced
20:491b3ed49290 21:65326cf895ed
       
     1 /*
       
     2 * Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0""
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Filters PlatSec dirs from file selection
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include <f32file.h>
       
    22 #include "CFileManagerFileSelectionFilter.h"
       
    23 #include "CFileManagerEngine.h"
       
    24 #include "CFileManagerCommonDefinitions.h"
       
    25 
       
    26 
       
    27 // ============================ MEMBER FUNCTIONS ===============================
       
    28 // -----------------------------------------------------------------------------
       
    29 // CFileManagerFileSelectionFilter::CFileManagerFileSelectionFilter
       
    30 // 
       
    31 // -----------------------------------------------------------------------------
       
    32 //
       
    33 CFileManagerFileSelectionFilter::CFileManagerFileSelectionFilter(
       
    34         CFileManagerEngine& aEngine )
       
    35         : iEngine( aEngine )
       
    36     {
       
    37     }
       
    38 
       
    39 // -----------------------------------------------------------------------------
       
    40 // CFileManagerFileSelectionFilter::Accept
       
    41 // 
       
    42 // -----------------------------------------------------------------------------
       
    43 //
       
    44 TBool CFileManagerFileSelectionFilter::Accept( const TDesC& aDriveAndPath,
       
    45                                                const TEntry& aEntry ) const
       
    46     {
       
    47     if ( aEntry.IsHidden() || aEntry.IsSystem() )
       
    48         {
       
    49         return EFalse;
       
    50         }
       
    51     if ( !aEntry.IsDir() )
       
    52         {
       
    53         return ETrue;
       
    54         }
       
    55     HBufC* fullPath = HBufC::New( KMaxPath );
       
    56     if ( !fullPath )
       
    57         {
       
    58         return EFalse;
       
    59         }
       
    60     TPtr ptr( fullPath->Des() );
       
    61     ptr.Copy( aDriveAndPath );
       
    62     ptr.Append( aEntry.iName );
       
    63     ptr.Append( KFmgrBackslash );
       
    64     TBool isVisible( !iEngine.IsSystemFolder( ptr ) );
       
    65     delete fullPath;
       
    66     return isVisible;
       
    67     }
       
    68 
       
    69 //  End of File