Changeset a07b515


Ignore:
Timestamp:
02/28/14 05:34:52 (10 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, releng/10.0.1, releng/10.0.2, releng/10.0.3, releng/10.1
Children:
082a859
Parents:
edece96
Message:

Make sure that all the other backend functions (desktop/menu/mime/path/auto-update) also only function on PBI's that are actually installed.

File:
1 edited

Legend:

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

    redece96 ra07b515  
    239239  qDebug() << "PBI Upgrades requested for:" << pbiID; 
    240240  for(int i=0; i<pbiID.length(); i++){ 
    241     if( PBIHASH.contains(pbiID[i]) ){ 
     241    if( PBIHASH.contains(pbiID[i]) && !isInstalled(pbiID[i]).isEmpty() ){ 
    242242      if( PBIHASH[pbiID[i]].status == InstalledPBI::UPDATEAVAILABLE ){ 
    243243        QString cmd = generateUpdateCMD(pbiID[i]); 
     
    334334void PBIBackend::addDesktopIcons(QStringList pbiID, bool allusers){ // add XDG desktop icons 
    335335  for(int i=0; i<pbiID.length(); i++){ 
    336     if(PBIHASH.contains(pbiID[i])){ 
     336    if( PBIHASH.contains(pbiID[i]) && !isInstalled(pbiID[i]).isEmpty() ){ 
    337337      //generate the command 
    338338      QString cmd = generateXDGCMD(pbiID[i],QStringList()<<"desktop",allusers); 
     
    347347void PBIBackend::addMenuIcons(QStringList pbiID, bool allusers){ // add XDG menu icons 
    348348  for(int i=0; i<pbiID.length(); i++){ 
    349     if(PBIHASH.contains(pbiID[i])){ 
     349    if( PBIHASH.contains(pbiID[i]) && !isInstalled(pbiID[i]).isEmpty() ){ 
    350350      //generate the command 
    351351      QString cmd = generateXDGCMD(pbiID[i],QStringList()<<"menu",allusers); 
     
    360360void PBIBackend::addPaths(QStringList pbiID, bool allusers){ // create path links 
    361361  for(int i=0; i<pbiID.length(); i++){ 
    362     if(PBIHASH.contains(pbiID[i])){ 
     362    if( PBIHASH.contains(pbiID[i]) && !isInstalled(pbiID[i]).isEmpty() ){ 
    363363      //generate the command 
    364364      QString cmd = generateXDGCMD(pbiID[i],QStringList()<<"paths",allusers); 
     
    373373void PBIBackend::addMimeTypes(QStringList pbiID, bool allusers){ // remove path links 
    374374  for(int i=0; i<pbiID.length(); i++){ 
    375     if(PBIHASH.contains(pbiID[i])){ 
     375    if( PBIHASH.contains(pbiID[i]) && !isInstalled(pbiID[i]).isEmpty() ){ 
    376376      //generate the command 
    377377      QString cmd = generateXDGCMD(pbiID[i],QStringList()<<"mime",allusers); 
     
    386386void PBIBackend::rmDesktopIcons(QStringList pbiID, bool allusers){ // remove XDG desktop icons 
    387387  for(int i=0; i<pbiID.length(); i++){ 
    388     if(PBIHASH.contains(pbiID[i])){ 
     388    if( PBIHASH.contains(pbiID[i]) && !isInstalled(pbiID[i]).isEmpty() ){ 
    389389      //generate the command 
    390390      QString cmd = generateXDGCMD(pbiID[i],QStringList()<<"remove-desktop",allusers); 
     
    399399void PBIBackend::rmMenuIcons(QStringList pbiID, bool allusers){ // remove XDG menu icons 
    400400  for(int i=0; i<pbiID.length(); i++){ 
    401     if(PBIHASH.contains(pbiID[i])){ 
     401    if( PBIHASH.contains(pbiID[i]) && !isInstalled(pbiID[i]).isEmpty() ){ 
    402402      //generate the command 
    403403      QString cmd = generateXDGCMD(pbiID[i],QStringList()<<"remove-menu",allusers); 
     
    412412void PBIBackend::rmPaths(QStringList pbiID, bool allusers){ // remove path links 
    413413  for(int i=0; i<pbiID.length(); i++){ 
    414     if(PBIHASH.contains(pbiID[i])){ 
     414    if( PBIHASH.contains(pbiID[i]) && !isInstalled(pbiID[i]).isEmpty() ){ 
    415415      //generate the command 
    416416      QString cmd = generateXDGCMD(pbiID[i],QStringList()<<"remove-paths",allusers); 
     
    425425void PBIBackend::rmMimeTypes(QStringList pbiID, bool allusers){ // remove path links 
    426426  for(int i=0; i<pbiID.length(); i++){ 
    427     if(PBIHASH.contains(pbiID[i])){ 
     427    if( PBIHASH.contains(pbiID[i]) && !isInstalled(pbiID[i]).isEmpty() ){ 
    428428      //generate the command 
    429429      QString cmd = generateXDGCMD(pbiID[i],QStringList()<<"remove-mime",allusers); 
     
    437437 
    438438void PBIBackend::enableAutoUpdate(QString pbiID, bool enable){ 
    439   if(!PBIHASH.contains(pbiID)){return;} 
     439  if(!PBIHASH.contains(pbiID) || isInstalled(pbiID).isEmpty() ){return;} 
    440440  //Generate the command 
    441441  QString cmd = generateAutoUpdateCMD(pbiID,enable); 
Note: See TracChangeset for help on using the changeset viewer.