Ignore:
Timestamp:
02/25/14 10:06:43 (6 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, releng/10.0.1, releng/10.0.2
Children:
9cd0fa0, 9cbf5aa
Parents:
4588960
Message:

Make sure that when an upgrade fails in the AppCafe?, it defaults to trying to download the latest PBI manually before throwing an error. This catches the situations where the user is actually "upgrading" to an older version of an application because of an un-approval of the latest PBI for some reason.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/pc-softwaremanager/pbiBackend.cpp

    r4be3e27 rc24d6287  
    227227    if( PBIHASH.contains(pbiID[i]) ){ 
    228228      if( PBIHASH[pbiID[i]].status == InstalledPBI::UPDATEAVAILABLE ){ 
    229         QString cmd = generateUpdateCMD(pbiID[i]); 
     229        QString cmd = generateUpdateCMD(pbiID[i]); 
    230230        PENDINGUPDATE << pbiID[i] + ":::" + cmd; 
    231231        PBIHASH[pbiID[i]].setStatus(InstalledPBI::PENDINGUPDATE); 
     
    550550          if(lDownload.startsWith("DLSTAT::")){ 
    551551            QString percent = lDownload.section("::",1,1); 
    552             output = QString(tr("Downloading: %1%")).arg( percent ); 
    553           }else if(lDownload == "DLDONE"){ 
    554             output = tr("Download Finished"); 
     552            QString spd = lDownload.section("::",3,3); 
     553            if(spd=="??"){ 
     554              output = QString(tr("Downloading: %1%")).arg( percent ); 
     555            }else{ 
     556              output = QString(tr("Downloading: %1% @ %2")).arg( percent, spd ); 
     557            } 
    555558          }else{ 
    556             output = tr("Download Starting");  
     559            output = lDownload; 
    557560          } 
    558561          break; 
     
    11561159   if(ID == ProcessManager::UPDATE){ 
    11571160     if(!sUpdate){ //not stopped manually 
    1158        if(PBIHASH.contains(cUpdate)){name = PBIHASH[cUpdate].name; } 
    1159        title = QString(tr("%1 Update Error:")).arg(name);  
    1160        message = tr("The update process experienced an error and could not be completed"); 
     1161       //Try to do the update through full download instead 
     1162       if(PBIHASH.contains(cUpdate)){ 
     1163         QString metaID = PBIHASH[cUpdate].metaID; 
     1164         if(APPHASH.contains(metaID)){ 
     1165          QString version = APPHASH[metaID].latestVersion; 
     1166          queueInstall(metaID, version); 
     1167         }else{ 
     1168          QString name = PBIHASH[cUpdate].name; 
     1169          title = QString(tr("%1 Update Error:")).arg(name);  
     1170          message = tr("The update process experienced an error and could not be completed"); 
     1171         } 
     1172       } 
    11611173     } 
    11621174   } 
Note: See TracChangeset for help on using the changeset viewer.