equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2008 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; |
|
53 } |
52 } |
54 |
53 |
55 // --------------------------------------------------------------------------- |
54 // --------------------------------------------------------------------------- |
56 // CAppMngr2WidgetAppInfo::IconIndex() |
55 // CAppMngr2WidgetAppInfo::IconIndex() |
57 // --------------------------------------------------------------------------- |
56 // --------------------------------------------------------------------------- |
115 CleanupStack::PushL( swInstLauncher ); |
114 CleanupStack::PushL( swInstLauncher ); |
116 User::LeaveIfError( swInstLauncher->Connect() ); |
115 User::LeaveIfError( swInstLauncher->Connect() ); |
117 CleanupStack::Pop( swInstLauncher ); |
116 CleanupStack::Pop( swInstLauncher ); |
118 iSWInstLauncher = swInstLauncher; |
117 iSWInstLauncher = swInstLauncher; |
119 } |
118 } |
120 iSWInstLauncher->Uninstall( aStatus, iWidgetUid, *iMimeType ); |
119 iSWInstLauncher->Uninstall( aStatus, iWidgetUid, KDataTypeWidget ); |
121 return; // async operation started |
120 return; // async operation started |
122 |
121 |
123 default: |
122 default: |
124 break; |
123 break; |
125 } |
124 } |
176 // --------------------------------------------------------------------------- |
175 // --------------------------------------------------------------------------- |
177 // |
176 // |
178 void CAppMngr2WidgetAppInfo::ConstructL( const CWidgetInfo& aWidget ) |
177 void CAppMngr2WidgetAppInfo::ConstructL( const CWidgetInfo& aWidget ) |
179 { |
178 { |
180 CAppMngr2AppInfo::ConstructL(); |
179 CAppMngr2AppInfo::ConstructL(); |
181 |
180 |
182 iWidgetUid = aWidget.iUid; |
181 iWidgetUid = aWidget.iUid; |
183 iName = aWidget.iBundleName->AllocL(); |
182 iName = aWidget.iBundleName->AllocL(); |
184 iDetails = SizeStringWithUnitsL( aWidget.iFileSize ); |
183 iDetails = SizeStringWithUnitsL( aWidget.iFileSize ); |
185 |
184 |
186 iLocationDrive = TDriveUnit( *aWidget.iDriveName ); |
185 iLocationDrive = TDriveUnit( *aWidget.iDriveName ); |
187 iLocation = TAppMngr2DriveUtils::LocationFromDriveL( iLocationDrive, iFs ); |
186 iLocation = TAppMngr2DriveUtils::LocationFromDriveL( iLocationDrive, iFs ); |
188 |
|
189 CAppMngr2WidgetRuntime& runtime( static_cast<CAppMngr2WidgetRuntime&>( Runtime() ) ); |
|
190 iMimeType = runtime.GetMimeTypeL( iWidgetUid ); |
|
191 } |
187 } |
192 |
188 |
193 // --------------------------------------------------------------------------- |
189 // --------------------------------------------------------------------------- |
194 // CAppMngr2WidgetAppInfo::ShowDetailsL() |
190 // CAppMngr2WidgetAppInfo::ShowDetailsL() |
195 // --------------------------------------------------------------------------- |
191 // --------------------------------------------------------------------------- |