contentstorage/casoftwareregistry/s60/src/casoftwareregistry_p.cpp
changeset 106 e78d6e055a5b
parent 102 8b8b34fa9751
child 107 b34d53f6acdf
equal deleted inserted replaced
102:8b8b34fa9751 106:e78d6e055a5b
    34 using namespace Usif;
    34 using namespace Usif;
    35 
    35 
    36 _LIT(KConfirmMessageKey, "MIDlet-Delete-Confirm");
    36 _LIT(KConfirmMessageKey, "MIDlet-Delete-Confirm");
    37 _LIT(KCaScrPropertyDomainCategory, "Domain-Category");
    37 _LIT(KCaScrPropertyDomainCategory, "Domain-Category");
    38 _LIT(KCaScrPropertyMidletDescryption, "MIDlet-Description");
    38 _LIT(KCaScrPropertyMidletDescryption, "MIDlet-Description");
    39 const int maxLogsCount = 20;
    39 const int maxLogsCount = 20;  // should be 50 - workaround for 
       
    40 // ou1cimx1#476143 Dialog crash when label contains big amount of lines
    40 
    41 
    41 /*!
    42 /*!
    42  Constructor
    43  Constructor
    43  \param servicePublic Pointer to object of the public class.
    44  \param servicePublic Pointer to object of the public class.
    44  */
    45  */
   215     if (componentId >= 1) {
   216     if (componentId >= 1) {
   216         RSoftwareComponentRegistry scr;
   217         RSoftwareComponentRegistry scr;
   217         CleanupClosePushL(scr);
   218         CleanupClosePushL(scr);
   218         if (scr.Connect() == KErrNone) {
   219         if (scr.Connect() == KErrNone) {
   219             CComponentEntry* entry = CComponentEntry::NewLC();
   220             CComponentEntry* entry = CComponentEntry::NewLC();
   220 
   221             if (scr.GetComponentL(componentId, *entry)) {
   221             TBool resultCode = EFalse;
       
   222             resultCode = scr.GetComponentL(componentId, *entry);
       
   223             if ( resultCode) {
       
   224                 result = entryDetailsL(*entry);
   222                 result = entryDetailsL(*entry);
   225             }
   223                 if (entry->SoftwareType().Compare(KSoftwareTypeJava) == 0) {
   226 
   224                     CPropertyEntry* domainProperty =
   227             if (entry->SoftwareType().Compare(KSoftwareTypeJava) == 0) {
   225                         scr.GetComponentPropertyL(componentId,
   228                 CPropertyEntry* domainProperty =
   226                             KCaScrPropertyDomainCategory);
   229                     scr.GetComponentPropertyL(componentId,
   227                     CleanupStack::PushL(domainProperty);
   230                         KCaScrPropertyDomainCategory);
   228                     if (domainProperty &&
   231                 CleanupStack::PushL(domainProperty);
   229                         domainProperty->PropertyType() ==
   232                 if (domainProperty &&
   230                             CPropertyEntry::ELocalizedProperty) {
   233                     domainProperty->PropertyType() ==
   231                         result[CaSoftwareRegistry::componentProtectionDomainKey()] =
   234                         CPropertyEntry::ELocalizedProperty) {
   232                             XQConversions::s60DescToQString(
   235                     result[CaSoftwareRegistry::componentProtectionDomainKey()] =
   233                                 static_cast<CLocalizablePropertyEntry*>(
   236                         XQConversions::s60DescToQString(
   234                                     domainProperty)->StrValue());
   237                             static_cast<CLocalizablePropertyEntry*>(
   235                     }
   238                                 domainProperty)->StrValue());
   236 
       
   237                     CPropertyEntry *midletDescryption =
       
   238                         scr.GetComponentPropertyL(componentId,
       
   239                             KCaScrPropertyMidletDescryption);
       
   240                     CleanupStack::PushL(midletDescryption);
       
   241                     if (midletDescryption &&
       
   242                         midletDescryption->PropertyType() ==
       
   243                             CPropertyEntry::ELocalizedProperty) {
       
   244                         result[CaSoftwareRegistry::componentDescriptionKey()] =
       
   245                             XQConversions::s60DescToQString(
       
   246                                 static_cast<CLocalizablePropertyEntry*>(
       
   247                                     midletDescryption)->StrValue());
       
   248                     }
       
   249                     CleanupStack::PopAndDestroy(midletDescryption);
       
   250                     CleanupStack::PopAndDestroy(domainProperty);
   239                 }
   251                 }
   240 
       
   241                 CPropertyEntry *midletDescryption =
       
   242                     scr.GetComponentPropertyL(componentId,
       
   243                         KCaScrPropertyMidletDescryption);
       
   244                 CleanupStack::PushL(midletDescryption);
       
   245                 if (midletDescryption &&
       
   246                     midletDescryption->PropertyType() ==
       
   247                         CPropertyEntry::ELocalizedProperty) {
       
   248                     result[CaSoftwareRegistry::componentDescriptionKey()] =
       
   249                         XQConversions::s60DescToQString(
       
   250                             static_cast<CLocalizablePropertyEntry*>(
       
   251                                 midletDescryption)->StrValue());
       
   252                 }
       
   253                 CleanupStack::PopAndDestroy(midletDescryption);
       
   254                 CleanupStack::PopAndDestroy(domainProperty);
       
   255             }
   252             }
   256             CleanupStack::PopAndDestroy(entry);
   253             CleanupStack::PopAndDestroy(entry);
   257         }
   254         }
   258         CleanupStack::PopAndDestroy(&scr);
   255         CleanupStack::PopAndDestroy(&scr);
   259     }
   256     }
   437  \return string representing operation type.
   434  \return string representing operation type.
   438  */
   435  */
   439 QString CaSoftwareRegistryPrivate::operationTime(TTime time) const
   436 QString CaSoftwareRegistryPrivate::operationTime(TTime time) const
   440 {
   437 {
   441     TDateTime dt = time.DateTime();
   438     TDateTime dt = time.DateTime();
   442     QDate date(dt.Year(), dt.Month()+1, dt.Day());
   439     QDate date(dt.Year(), dt.Month() + 1, dt.Day() + 1);
   443     HbExtendedLocale hbLoc;
   440     HbExtendedLocale hbLoc;
   444     return hbLoc.format(date, r_qtn_date_usual_with_zero);
   441     return hbLoc.format(date, r_qtn_date_usual_with_zero);
   445 }
   442 }