ncdengine/provider/deviceinteraction/src/ncdinstallationserviceimpl.cpp
changeset 69 b18a4bf55ddb
parent 44 329d304c1aa1
child 77 d1838696558c
--- a/ncdengine/provider/deviceinteraction/src/ncdinstallationserviceimpl.cpp	Fri Aug 20 11:39:56 2010 +0300
+++ b/ncdengine/provider/deviceinteraction/src/ncdinstallationserviceimpl.cpp	Fri Sep 03 17:01:40 2010 +0300
@@ -18,7 +18,6 @@
 
 #include "ncdinstallationserviceimpl.h"
 
-#include <DocumentHandler.h>
 #include <apmstd.h>
 #include <apmrec.h>
 #include <bautils.h>
@@ -100,7 +99,6 @@
     DLTRACEIN((""));
     delete iSilentInstallActiveObserver;
     iSilentInstallActiveObserver = NULL;
-    delete iDocHandler;
     iRegistrySession.Close();
     iFs.Close();
     iAknsSrv.Close();
@@ -147,9 +145,6 @@
     iResults = 0;
     iArguments = 0;
     
-    iDocHandler = CDocumentHandler::NewL();
-    iDocHandler->SetExitObserver( this );
-    
     User::LeaveIfError( iFs.Connect() );
     User::LeaveIfError( iFs.ShareProtected() );
     User::LeaveIfError( iRegistrySession.Connect() );
@@ -878,17 +873,6 @@
     return jadFileName;
     }
 
-
-// ---------------------------------------------------------------------------
-// Documenthandler getter
-// ---------------------------------------------------------------------------
-//
-CDocumentHandler& CNcdInstallationService::DocumentHandler()
-    {
-    return *iDocHandler;
-    }
-
-
 // ---------------------------------------------------------------------------
 // Callback function of MNcdAsyncOperationObserver interface
 // This is called when an async operation has finished.
@@ -1293,8 +1277,6 @@
     {
     DLTRACEIN(( _L("iBusy=%d, MIME: %S"),iBusy, &aMimeType ));    
     DASSERT( iObserver );
-    DASSERT( iDocHandler );
-
     
     // Check if some installation is already in progress.
     if ( iBusy )
@@ -1389,7 +1371,6 @@
             {
             DLINFO(("Normal install"));
             InitializeInstallerL();
-            //iCancelCode = SwiUI::ERequestInstallHandle;
             
             if ( !iArguments )
                 {
@@ -1403,7 +1384,7 @@
             iArguments->AddIntL( Usif::KSifInParam_InstallSilently, EFalse );
             
             iInstaller.Install( aFile, *iArguments, *iResults, iInstallStatusObserver->iStatus ); 
-            //iInstaller.Install( iInstallStatusObserver->iStatus, aFile );
+
             iInstallStatusObserver->StartToObserve();            
             }
         else
@@ -1424,55 +1405,12 @@
         DLINFO(("Installing content"));
         // File is some common format.
         iInstallType = EFileInstall;
-        TDataType dataType;
-    
-        if ( aMimeType != KNullDesC )
-            {
-            // If mime type is given, it will be used in document handler.
-            HBufC8* tempBuf = Des16ToDes8LC( aMimeType );
-            dataType = TDataType( *tempBuf );
-            CleanupStack::PopAndDestroy( tempBuf );
-            DLINFO(("DataType: %S", &dataType.Des8() ));
-            }
-                
-        TInt docHandlerError( KErrNone );
         
-        DLINFO(("Normal install"));
-        // Have to use CopyL since MoveL works only with filepaths
-        // We can't use SilentMoveL either
-        docHandlerError = 
-            iDocHandler->CopyL( aFile, 
-                                KNullDesC(),
-                                dataType, 
-                                KEntryAttNormal );            
+        // content not supported
+        iObserver->InstallationCompleteL( KNullDesC, KNullUid, KErrNotSupported );
+        
+        }
 
-        DLTRACE(("After move"));
-        if( docHandlerError != KErrNone )
-            {
-            DLINFO(("error=%d",docHandlerError));
-            
-            // Use KErrAbort for user cancellation
-            if ( docHandlerError == KUserCancel ) 
-                {
-                docHandlerError = KErrAbort;
-                }
-            iObserver->InstallationCompleteL( KNullDesC, KNullUid, docHandlerError );
-            }
-        else
-            { 
-            DLTRACE(("Installation successful"));
-            
-            RBuf installFileName;
-            CleanupClosePushL( installFileName );
-            
-            installFileName.CreateL( KMaxPath );
-                        
-            User::LeaveIfError( iDocHandler->GetPath( installFileName ) );
-            iObserver->InstallationCompleteL( installFileName, KNullUid, KErrNone );
-            CleanupStack::PopAndDestroy( &installFileName );            
-
-            }
-        }
     DLTRACEOUT((""));    
     }
 
@@ -1527,7 +1465,6 @@
             {
             DLTRACE(("Installing JAD+JAR"));
             // JAD+JAR install
-            //iCancelCode = SwiUI::ERequestInstall;
             if ( !iArguments )
                 {
                 iArguments = Usif::COpaqueNamedParams::NewL();
@@ -1540,13 +1477,11 @@
              iArguments->AddIntL( Usif::KSifInParam_InstallSilently, EFalse );
                         
             iInstaller.Install( *iJadFileName, *iArguments, *iResults, iInstallStatusObserver->iStatus ); 
-            //iInstaller.Install( iInstallStatusObserver->iStatus, *iJadFileName );
             }
         else
             {
             DLTRACE(("Installing JAR"));
             // JAR install
-            //iCancelCode = SwiUI::ERequestInstallHandle;
             if ( !iArguments )
                 {
                 iArguments = Usif::COpaqueNamedParams::NewL();
@@ -1560,7 +1495,6 @@
              
              iInstaller.Install( aFile, *iArguments, *iResults, iInstallStatusObserver->iStatus ); 
             
-            //iInstaller.Install( iInstallStatusObserver->iStatus, aFile );
             }
         
         iInstallStatusObserver->StartToObserve();
@@ -1620,7 +1554,6 @@
         {
         DLINFO(("Normal install"));
         InitializeInstallerL();
-        //iCancelCode = SwiUI::ERequestInstallHandle;
         if ( !iArguments )
             {
             iArguments = Usif::COpaqueNamedParams::NewL();
@@ -1633,7 +1566,6 @@
         iArguments->AddIntL( Usif::KSifInParam_InstallSilently, EFalse );
         iInstaller.Install(aFile, *iArguments, *iResults, iInstallStatusObserver->iStatus  );
          
-        //iInstaller.Install( iInstallStatusObserver->iStatus, aFile );
         iInstallStatusObserver->StartToObserve();            
         }
     else
@@ -1661,12 +1593,6 @@
     iInstallStatusObserver = CNcdActiveOperationObserver::NewL( *this );
     
     User::LeaveIfError( iInstaller.Connect() );
-    /*
-    if ( !iInstaller.Handle() ) 
-        {
-        User::LeaveIfError( iInstaller.Connect() );
-        }
-    */
     }
     
 
@@ -1677,13 +1603,11 @@
 void CNcdInstallationService::CancelInstall()
     {
     DLTRACEIN((""));
-    //if ( iInstallStatusObserver &&
-    //     iInstaller.Handle() ) 
+    
     if ( iInstallStatusObserver )
         {
         DLTRACE(("Cancelling installation"));
         iInstaller.CancelOperation();
-        //iInstaller.CancelAsyncRequest( iCancelCode );
         }
     
     DeletePtr( iInstallStatusObserver );