Ignore:
Timestamp:
02/28/14 05:28:02 (11 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, releng/10.0.1, releng/10.0.2, releng/10.0.3, releng/10.1, releng/10.1.1
Children:
a07b515
Parents:
f996b547
Message:

Clean up a couple more backup functions in the AppCafe?:
1) If you try to remove a non-installed PBI, it will simply cancel the installation instead
2) Make sure that if a non-installed PBI is right-clicked, it only shows the "cancel" option.

File:
1 edited

Legend:

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

    r7e41a70 redece96  
    259259  qDebug() << "PBI Removals requested for:" << pbiID; 
    260260  QStringList xdgrem; xdgrem << "remove-desktop" << "remove-menu" << "remove-mime" << "remove-paths"; 
     261  QStringList cancelList; 
    261262  for(int i=0; i<pbiID.length(); i++){ 
     263             
    262264    if(PBIHASH.contains(pbiID[i])){ 
    263       //Remove XDG entries for this app 
    264       PENDINGREMOVAL << pbiID[i]+":::"+generateXDGCMD(pbiID[i],xdgrem, FALSE); 
    265       //Remove the app itself 
    266       PENDINGREMOVAL << pbiID[i]+":::"+generateRemoveCMD(pbiID[i]); 
    267       //Now update the status 
    268       PBIHASH[pbiID[i]].setStatus(InstalledPBI::PENDINGREMOVAL); 
    269       emit PBIStatusChange(pbiID[i]); 
     265      if( isInstalled(pbiID[i]).isEmpty() ){ 
     266        //Not a fully-installed PBI - cancel it instead 
     267        cancelList << pbiID[i]; 
     268      }else{ 
     269        //Remove XDG entries for this app 
     270        PENDINGREMOVAL << pbiID[i]+":::"+generateXDGCMD(pbiID[i],xdgrem, FALSE); 
     271        //Remove the app itself 
     272        PENDINGREMOVAL << pbiID[i]+":::"+generateRemoveCMD(pbiID[i]); 
     273        //Now update the status 
     274        PBIHASH[pbiID[i]].setStatus(InstalledPBI::PENDINGREMOVAL); 
     275        emit PBIStatusChange(pbiID[i]); 
     276      } 
    270277    }else{ 
    271278      qDebug() << pbiID[i] << "not a valid PBI to remove";           
    272279    } 
    273280  } 
     281  //If there are PBIs to cancel, do that too 
     282  if(!cancelList.isEmpty()){ cancelActions(cancelList); } 
    274283  //Now check/start the remove process 
    275284  QTimer::singleShot(0,this,SLOT(checkProcesses()) ); 
Note: See TracChangeset for help on using the changeset viewer.