26 |
26 |
27 #include "cadef.h" |
27 #include "cadef.h" |
28 #include "cawidgetscannerparser.h" |
28 #include "cawidgetscannerparser.h" |
29 #include "widgetscannerutils.h" |
29 #include "widgetscannerutils.h" |
30 |
30 |
31 // CONSTANTS |
31 #include "cawidgetscannerdef.h" |
32 |
32 |
33 const TInt KChunkSize = 8192; |
|
34 const TInt KDriveLetterLength = 2; |
|
35 const TInt KModificationTimeLength = 17; |
|
36 |
|
37 _LIT( KManifest, ".manifest"); |
|
38 _LIT( KColen, ":" ); |
|
39 _LIT( KImportDir, "\\private\\20022F35\\import\\widgetregistry\\" ); |
|
40 //_LIT( KImportDir, "import\\widgetregistry\\" ); |
|
41 _LIT( KDoubleSlash, "\\" ); |
|
42 _LIT( KTrue, "true" ); |
|
43 _LIT8(KWidget, "widget" ); |
|
44 _LIT8(KUri, "uri" ); |
|
45 _LIT8(KLibrary, "library" ); |
|
46 _LIT8(KTitle, "title" ); |
|
47 _LIT8(KDescription, "description" ); |
|
48 _LIT8(KHidden, "hidden" ); |
|
49 _LIT8(KIconUri, "iconuri" ); |
|
50 _LIT8(KWidgetProvider, "widgetprovider"); |
|
51 |
|
52 _LIT8(KWidgetManifest, "hswidgetmanifest"); |
|
53 _LIT8(KIcon, "icon"); |
|
54 _LIT8(KServiceXml, "servicexml"); |
|
55 |
33 |
56 // ============================ MEMBER FUNCTIONS =============================== |
34 // ============================ MEMBER FUNCTIONS =============================== |
57 |
35 |
58 // ----------------------------------------------------------------------------- |
36 // ----------------------------------------------------------------------------- |
59 // CCaWidgetScannerParser::CCaWidgetScannerParser |
37 // CCaWidgetScannerParser::CCaWidgetScannerParser |
180 if( (*fileList)[i].iName.Find( KManifest ) != KErrNotFound ) |
158 if( (*fileList)[i].iName.Find( KManifest ) != KErrNotFound ) |
181 { |
159 { |
182 RBuf fullFilePath; |
160 RBuf fullFilePath; |
183 CleanupClosePushL( fullFilePath ); |
161 CleanupClosePushL( fullFilePath ); |
184 fullFilePath.CreateL( manifestDirectoryPath->Length() + |
162 fullFilePath.CreateL( manifestDirectoryPath->Length() + |
185 (*fileList)[i].iName.Length()); |
163 (*fileList)[i].iName.Length() ); |
186 fullFilePath.Append( *manifestDirectoryPath ); |
164 fullFilePath.Append( *manifestDirectoryPath ); |
187 fullFilePath.Append( (*fileList)[i].iName ); |
165 fullFilePath.Append( (*fileList)[i].iName ); |
188 //if file is corrupted we go to the next one |
166 //if file is corrupted we go to the next one |
189 TRAP_IGNORE(ParseManifestFileL( fullFilePath, aDirectoryName )); |
167 TRAP_IGNORE(ParseManifestFileL( fullFilePath, aDirectoryName )); |
190 CleanupStack::PopAndDestroy( &fullFilePath ); |
168 CleanupStack::PopAndDestroy( &fullFilePath ); |
231 iWidgetDescriptor->SetPackageUidL(aPackageUid); |
209 iWidgetDescriptor->SetPackageUidL(aPackageUid); |
232 iWidgetDescriptor->SetVisible(ETrue); |
210 iWidgetDescriptor->SetVisible(ETrue); |
233 iWidgetDescriptor->SetManifestFilePathNameL( aFilePath ); |
211 iWidgetDescriptor->SetManifestFilePathNameL( aFilePath ); |
234 |
212 |
235 SetMmcIdL( iWidgetDescriptor ); |
213 SetMmcIdL( iWidgetDescriptor ); |
236 |
214 |
237 RXmlEngNodeList<TXmlEngElement> childElementList; |
215 RXmlEngNodeList<TXmlEngElement> childElementList; |
238 CleanupClosePushL(childElementList); |
216 CleanupClosePushL(childElementList); |
239 docElement.GetChildElements(childElementList); |
217 docElement.GetChildElements(childElementList); |
240 TXmlEngElement element; |
218 TXmlEngElement element; |
|
219 |
241 while (childElementList.HasNext()) |
220 while (childElementList.HasNext()) |
242 { |
221 { |
243 element = childElementList.Next(); |
222 element = childElementList.Next(); |
244 if (element.Name() == KUri) |
223 if (element.Name() == KUri) |
245 { |
224 { |