[PC-BSD Commits] r17695 - pcbsd/current/src-qt4/EasyPBI

svn at pcbsd.org svn at pcbsd.org
Mon Jul 9 11:52:04 PDT 2012


Author: kenmoore
Date: 2012-07-09 18:52:04 +0000 (Mon, 09 Jul 2012)
New Revision: 17695

Modified:
   pcbsd/current/src-qt4/EasyPBI/mainwindow.cpp
   pcbsd/current/src-qt4/EasyPBI/modBuild.cpp
Log:
Add back in the support for EasyPBI to auto-detect whether a port contains a graphical application or not (existed in the old module detection algorithms, now it is in the new one as well)



Modified: pcbsd/current/src-qt4/EasyPBI/mainwindow.cpp
===================================================================
--- pcbsd/current/src-qt4/EasyPBI/mainwindow.cpp	2012-07-09 17:43:10 UTC (rev 17694)
+++ pcbsd/current/src-qt4/EasyPBI/mainwindow.cpp	2012-07-09 18:52:04 UTC (rev 17695)
@@ -191,11 +191,9 @@
     ui->gui_app->setEnabled(TRUE);
     ui->create_button->setEnabled(TRUE);
     ui->pushFindIcon->setEnabled(TRUE);
-    bool status = TRUE; //Is_GUI(pbi_data);
-    if (status)
-        ui->gui_app->setChecked(true);
-    else
-        ui->gui_app->setChecked(false);
+    bool isgraphical = ( "TRUE" == ModBuild::getPortInfo(module_path,"hasGUI").join("") ); //Is_GUI(pbi_data);
+    if (isgraphical){ ui->gui_app->setChecked(true); }
+    else{ ui->gui_app->setChecked(false); }
 }
 
 void MainWindow::on_create_button_clicked()

Modified: pcbsd/current/src-qt4/EasyPBI/modBuild.cpp
===================================================================
--- pcbsd/current/src-qt4/EasyPBI/modBuild.cpp	2012-07-09 17:43:10 UTC (rev 17694)
+++ pcbsd/current/src-qt4/EasyPBI/modBuild.cpp	2012-07-09 18:52:04 UTC (rev 17695)
@@ -670,6 +670,8 @@
     outL = portStruct[4].split("###",QString::SkipEmptyParts);
   }else if(value.toLower() == "menucategory"){
     outL = portStruct[5].split("###",QString::SkipEmptyParts);
+  }else if(value.toLower() == "hasgui"){
+    outL = portStruct[6].split("###",QString::SkipEmptyParts);
   }else{
     qDebug() << "Invalid port info requested\n - Valid Options: portname, maintainer, website, options, binaries, menucategory";
   }
@@ -739,10 +741,16 @@
 	}
 	for(int i=0; i<tmpL.length(); i++){
 	  if(tmpL[i].endsWith("\\")){ tmpL[i].chop(1); }
+          tmpL[i].simplified();
 	  if( tmpL[i].startsWith("bin/") || tmpL[i].startsWith("sbin/") ){
 	    bins << tmpL[i];
 	    if(tmpL[i].contains("$")){ variableBinFound=TRUE; }
 	  }  
+          if(tmpL[i].endsWith(".png") || line.endsWith(".jpg") || line.endsWith(".svg")){
+            //Images contained in the port, tag it as a GUI app
+            if(portStruct[6]=="FALSE"){ qDebug() << " - Detected Graphical Application"; }
+            portStruct[6] = "TRUE";
+          }
 	}
       }else{
 	//do nothing - skip this line
@@ -773,7 +781,7 @@
   if( forceRead || (portDir != savePortDir) ){
     //Clear the data structure and initialize it
     portStruct.clear();
-    portStruct << "" << "" << "" << "" << "" << "";
+    portStruct << "" << "" << "" << "" << "" << "" << "FALSE";
     
     qDebug() << "Reading port information for:" << portDir;
     //Read the Port files and save the info to the data structure
@@ -826,6 +834,11 @@
 	  bins << line;
 	  if(line.contains("%%")){ variableBinFound=TRUE; }
         }
+        if(line.endsWith(".png") || line.endsWith(".jpg") || line.endsWith(".svg")){
+          //Images contained in the port, tag it as a GUI app
+          if(portStruct[6]=="FALSE"){ qDebug() << " - Detected Graphical Application"; }
+          portStruct[6] = "TRUE";
+        }
       }
       pfile.close();
       if(!portStruct[4].isEmpty()){ portStruct[4].append("###"); }



More information about the Commits mailing list