Changeset d4c9f0db


Ignore:
Timestamp:
05/09/14 07:47:30 (12 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, releng/10.0.2, releng/10.0.3, releng/10.1, releng/10.1.1, releng/10.1.2
Children:
b736a6d
Parents:
41ed195
Message:

New update detection methodology, and fix up the config dialog a bit more.

Location:
src-qt4/pc-softwaremanager
Files:
3 edited

Legend:

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

    r41ed195 rd4c9f0db  
    8080        //Add this repo as UNKNOWN 
    8181        QListWidgetItem *item = new QListWidgetItem( tr("UNKNOWN"), 0); 
     82          item->setWhatsThis(cURL); 
     83          item->setToolTip(cURL); 
    8284        ui->listWidget->addItem(item); 
    8385        ui->listWidget->setCurrentItem(item); 
  • src-qt4/pc-softwaremanager/pbiNgBackend.cpp

    r7d1cdbb rd4c9f0db  
    476476 
    477477bool PBIBackend::checkForUpdates(QString injail){ 
    478   bool upd = false; 
    479   QHash<QString, NGApp> hash; 
    480   if(JAILPKGS.contains(injail)){ hash = JAILPKGS[injail]; } //jail list 
    481   else{ hash = PKGHASH; } //system pkgs 
    482   QStringList keys = hash.keys(); 
    483   for(int i=0; i<keys.length() && !upd; i++){ 
    484     NGApp app = hash[keys[i]]; 
    485       if(app.isInstalled && !app.version.isEmpty() && !app.installedversion.isEmpty()){ 
    486         upd = (app.version != app.installedversion); 
    487       } 
    488       if(upd){ qDebug() << "Update Available:" << app.name << app.installedversion << "->" << app.version; } 
    489   } 
    490   return upd; 
     478  if(injail.isEmpty() || !JAILUPD.contains(injail)){ 
     479    return updavail; 
     480  }else{ 
     481    return JAILUPD[injail]; 
     482  } 
    491483} 
    492484 
     
    623615        QHash<QString, NGApp> pkgs = sysDB->JailPkgList(ID); 
    624616        JAILPKGS.insert(jail, pkgs); 
     617        JAILUPD.insert(jail, checkForPkgUpdates(ID) ); 
    625618      } 
    626619    } 
     
    629622    QHash<QString, NGApp> pkgs = sysDB->JailPkgList(RUNNINGJAILS[jail]); 
    630623    JAILPKGS.insert(jail, pkgs); 
     624    JAILUPD.insert(jail, checkForPkgUpdates(RUNNINGJAILS[jail]) ); 
    631625  } 
    632626} 
     
    803797      //qDebug() << "Base:" << BASELIST; 
    804798   } 
     799   updavail = checkForPkgUpdates(""); 
    805800   if(RUNNINGJAILS.isEmpty() || all){ checkForJails(); } 
    806801   //qDebug() << "Update Stats"; 
     
    821816} 
    822817 
     818bool PBIBackend::checkForPkgUpdates(QString jailID){ 
     819  //Run pc-updatemanager pkgcheck to check for updates 
     820  QString out; 
     821  if(jailID.isEmpty()){ out  = sysDB->runCMD("pc-updatemanager pkgcheck"); } 
     822  else{ out = sysDB->runCMD("pc-updatemanager -j "+jailID+" pkgcheck"); } 
     823  return (!out.contains("All packages are up to date!") && out.contains("To start the upgrade run ") ); 
     824} 
     825 
    823826void PBIBackend::updateSplashScreen(QString msg){ 
    824827  if(Splash == 0){ return; } 
  • src-qt4/pc-softwaremanager/pbiNgBackend.h

    r7d1cdbb rd4c9f0db  
    118118        QString sysUser; //Current user running the AppCafe 
    119119        bool autoDE;    //automatically create desktop entries after an install 
     120        bool updavail; //updates available 
    120121         
    121122        //All the Process queing/interaction 
     
    135136        QHash<QString, QString> RUNNINGJAILS; // <name, ID> 
    136137        QHash<QString, QHash<QString, NGApp> > JAILPKGS; // <name, hash of pkg details> 
     138        QHash<QString, bool> JAILUPD; // <name, updates available> 
    137139        void checkForJails(QString jailID=""); //parses the "jls" command to get name/JID combinations 
    138140         
     
    147149        void slotSyncToDatabase(bool localChanges=false, bool all = false); 
    148150        void updateStatistics(); //number available/installed 
    149  
     151        bool checkForPkgUpdates(QString jailID = ""); 
    150152        void updateSplashScreen(QString); 
    151153         
Note: See TracChangeset for help on using the changeset viewer.