ncdengine/engine/transport/src/catalogshttpdownloadmanagerimpl.cpp
changeset 64 48c14c385b0e
parent 50 c6e8afe0ba85
child 69 b18a4bf55ddb
equal deleted inserted replaced
58:67f2119dc623 64:48c14c385b0e
     1 /*
     1 /*
     2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    30 #include "catalogsnetworkmanager.h"
    30 #include "catalogsnetworkmanager.h"
    31 #include "catalogshttpsessionimpl.h"
    31 #include "catalogshttpsessionimpl.h"
    32 #include "catalogsconnection.h"
    32 #include "catalogsconnection.h"
    33 
    33 
    34 #include "catalogsdebug.h"
    34 #include "catalogsdebug.h"
    35 #include <QString.h>
    35 #include <QString>
    36 #include <QVector.h>
    36 #include <QVector>
    37 #include <QList.h>
    37 #include <QList>
    38 #include <downloadevent.h>
    38 #include <downloadevent.h>
       
    39 #include <xqconversions.h>
    39 // ======== MEMBER FUNCTIONS ========
    40 // ======== MEMBER FUNCTIONS ========
    40 
    41 
    41 // ---------------------------------------------------------------------------
    42 // ---------------------------------------------------------------------------
    42 // Creator
    43 // Creator
    43 // ---------------------------------------------------------------------------
    44 // ---------------------------------------------------------------------------
   172 MCatalogsHttpOperation* CCatalogsHttpDownloadManager::CreateDownloadL( 
   173 MCatalogsHttpOperation* CCatalogsHttpDownloadManager::CreateDownloadL( 
   173     const TDesC8& aUrl, TBool /* aStart */, MCatalogsHttpObserver* aObserver )
   174     const TDesC8& aUrl, TBool /* aStart */, MCatalogsHttpObserver* aObserver )
   174     {
   175     {
   175     DLTRACEIN((""));
   176     DLTRACEIN((""));
   176     // Create a new download
   177     // Create a new download
   177    	QString Url =	QString::fromRawData( reinterpret_cast<const QChar*>(aUrl.Ptr()),aUrl.Length());
   178     QString Url = XQConversions::s60Desc8ToQString(aUrl);  
   178     iDownload = iDmgr->createDownload( Url );
   179     iDownload = iDmgr->createDownload( Url );
   179     
   180     
   180     CCatalogsHttpDownload* dl = CCatalogsHttpDownload::NewLC( 
   181     CCatalogsHttpDownload* dl = CCatalogsHttpDownload::NewLC( 
   181         *this,
   182         *this,
   182         //download,
   183         //download,
   475 
   476 
   476 // ---------------------------------------------------------------------------
   477 // ---------------------------------------------------------------------------
   477 // Handles download manager events
   478 // Handles download manager events
   478 // ---------------------------------------------------------------------------
   479 // ---------------------------------------------------------------------------
   479 //    
   480 //    
   480  void CCatalogsHttpDownloadManager::downloadMgrEventRecieved(WRT::DownloadEvent* dlmEvent)
   481  void CCatalogsHttpDownloadManager::downloadMgrEventRecieved(WRT::DownloadManagerEvent* dlmEvent)
   481   {
   482   {
   482   	
   483   	
   483   	switch(dlmEvent ->type())
   484   	switch(dlmEvent ->type())
   484 		{
   485 		{
   485  
   486  
   737 TInt CCatalogsHttpDownloadManager::StartOperation( 
   738 TInt CCatalogsHttpDownloadManager::StartOperation( 
   738     MCatalogsHttpOperation* aOperation )
   739     MCatalogsHttpOperation* aOperation )
   739     {
   740     {
   740     DLTRACEIN(( "" ));
   741     DLTRACEIN(( "" ));
   741     DASSERT( aOperation );
   742     DASSERT( aOperation );
   742     TInt err = iManager.StartOperation( aOperation );
   743     TInt err = iManager.StartOperation( aOperation, EFalse );
   743     if ( err == KErrNone || err == KCatalogsHttpOperationQueued ) 
   744     if ( err == KErrNone || err == KCatalogsHttpOperationQueued ) 
   744         {
   745         {
   745         TInt err2 = MoveRestoredDlToCurrentDls( *aOperation );
   746         TInt err2 = MoveRestoredDlToCurrentDls( *aOperation );
   746         // Check for unwanted errors
   747         // Check for unwanted errors
   747         if ( err2 != KErrNone && err2 != KErrNotFound ) 
   748         if ( err2 != KErrNone && err2 != KErrNotFound ) 
   990     
   991     
   991 CCatalogsHttpQTDownloadManager::CCatalogsHttpQTDownloadManager(CCatalogsHttpDownloadManager* aDownloadManager,DownloadManager* aDmgr)
   992 CCatalogsHttpQTDownloadManager::CCatalogsHttpQTDownloadManager(CCatalogsHttpDownloadManager* aDownloadManager,DownloadManager* aDmgr)
   992 	{
   993 	{
   993 		iDownloadManager = aDownloadManager;
   994 		iDownloadManager = aDownloadManager;
   994 		iDmgr = aDmgr;
   995 		iDmgr = aDmgr;
   995 		connect(iDmgr, SIGNAL(downloadManagerEvent(WRT::DownloadManagerEvent*)), this,SLOT(downloadMgrEventRecieved(WRT::DownloadEvent*)));
   996 		connect(iDmgr, SIGNAL(downloadManagerEvent(DownloadManagerEvent*)), this,SLOT(downloadMgrEventRecieved(DownloadManagerEvent*)));
   996 	}
   997 	}
   997 	
   998 	
   998 void CCatalogsHttpQTDownloadManager::downloadMgrEventRecieved(WRT::DownloadEvent* aEvent)
   999 void CCatalogsHttpQTDownloadManager::downloadMgrEventRecieved(DownloadManagerEvent* aEvent)
   999 	{
  1000 	{
  1000 		iDownloadManager->downloadMgrEventRecieved(aEvent);
  1001 		iDownloadManager->downloadMgrEventRecieved(aEvent);
  1001 	}
  1002 	}