appinstaller/AppMngr2/Widget/src/appmngr2widgetappinfo.cpp
branchRCL_3
changeset 26 8b7f4e561641
parent 25 7333d7932ef7
equal deleted inserted replaced
25:7333d7932ef7 26:8b7f4e561641
     1 /*
     1 /*
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2008-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".
    18 
    18 
    19 #include "appmngr2widgetappinfo.h"      // CAppMngr2WidgetAppInfo
    19 #include "appmngr2widgetappinfo.h"      // CAppMngr2WidgetAppInfo
    20 #include "appmngr2widgetruntime.h"      // KAppMngr2WidgetUid
    20 #include "appmngr2widgetruntime.h"      // KAppMngr2WidgetUid
    21 #include "appmngr2widgetinfoiterator.h" // CAppMngr2WidgetInfoIterator
    21 #include "appmngr2widgetinfoiterator.h" // CAppMngr2WidgetInfoIterator
    22 #include "appmngr2widget.hrh"           // Widget command IDs
    22 #include "appmngr2widget.hrh"           // Widget command IDs
    23 #include <WidgetRegistryData.h>         // CWidgetInfo
    23 #include <widgetregistrydata.h>         // CWidgetInfo
    24 #include <appmngr2driveutils.h>         // TAppMngr2DriveUtils
    24 #include <appmngr2driveutils.h>         // TAppMngr2DriveUtils
    25 
    25 
    26 
    26 
    27 // ======== MEMBER FUNCTIONS ========
    27 // ======== MEMBER FUNCTIONS ========
    28 
    28 
    47 CAppMngr2WidgetAppInfo::~CAppMngr2WidgetAppInfo()
    47 CAppMngr2WidgetAppInfo::~CAppMngr2WidgetAppInfo()
    48     {
    48     {
    49     CancelCommand();
    49     CancelCommand();
    50     delete iName;
    50     delete iName;
    51     delete iDetails;
    51     delete iDetails;
       
    52     delete iMimeType;
    52     }
    53     }
    53 
    54 
    54 // ---------------------------------------------------------------------------
    55 // ---------------------------------------------------------------------------
    55 // CAppMngr2WidgetAppInfo::IconIndex()
    56 // CAppMngr2WidgetAppInfo::IconIndex()
    56 // ---------------------------------------------------------------------------
    57 // ---------------------------------------------------------------------------
   114                 CleanupStack::PushL( swInstLauncher );
   115                 CleanupStack::PushL( swInstLauncher );
   115                 User::LeaveIfError( swInstLauncher->Connect() );
   116                 User::LeaveIfError( swInstLauncher->Connect() );
   116                 CleanupStack::Pop( swInstLauncher );
   117                 CleanupStack::Pop( swInstLauncher );
   117                 iSWInstLauncher = swInstLauncher;
   118                 iSWInstLauncher = swInstLauncher;
   118                 }
   119                 }
   119             iSWInstLauncher->Uninstall( aStatus, iWidgetUid, KDataTypeWidget );
   120             iSWInstLauncher->Uninstall( aStatus, iWidgetUid, *iMimeType );
   120             return;     // async operation started
   121             return;     // async operation started
   121 
   122 
   122         default:
   123         default:
   123             break;
   124             break;
   124         }
   125         }
   175 // ---------------------------------------------------------------------------
   176 // ---------------------------------------------------------------------------
   176 //
   177 //
   177 void CAppMngr2WidgetAppInfo::ConstructL( const CWidgetInfo& aWidget )
   178 void CAppMngr2WidgetAppInfo::ConstructL( const CWidgetInfo& aWidget )
   178     {
   179     {
   179     CAppMngr2AppInfo::ConstructL();
   180     CAppMngr2AppInfo::ConstructL();
   180     
   181 
   181     iWidgetUid = aWidget.iUid;
   182     iWidgetUid = aWidget.iUid;
   182     iName = aWidget.iBundleName->AllocL();
   183     iName = aWidget.iBundleName->AllocL();
   183     iDetails = SizeStringWithUnitsL( aWidget.iFileSize );
   184     iDetails = SizeStringWithUnitsL( aWidget.iFileSize );
   184 
   185 
   185     iLocationDrive = TDriveUnit( *aWidget.iDriveName );
   186     iLocationDrive = TDriveUnit( *aWidget.iDriveName );
   186     iLocation = TAppMngr2DriveUtils::LocationFromDriveL( iLocationDrive, iFs );
   187     iLocation = TAppMngr2DriveUtils::LocationFromDriveL( iLocationDrive, iFs );
       
   188 
       
   189     CAppMngr2WidgetRuntime& runtime( static_cast<CAppMngr2WidgetRuntime&>( Runtime() ) );
       
   190     iMimeType = runtime.GetMimeTypeL( iWidgetUid );
   187     }
   191     }
   188 
   192 
   189 // ---------------------------------------------------------------------------
   193 // ---------------------------------------------------------------------------
   190 // CAppMngr2WidgetAppInfo::ShowDetailsL()
   194 // CAppMngr2WidgetAppInfo::ShowDetailsL()
   191 // ---------------------------------------------------------------------------
   195 // ---------------------------------------------------------------------------