filebrowser/engine/FBFileUtils.cpp
changeset 27 271e901a9423
parent 17 4f2773374eff
child 23 c9bf25a20c9f
equal deleted inserted replaced
26:41ebde60981f 27:271e901a9423
    25 #include <textresolver.h> 
    25 #include <textresolver.h> 
    26 #include <eikprogi.h>
    26 #include <eikprogi.h>
    27 #include <f32file.h>
    27 #include <f32file.h>
    28 #include <eikfutil.h>
    28 #include <eikfutil.h>
    29 #include <apparc.h>
    29 #include <apparc.h>
       
    30 #include <apaid.h>
       
    31 #include <apaidpartner.h>
    30 #include <eikenv.h>
    32 #include <eikenv.h>
    31 #include <bautils.h>
    33 #include <bautils.h>
    32 #include <gulicon.h>
    34 #include <gulicon.h>
    33 #include <aknconsts.h>
    35 #include <aknconsts.h>
    34 #include <babackup.h> 
    36 #include <babackup.h> 
  1958 //    iEngine->FileListContainer()->SetNaviPaneTextL(iCurrentPath);
  1960 //    iEngine->FileListContainer()->SetNaviPaneTextL(iCurrentPath);
  1959 //
  1961 //
  1960 //    if (dlgResult)
  1962 //    if (dlgResult)
  1961 //        {
  1963 //        {
  1962 //        iEngine->EikonEnv()->BusyMsgL(_L("** Searching **"), TGulAlignment(EHCenterVTop));
  1964 //        iEngine->EikonEnv()->BusyMsgL(_L("** Searching **"), TGulAlignment(EHCenterVTop));
  1963 //
  1965 
  1964 //        iFileEntryList->Reset();
  1966 
  1965 //
  1967         iEngine->FileBrowserUI()->ShowWaitDialog(_L("** Searching  **"));
  1966 //        // if search dir is empty, find from all drives
  1968         iFileEntryList->Reset();
  1967 //        if (iSearchAttributes.iSearchDir == KNullDesC)
  1969 
  1968 //            {
  1970         // if search dir is empty, find from all drives
  1969 //            for (TInt i=0; i<iDriveEntryList->Count(); i++)
  1971         if (iSearchAttributes.iSearchDir == KNullDesC)
  1970 //                {
  1972             {
  1971 //                TDriveEntry driveEntry = iDriveEntryList->At(i);
  1973             for (TInt i=0; i<iDriveEntryList->Count(); i++)
  1972 //
  1974                 {
  1973 //                TBuf<10> driveRoot;
  1975                 TDriveEntry driveEntry = iDriveEntryList->At(i);
  1974 //                driveRoot.Append(driveEntry.iLetter);
  1976 
  1975 //                driveRoot.Append(_L(":\\"));
  1977                 TBuf<10> driveRoot;
  1976 //
  1978                 driveRoot.Append(driveEntry.iLetter);
  1977 //                DoSearchFiles(iSearchAttributes.iWildCards, driveRoot);
  1979                 driveRoot.Append(_L(":\\"));
  1978 //
  1980 
  1979 //                if (iSearchAttributes.iRecurse)
  1981                 DoSearchFiles(iSearchAttributes.iWildCards, driveRoot);
  1980 //                    DoSearchFilesRecursiveL(iSearchAttributes.iWildCards, driveRoot);
  1982 
  1981 //
  1983                 if (iSearchAttributes.iRecurse)
  1982 //                }
  1984                     DoSearchFilesRecursiveL(iSearchAttributes.iWildCards, driveRoot);
  1983 //
  1985                 }
  1984 //            }
  1986 
  1985 //
  1987             }
  1986 //        // otherwise just search from the selected directory
  1988 
  1987 //        else
  1989         // otherwise just search from the selected directory
  1988 //            {
  1990         else
  1989 //            DoSearchFiles(iSearchAttributes.iWildCards, iSearchAttributes.iSearchDir);
  1991             {
  1990 //
  1992             DoSearchFiles(iSearchAttributes.iWildCards, iSearchAttributes.iSearchDir);
  1991 //            if (iSearchAttributes.iRecurse)
  1993 
  1992 //                DoSearchFilesRecursiveL(iSearchAttributes.iWildCards, iSearchAttributes.iSearchDir);
  1994             if (iSearchAttributes.iRecurse)
  1993 //            }
  1995                 DoSearchFilesRecursiveL(iSearchAttributes.iWildCards, iSearchAttributes.iSearchDir);
  1994 //
  1996             }
       
  1997 
  1995 //        iEngine->EikonEnv()->BusyMsgCancel();
  1998 //        iEngine->EikonEnv()->BusyMsgCancel();
  1996 //
  1999         iEngine->FileBrowserUI()->CancelWaitDialog();
       
  2000 
  1997 //        TInt operations = iFileEntryList->Count();
  2001 //        TInt operations = iFileEntryList->Count();
  1998 //
  2002 
  1999 //        iListingMode = ESearchResults;
  2003         iListingMode = ESearchResults;
  2000 //        iEngine->FileListContainer()->ListBox()->SetCurrentItemIndex(0);
  2004         // TODO iEngine->FileListContainer()->ListBox()->SetCurrentItemIndex(0);
  2001 //        RefreshViewL();
  2005         RefreshViewL();
  2002 //
  2006 
  2003 //        _LIT(KMessage, "%d entries found");
  2007 //        _LIT(KMessage, "%d entries found");
  2004 //        TFileName noteMsg;
  2008 //        TFileName noteMsg;
  2005 //        noteMsg.Format(KMessage, operations);
  2009 //        noteMsg.Format(KMessage, operations);
  2006 //
  2010 //
  2007 //        iEngine->FileBrowserUI()->ShowInformationNote(noteMsg, _L(""));
  2011 //        iEngine->FileBrowserUI()->ShowInformationNote(noteMsg, _L(""));
  2014     {
  2018     {
  2015     TFindFile fileFinder(iFs);
  2019     TFindFile fileFinder(iFs);
  2016     CDir* dir;
  2020     CDir* dir;
  2017     TInt err = fileFinder.FindWildByPath(aFileName, &aPath, dir);
  2021     TInt err = fileFinder.FindWildByPath(aFileName, &aPath, dir);
  2018 
  2022 
  2019     while (err == KErrNone)
  2023     while (err == KErrNone && iAllowProcessing)
  2020         {
  2024         {
       
  2025         iEngine->FileBrowserUI()->ProcessEvents();
  2021         for (TInt i=0; i<dir->Count(); i++)
  2026         for (TInt i=0; i<dir->Count(); i++)
  2022             {
  2027             {
  2023             TEntry entry = (*dir)[i];
  2028             TEntry entry = (*dir)[i];
  2024             
  2029             
  2025             TTime entryModified = entry.iModified;
  2030             TTime entryModified = entry.iModified;
  3264     if (file.Replace(iFs, allFilesPath, EFileWrite) == KErrNone)
  3269     if (file.Replace(iFs, allFilesPath, EFileWrite) == KErrNone)
  3265         {
  3270         {
  3266         CleanupClosePushL(file);
  3271         CleanupClosePushL(file);
  3267         iFindFileEntryList->Reset();
  3272         iFindFileEntryList->Reset();
  3268         
  3273         
  3269         iEngine->EikonEnv()->BusyMsgL(_L("** Generating **"), TGulAlignment(EHCenterVTop));
  3274         iEngine->FileBrowserUI()->ShowWaitDialog(_L("** Generating **"));
  3270         
  3275         
  3271         for (TInt i=0; i<iDriveEntryList->Count(); i++)
  3276         for (TInt i=0; i<iDriveEntryList->Count(); i++)
  3272             {
  3277             {
  3273             TDriveEntry driveEntry = iDriveEntryList->At(i);
  3278             TDriveEntry driveEntry = iDriveEntryList->At(i);
  3274 
  3279 
  3289             {
  3294             {
  3290             TFileEntry fileEntry = iFindFileEntryList->At(i);
  3295             TFileEntry fileEntry = iFindFileEntryList->At(i);
  3291             
  3296             
  3292             writeBuf.Copy(fileEntry.iPath);
  3297             writeBuf.Copy(fileEntry.iPath);
  3293             writeBuf.Append(fileEntry.iEntry.iName);
  3298             writeBuf.Append(fileEntry.iEntry.iName);
       
  3299             writeBuf.Append(_L(" - "));
       
  3300             writeBuf.AppendNum(fileEntry.iEntry.iSize);
       
  3301             writeBuf.Append(_L(" B"));
  3294             writeBuf.Append(KFileNewLine);
  3302             writeBuf.Append(KFileNewLine);
  3295             
       
  3296             file.Write(writeBuf);
  3303             file.Write(writeBuf);
  3297             }
  3304             }
  3298         
  3305         
  3299         iEngine->EikonEnv()->BusyMsgCancel();
  3306         iEngine->FileBrowserUI()->CancelWaitDialog();
  3300         
  3307         
  3301         CleanupStack::PopAndDestroy(); //file
  3308         CleanupStack::PopAndDestroy(); //file
  3302         iFindFileEntryList->Reset();
  3309         iFindFileEntryList->Reset();
  3303         
  3310         
  3304         _LIT(KMessage, "File list written to %S");
  3311         _LIT(KMessage, "File list written to %S");
  3323     {
  3330     {
  3324     TFindFile fileFinder(iFs);
  3331     TFindFile fileFinder(iFs);
  3325     CDir* dir;
  3332     CDir* dir;
  3326     TInt err = fileFinder.FindWildByPath(aFileName, &aPath, dir);
  3333     TInt err = fileFinder.FindWildByPath(aFileName, &aPath, dir);
  3327 
  3334 
  3328     while (err == KErrNone)
  3335     while (err == KErrNone && iAllowProcessing)
  3329         {
  3336         {
       
  3337         iEngine->FileBrowserUI()->ProcessEvents();
  3330         for (TInt i=0; i<dir->Count(); i++)
  3338         for (TInt i=0; i<dir->Count(); i++)
  3331             {
  3339             {
  3332             TEntry entry = (*dir)[i];
  3340             TEntry entry = (*dir)[i];
  3333 
  3341 
  3334             // ignore any directory entries
  3342             // ignore any directory entries