ncdengine/engine/transport/src/catalogshttpdownload.cpp
changeset 69 b18a4bf55ddb
parent 64 48c14c385b0e
child 80 9dcba1ee99f7
equal deleted inserted replaced
64:48c14c385b0e 69:b18a4bf55ddb
    18 
    18 
    19 #include "catalogshttpdownload.h"
    19 #include "catalogshttpdownload.h"
    20 
    20 
    21 #include <bautils.h>
    21 #include <bautils.h>
    22 #include <e32err.h>
    22 #include <e32err.h>
    23 #include <DocumentHandler.h>
       
    24 #include <apmstd.h> // TDataType
    23 #include <apmstd.h> // TDataType
    25 #include <escapeutils.h>
    24 #include <escapeutils.h>
    26 #include <downloadmanager.h>
    25 #include <downloadmanager.h>
    27 #include <cmmanager.h>
    26 #include <cmmanager.h>
    28 #include <cmdestination.h>
    27 #include <cmdestination.h>
   876 		         aEvent.type() == DownloadEvent::ConnectionNeeded ||
   875 		         aEvent.type() == DownloadEvent::ConnectionNeeded ||
   877 		         aEvent.type() == DownloadEvent::ConnectionDisconnected )
   876 		         aEvent.type() == DownloadEvent::ConnectionDisconnected )
   878 		        {
   877 		        {
   879 		        errorId = WRT::ConnectionFailed;
   878 		        errorId = WRT::ConnectionFailed;
   880 		        }
   879 		        }
       
   880 		    else
       
   881 		        {
       
   882 		        errorId = iDownload->attribute(LastError).toInt();
       
   883 		        }
   881             SetTransferring( EFalse );
   884             SetTransferring( EFalse );
   882             errorId = iDownload->attribute(LastError).toInt();
       
   883             if ( errorId > 0 )
   885             if ( errorId > 0 )
   884                 {
   886                 {
   885                 // Symbian error codes are always negative numbers 
   887                 // Symbian error codes are always negative numbers 
   886                 errorId =  -1 * errorId;
   888                 errorId =  -1 * errorId;
   887                 }
   889                 }
  2445             CleanupStack::PopAndDestroy( temp );
  2447             CleanupStack::PopAndDestroy( temp );
  2446             CleanupStack::PopAndDestroy( &dest ); 
  2448             CleanupStack::PopAndDestroy( &dest ); 
  2447             CleanupStack::PopAndDestroy( &cmManager ); 
  2449             CleanupStack::PopAndDestroy( &cmManager ); 
  2448             if ( iOwner.GetDownloadManager() )
  2450             if ( iOwner.GetDownloadManager() )
  2449                 {
  2451                 {
  2450                 iOwner.GetDownloadManager()->attribute(AccessPoints).toStringList();
  2452                 //iOwner.GetDownloadManager()->attribute(AccessPoints).toStringList();
  2451                 iOwner.GetDownloadManager()->setAttribute(AccessPoint, destname);
  2453                 //iOwner.GetDownloadManager()->setAttribute(AccessPoint, destname);
  2452                 }
  2454                 }
  2453             }
  2455             }
  2454             
  2456             
  2455         // Update the configuration 
  2457         // Update the configuration 
  2456         if ( iState.iProgressState == ECatalogsHttpNone ) 
  2458         if ( iState.iProgressState == ECatalogsHttpNone ) 
  2556         User::Leave( KErrGeneral );
  2558         User::Leave( KErrGeneral );
  2557         }
  2559         }
  2558     
  2560     
  2559     if ( !iConfig->Filename().Length() ) 
  2561     if ( !iConfig->Filename().Length() ) 
  2560         {    
  2562         {    
  2561         // Update filename extension by using dochandler
  2563         // Update filename extension 
  2562         if ( iConfig->Options() & ECatalogsHttpDisableHeadRequest )
  2564         if ( iConfig->Options() & ECatalogsHttpDisableHeadRequest )
  2563             {
  2565             {
  2564             UpdateExtensionL();    
  2566             UpdateExtensionL();    
  2565             }
  2567             }
  2566         else
  2568         else
  2621     return aDes && aDes->Length(); 
  2623     return aDes && aDes->Length(); 
  2622     }
  2624     }
  2623 
  2625 
  2624 
  2626 
  2625 // ---------------------------------------------------------------------------
  2627 // ---------------------------------------------------------------------------
  2626 // Updates file extension by using dochandler
  2628 // Updates file extension 
  2627 // ---------------------------------------------------------------------------
  2629 // ---------------------------------------------------------------------------
  2628 //  
  2630 //  
  2629 void CCatalogsHttpDownload::UpdateExtensionL()
  2631 void CCatalogsHttpDownload::UpdateExtensionL()
  2630     {
  2632     {
  2631     DLTRACEIN((""));
  2633     DLTRACEIN((""));
  2642     if ( mimeType.Compare(KMimeTypeMatchWidget) == 0 )
  2644     if ( mimeType.Compare(KMimeTypeMatchWidget) == 0 )
  2643             {
  2645             {
  2644             ReplaceExtension( filename, KWidgetExtension );
  2646             ReplaceExtension( filename, KWidgetExtension );
  2645             }
  2647             }
  2646     else
  2648     else
  2647        iOwner.DocumentHandler().CheckFileNameExtension( filename, type );
  2649         {
       
  2650         ReplaceExtension( filename, KNativeExtension );
       
  2651         }
  2648     
  2652     
  2649     iConfig->SetFilenameL( filename );        
  2653     iConfig->SetFilenameL( filename );        
  2650     }
  2654     }
  2651 
  2655 
  2652 
  2656