Ignore:
Timestamp:
02/25/14 11:36:45 (6 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, releng/10.0.1, releng/10.0.2, releng/10.0.3
Children:
ff5a5e4
Parents:
c24d6287
Message:

Fix up the browser app page status notifications with the new backend process class.

File:
1 edited

Legend:

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

    rc24d6287 r9cbf5aa  
    5555   currentRepoNum = "001"; //first repo by default 
    5656   //Filesystem watcher 
     57   watchTimer = new QTimer(this); 
     58     watchTimer->setSingleShot(true); 
     59     watchTimer->setInterval(500); //1/2 a second intervals (to make sure we do not run it too freqently) 
     60     connect(watchTimer, SIGNAL(timeout()), this, SLOT(slotSyncToDatabase()) ); 
    5761   watcher = new QFileSystemWatcher(); 
    58    connect(watcher,SIGNAL(directoryChanged(QString)),this,SLOT(slotSyncToDatabase()) ); 
     62   connect(watcher,SIGNAL(directoryChanged(QString)),this,SLOT(slotWatcherNotification()) ); 
    5963    
    6064 } 
     
    526530    if(!APPHASH.contains(appID)){ return ""; } 
    527531    QStringList pbilist = PBIHASH.keys(); 
     532    bool active = false; 
    528533    for(int i=0; i<pbilist.length(); i++){ 
    529       if(PBIHASH[pbilist[i]].metaID == appID){ status = PBIHASH[pbilist[i]].status; metaID=appID; break; } 
     534      //Be careful about more than one pbiID matching the given appID - grab the active one 
     535      if(PBIHASH[pbilist[i]].metaID == appID){  
     536        status = PBIHASH[pbilist[i]].status;  
     537        metaID=appID; 
     538        active = !(status==InstalledPBI::UPDATEAVAILABLE || status==InstalledPBI::NONE); 
     539      } 
     540      if(active){ break; } 
    530541    } 
    531542  } 
     
    534545    switch (status){ 
    535546        case InstalledPBI::DOWNLOADING: 
    536           output = lDownload; break; 
     547          output = lDownload; 
     548          if(output.isEmpty()){ output = "Downloading"; } 
     549          break; 
    537550        case InstalledPBI::INSTALLING: 
    538           output = lInstall; break; 
     551          output = lInstall;  
     552          if(output.isEmpty()){ output = "Installing"; } 
     553          break; 
    539554        case InstalledPBI::REMOVING: 
    540           output = lRemove; break; 
     555          output = lRemove;  
     556          if(output.isEmpty()){ output = "Removing"; } 
     557          break; 
    541558        case InstalledPBI::UPDATING: 
    542           output = lUpdate; break; 
     559          output = lUpdate;  
     560          if(output.isEmpty()){ output = "Updating"; } 
     561          break; 
     562        case InstalledPBI::NONE: 
     563        case InstalledPBI::UPDATEAVAILABLE: 
     564          output.clear(); break; 
    543565        default: 
    544           output.clear(); 
     566          output = "Pending"; 
    545567    } 
    546568  }else{ 
     
    956978   } 
    957979   if(!dlDir.endsWith("/")){ dlDir.append("/"); }  
     980 } 
     981  
     982 void PBIBackend::slotWatcherNotification(){ 
     983  watchTimer->start();    
    958984 } 
    959985  
Note: See TracChangeset for help on using the changeset viewer.