widgets/widgetinstaller/src/WidgetUIOperationsWatcher.cpp
branchRCL_3
changeset 37 ac77f89b1d9e
parent 36 c711bdda59f4
child 41 4bd5176e1bc8
equal deleted inserted replaced
36:c711bdda59f4 37:ac77f89b1d9e
   799         if ( !iSilent )
   799         if ( !iSilent )
   800             {
   800             {
   801             iUIHandler->CloseFinalizeDialogL();
   801             iUIHandler->CloseFinalizeDialogL();
   802             iUIHandler->DisplayCompleteL();
   802             iUIHandler->DisplayCompleteL();
   803             }
   803             }
   804 
   804         
   805         HandleLogsL(*(iPropertyValues[EBundleDisplayName]), TUid::Uid( *(iPropertyValues[EUid]) ), *(iPropertyValues[ENokiaWidget]), SwiUI::ELogTaskActionInstall);
   805         HandleLogsL(*(iPropertyValues[EBundleDisplayName]), TUid::Uid( *(iPropertyValues[EUid]) ), *(iPropertyValues[ENokiaWidget]), *(iPropertyValues[EBundleVersion]), SwiUI::ELogTaskActionInstall);
   806         }
   806         }
   807     else // cancelled
   807     else // cancelled
   808         {
   808         {
   809         // delete what was being installed, and restore previous
   809         // delete what was being installed, and restore previous
   810         (void)iFileMgr->RmDir( *(iPropertyValues[EBasePath]) );
   810         (void)iFileMgr->RmDir( *(iPropertyValues[EBasePath]) );
  1004         TBuf<KWidgetRegistryVal> widgetPath;
  1004         TBuf<KWidgetRegistryVal> widgetPath;
  1005         iRegistry.GetWidgetPath( aUid, widgetPath );
  1005         iRegistry.GetWidgetPath( aUid, widgetPath );
  1006         
  1006         
  1007         CWidgetPropertyValue* propValue = iRegistry.GetWidgetPropertyValueL(aUid, ENokiaWidget);
  1007         CWidgetPropertyValue* propValue = iRegistry.GetWidgetPropertyValueL(aUid, ENokiaWidget);
  1008         TBool aVendor = propValue && *(propValue);
  1008         TBool aVendor = propValue && *(propValue);
       
  1009         delete propValue;
       
  1010         propValue = NULL; 
       
  1011         propValue = iRegistry.GetWidgetPropertyValueL(aUid,EBundleVersion);
       
  1012         TBuf<KWidgetRegistryVal> version;
       
  1013         if(propValue)
       
  1014             version = (const TDesC& )*propValue;
  1009         delete propValue;
  1015         delete propValue;
  1010 
  1016 
  1011         // TODO if any of next steps leave does state become inconsistent?
  1017         // TODO if any of next steps leave does state become inconsistent?
  1012 
  1018 
  1013         // remove the dir for the widget
  1019         // remove the dir for the widget
  1032         iRegistry.DeRegisterWidgetL( aUid );
  1038         iRegistry.DeRegisterWidgetL( aUid );
  1033         TInt err = KErrNone;
  1039         TInt err = KErrNone;
  1034         TRAP(err, FinishUninstallL( KErrNone ));
  1040         TRAP(err, FinishUninstallL( KErrNone ));
  1035         if(err == KErrNone)
  1041         if(err == KErrNone)
  1036            {
  1042            {
  1037            HandleLogsL(bundleName, aUid, aVendor, SwiUI::ELogTaskActionUninstall);
  1043            HandleLogsL(bundleName, aUid, aVendor, version, SwiUI::ELogTaskActionUninstall);
  1038            }
  1044            }
  1039         }
  1045         }
  1040     else
  1046     else
  1041         {
  1047         {
  1042         if ( !iSilent ) { iUIHandler->DisplayCancelL(); }
  1048         if ( !iSilent ) { iUIHandler->DisplayCancelL(); }
  1321 // ============================================================================
  1327 // ============================================================================
  1322 //
  1328 //
  1323 // CWidgetUIOperationsWatcher::HandleLogsL
  1329 // CWidgetUIOperationsWatcher::HandleLogsL
  1324 //
  1330 //
  1325 // ============================================================================
  1331 // ============================================================================
  1326 void CWidgetUIOperationsWatcher::HandleLogsL(const TDesC& aWidgetName, const TUid &aUid, TBool aVender, SwiUI::TLogTaskAction aAction)
  1332 void CWidgetUIOperationsWatcher::HandleLogsL(const TDesC& aWidgetName, const TUid &aUid, TBool aVender, const TDesC& aVersion, SwiUI::TLogTaskAction aAction)
  1327     {
  1333     {
  1328     CTask* task = CTask::NewL( KLogTaskImplUid, EFalse );
  1334     CTask* task = CTask::NewL( KLogTaskImplUid, EFalse );
  1329     CleanupStack::PushL(task);
  1335     CleanupStack::PushL(task);
  1330 
  1336 
  1331     TLogTaskParam params;
  1337     TLogTaskParam params;
  1335     params.iVendor.Copy((aVender ? _L("Nokia") : _L("Non-Nokia")));
  1341     params.iVendor.Copy((aVender ? _L("Nokia") : _L("Non-Nokia")));
  1336 
  1342 
  1337     TTime time;
  1343     TTime time;
  1338     time.UniversalTime();
  1344     time.UniversalTime();
  1339     params.iTime = time;
  1345     params.iTime = time;
  1340 
  1346     
       
  1347     TLex lex(aVersion);
       
  1348     TInt i[] = {0,0,0}, j = 0;
       
  1349     while((lex.Get()) != 0 )
       
  1350         {
       
  1351         TInt num = 0; 
       
  1352         while ( lex.Peek() && (lex.Peek()) != '.')
       
  1353             lex.Inc();
       
  1354         TLex toNum(lex.MarkedToken());
       
  1355         toNum.Val(num);
       
  1356         i[j++] = num;
       
  1357         lex.Inc();
       
  1358         lex.Mark();
       
  1359         }
       
  1360     params.iVersion.iMajor = i[0];
       
  1361     params.iVersion.iMinor = i[1];
       
  1362     params.iVersion.iBuild = i[2];
       
  1363     
  1341     TLogTaskParamPckg pckg( params );
  1364     TLogTaskParamPckg pckg( params );
  1342     task->SetParameterL( pckg, 0 );
  1365     task->SetParameterL( pckg, 0 );
  1343     iTaskManager->AddTaskL( task );
  1366     iTaskManager->AddTaskL( task );
  1344     iTaskManager->CommitL();
  1367     iTaskManager->CommitL();
  1345 
  1368