[PC-BSD Commits] r17968 - pcbsd/current/src-qt4/pc-softwaremanager

svn at pcbsd.org svn at pcbsd.org
Fri Jul 27 07:47:26 PDT 2012


Author: kris
Date: 2012-07-27 14:47:26 +0000 (Fri, 27 Jul 2012)
New Revision: 17968

Modified:
   pcbsd/current/src-qt4/pc-softwaremanager/softmanager-main.cpp
Log:

Fix how we calculate the Installed PBIs count



Modified: pcbsd/current/src-qt4/pc-softwaremanager/softmanager-main.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-softwaremanager/softmanager-main.cpp	2012-07-27 09:19:38 UTC (rev 17967)
+++ pcbsd/current/src-qt4/pc-softwaremanager/softmanager-main.cpp	2012-07-27 14:47:26 UTC (rev 17968)
@@ -627,8 +627,6 @@
 		
     }
 	    
-
-
     // Remove any PBIs still marked as dirty, they no longer are installed
     removeAllPBIDirty();
 
@@ -638,7 +636,14 @@
 
     refreshAppInfo(dynamic_cast<PBI*>(SoftwareListBox->currentItem()));
 
-    InstalledPBIsLabel->setText(QString(tr("Installed: ")) + QString::number(SoftwareListBox->topLevelItemCount()));
+    // Update the number of PBIs installed
+    int installed = 0;
+    for ( int i = 0; i < SoftwareListBox->topLevelItemCount(); ++i) {
+       PBI *pbi = dynamic_cast<PBI*>(SoftwareListBox->topLevelItem(i));
+       if ( pbi->isHidden() == false && ! pbi->isNewDownload() )
+          installed++;
+    }
+    InstalledPBIsLabel->setText(QString(tr("Installed: ")) + QString::number(installed));
 
    // Check for PBI updates again, since our list has now changed
    QTimer::singleShot(200, this, SLOT(slotStartPBIUpdateCheck()));



More information about the Commits mailing list