Changeset c9231c6


Ignore:
Timestamp:
05/08/14 07:03:42 (13 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, enter/10, releng/10.0.2, releng/10.0.3, releng/10.1, releng/10.1.1, releng/10.1.2
Children:
de6c883
Parents:
922343c5
Message:

Clean up the update detection for the AppCafe?, and also add an option to view all the raw system packages on the installed tab.

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

Legend:

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

    r086ab7b rc9231c6  
    130130void MainUI::on_actionShow_Base_Packages_triggered(){ 
    131131  slotRefreshInstallTab();       
     132} 
     133 
     134void MainUI::on_actionRaw_Inst_Packages_triggered(){ 
     135  slotRefreshInstallTab(); 
    132136} 
    133137 
     
    216220  NGApp app = PBI->singleAppInfo(ID, VISJAIL); 
    217221  //qDebug() << "Item:" << ID << app.origin << app.name << item->text(0); 
    218   if(app.origin.isEmpty()){ return; } //invalid item 
     222  if(app.origin.isEmpty()){ item->setWhatsThis(0,""); qDebug() << "Invalid Item:" << ID; return; } //invalid item 
    219223    //Fill the item columns [name, version, status, size, date, arch] 
    220       item->setText(0,app.name); 
     224      if(app.name.isEmpty()){ item->setText(0, app.origin.section("/",-1)); } 
     225      else{ item->setText(0,app.name); } 
    221226      item->setText(1,app.installedversion); 
    222227      item->setText(2, PBI->currentAppStatus(ID, VISJAIL)); 
     
    268273  if(VISJAIL.isEmpty()){ ui->label_install_jail->setText( tr("Showing: Local System") ); } 
    269274  else{ ui->label_install_jail->setText( QString(tr("Showing Jail: %1")).arg(VISJAIL) ); } 
    270   QStringList installList = PBI->installedList(VISJAIL); 
     275  QStringList installList = PBI->installedList(VISJAIL, ui->actionRaw_Inst_Packages->isChecked()); 
    271276  //qDebug() << "Installed Pkgs:" << installList; 
    272277  installList.append( PBI->pendingInstallList() ); 
     
    295300  } 
    296301  //Now add any new items to the list 
     302  //qDebug() << "New Items:" << installList; 
    297303  for(int i=0; i<installList.length(); i++){ 
    298304    QTreeWidgetItem *item = new QTreeWidgetItem; //create the item 
     
    302308        formatInstalledItemDisplay(item); 
    303309        //qDebug() << "New Item:" << installList[i] << item->text(0); 
    304         if(item->text(0).isEmpty()){ 
    305           //Do not put empty items into the display 
     310        if(item->whatsThis(0).isEmpty()){ 
     311          //Do not put invalid items into the display 
    306312          delete item; 
    307313        }else{ 
  • src-qt4/pc-softwaremanager/mainUI.h

    r086ab7b rc9231c6  
    6363  void on_actionDeveloper_Mode_triggered(); 
    6464 
     65  void on_actionRaw_Inst_Packages_triggered(); 
    6566  void on_actionShow_Base_Packages_triggered(); 
    6667  void on_actionShow_Local_System_triggered(); 
  • src-qt4/pc-softwaremanager/mainUI.ui

    r086ab7b rc9231c6  
    4444     <widget class="QTabWidget" name="tabWidget"> 
    4545      <property name="currentIndex"> 
    46        <number>1</number> 
     46       <number>0</number> 
    4747      </property> 
    4848      <property name="iconSize"> 
     
    16561656     <addaction name="actionSample"/> 
    16571657    </widget> 
     1658    <addaction name="actionRaw_Inst_Packages"/> 
    16581659    <addaction name="actionShow_Base_Packages"/> 
    16591660    <addaction name="separator"/> 
     
    18031804   </property> 
    18041805  </action> 
     1806  <action name="actionRaw_Inst_Packages"> 
     1807   <property name="checkable"> 
     1808    <bool>true</bool> 
     1809   </property> 
     1810   <property name="text"> 
     1811    <string>Show Raw Packages</string> 
     1812   </property> 
     1813  </action> 
    18051814 </widget> 
    18061815 <resources> 
  • src-qt4/pc-softwaremanager/pbiDBAccess.cpp

    rc220c7e rc9231c6  
    6363  QStringList IK = PKGINSTALLED.keys(); 
    6464  for(int i=0; i<IK.length(); i++){ 
    65     if( !hash.contains(IK[i]) ){ hash.insert( IK[i], PKGINSTALLED[IK[i]] ); } 
     65    //if( IK[i].contains("sudo") ){ qDebug() << "sudo Installed"; } 
     66    hash.insert( IK[i], PKGINSTALLED[IK[i]] ); //replace the pkg entry with the installed entry 
    6667  } 
    6768  return hash; 
  • src-qt4/pc-softwaremanager/pbiNgBackend.cpp

    re095cc0 rc9231c6  
    6868} 
    6969 
    70 QStringList PBIBackend::installedList(QString injail){ 
     70QStringList PBIBackend::installedList(QString injail, bool raw){ 
    7171   QStringList out; 
    7272   if( injail.isEmpty() ){  
    73      QStringList KL  = APPHASH.keys();  
     73     QStringList KL; 
     74     if(!raw){ KL = APPHASH.keys(); } 
     75     else{ KL = PKGHASH.keys(); } 
    7476     for(int i=0; i<KL.length(); i++){ 
    75        if(APPHASH[KL[i]].isInstalled){ out << KL[i]; } 
     77       if(APPHASH.contains(KL[i])){ 
     78         if(APPHASH[KL[i]].isInstalled){ out << KL[i]; } 
     79       }else if(PKGHASH.contains(KL[i])){ 
     80         if(PKGHASH[KL[i]].isInstalled){ out << KL[i]; } 
     81       } 
    7682     } 
    7783   }else if( JAILPKGS.contains(injail) ){   
     
    363369    else if(PKGHASH.contains(appID)){ app = PKGHASH[appID]; } 
    364370    if(!app.origin.isEmpty()){ 
    365       if(app.version != app.installedversion && app.isInstalled){ 
     371      if(app.version != app.installedversion && app.isInstalled && !app.version.isEmpty()){ 
    366372         output = QString(tr("Update Available: %1")).arg(app.version); 
    367373      } 
     
    466472 
    467473bool PBIBackend::checkForUpdates(QString injail){ 
    468   QStringList inst = sysDB->getRawInstalledPackages(); 
    469474  bool upd = false; 
    470475  QHash<QString, NGApp> hash; 
    471   if(JAILPKGS.contains(injail)){ hash = JAILPKGS[injail]; } 
    472   for(int i=0; i<inst.length() && !upd; i++){ 
    473     NGApp app; 
    474       if(hash.contains(inst[i])){ app = hash[inst[i]]; } //in a jail 
    475       else if(APPHASH.contains(inst[i])){ app = APPHASH[inst[i]]; } 
    476       else if(PKGHASH.contains(inst[i])){ app = PKGHASH[inst[i]]; } 
    477       else{ continue; } 
     476  if(JAILPKGS.contains(injail)){ hash = JAILPKGS[injail]; } //jail list 
     477  else{ hash = PKGHASH; } //system pkgs 
     478  QStringList keys = hash.keys(); 
     479  for(int i=0; i<keys.length() && !upd; i++){ 
     480    NGApp app = hash[keys[i]]; 
    478481      if(app.isInstalled && !app.version.isEmpty()){ 
    479482        upd = (app.version != app.installedversion); 
     
    775778   APPHASH.clear(); 
    776779   CATHASH.clear(); 
    777    sysDB->getAppCafeHomeInfo( &NEWLIST, &HIGHLIST, &RECLIST); 
     780   if(RECLIST.isEmpty()){ 
     781     sysDB->getAppCafeHomeInfo( &NEWLIST, &HIGHLIST, &RECLIST); 
     782   } 
    778783   //qDebug() << "Load APPHASH"; 
    779784   PKGHASH = sysDB->DetailedPkgList(); // load the pkg info 
    780785   APPHASH = sysDB->DetailedAppList(); // load the pbi info 
     786   CATHASH = sysDB->Categories(); // load all the different categories info 
    781787   if(BASELIST.isEmpty()){ 
    782788      //populate the list of base dependencies that cannot be removed 
     
    786792   } 
    787793   if(RUNNINGJAILS.isEmpty()){ checkForJails(); } 
    788    //qDebug() << "Load CATHASH"; 
    789    CATHASH = sysDB->Categories(); // load all the different categories info 
    790    //qDebug() << "Check Jails"; 
    791    checkForJails(); //Update the RUNNINGJAILS 
    792794   //qDebug() << "Update Stats"; 
    793795   updateStatistics(); 
    794796   //qDebug() << "Emit result"; 
    795    if(APPHASH.isEmpty()){ 
     797   if(APPHASH.isEmpty() && PKGHASH.isEmpty()){ 
    796798     emit NoRepoAvailable(); 
    797799   }else{ 
  • src-qt4/pc-softwaremanager/pbiNgBackend.h

    racb0f00 rc9231c6  
    4444        QString searchSimilar; 
    4545        // Main Listing functions 
    46         QStringList installedList(QString injail = ""); //return origin of all installed PBI's 
     46        QStringList installedList(QString injail = "", bool raw = false); //return origin of all installed PBI's 
    4747        QStringList pendingInstallList(); //return origin of all apps pending install 
    4848        QStringList pendingRemoveList(); //return origin of all apps pending removal 
Note: See TracChangeset for help on using the changeset viewer.