[PC-BSD Commits] r7942 - pcbsd/current/src-qt4/pc-sysmanager

svn at pcbsd.org svn at pcbsd.org
Fri Oct 29 07:12:20 PDT 2010


Author: kris
Date: 2010-10-29 07:12:20 -0700 (Fri, 29 Oct 2010)
New Revision: 7942

Modified:
   pcbsd/current/src-qt4/pc-sysmanager/pbsystemtab.cpp
   pcbsd/current/src-qt4/pc-sysmanager/pbsystemtab.h
Log:

Improve how we read meta-pkg listings, improve sysmanager reponsiveness while parsing



Modified: pcbsd/current/src-qt4/pc-sysmanager/pbsystemtab.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-sysmanager/pbsystemtab.cpp	2010-10-29 13:36:38 UTC (rev 7941)
+++ pcbsd/current/src-qt4/pc-sysmanager/pbsystemtab.cpp	2010-10-29 14:12:20 UTC (rev 7942)
@@ -611,6 +611,7 @@
 {
   pushApplyMeta->setEnabled(false);
   treeMetaPkgs->clear();
+  tmpMetaPkgList.clear();
   new QTreeWidgetItem(treeMetaPkgs, QStringList() << tr("Loading... Please wait...") );
 
   if ( ! metaPkgList.isEmpty() )
@@ -630,6 +631,10 @@
 // Display found meta-pkg data
 void PBSystemTab::slotFinishLoadingMetaPkgs()
 {
+
+  // Populate the metaPkgList
+  parseTmpMetaList();
+
   treeMetaPkgs->clear();
 
   // First look for "parent" apps
@@ -696,11 +701,22 @@
 // Function which checks for our GUI package schema data
 void PBSystemTab::slotGetPackageDataOutput()
 {
+  while (getMetaProc->canReadLine())
+	tmpMetaPkgList << getMetaProc->readLine().simplified();
+}
+
+// Parse the pc-metapkg saved output
+void PBSystemTab::parseTmpMetaList()
+{
   QString tmp, mName, mDesc, mIcon, mParent, mDesktop, mInstalled;
   QStringList package;
 
-  while (getMetaProc->canReadLine()) {
-        tmp = getMetaProc->readLine().simplified();
+  for ( int i = 0 ; i < tmpMetaPkgList.size(); i++ )
+  {
+	QApplication::processEvents();
+
+        tmp = tmpMetaPkgList.at(i);
+
 	if ( tmp.indexOf("Meta Package: ") == 0) {
 		mName = tmp.replace("Meta Package: ", "");
 		continue;

Modified: pcbsd/current/src-qt4/pc-sysmanager/pbsystemtab.h
===================================================================
--- pcbsd/current/src-qt4/pc-sysmanager/pbsystemtab.h	2010-10-29 13:36:38 UTC (rev 7941)
+++ pcbsd/current/src-qt4/pc-sysmanager/pbsystemtab.h	2010-10-29 14:12:20 UTC (rev 7942)
@@ -153,7 +153,9 @@
     bool haveAMetaDesktop();
     bool haveMetaPkgChanges();
     bool getMediaLocation(QString &pkgsource, QString &rDir);
+    void parseTmpMetaList();
     QList<QStringList> metaPkgList;
+    QStringList tmpMetaPkgList;
     QProcess *addMetaProc;
     QProcess *delMetaProc;
     QProcess *getMetaProc;



More information about the Commits mailing list