[PC-BSD Commits] r2506 - in pbibuild/pbi-source: PBIsource PBItext

svn at pcbsd.org svn at pcbsd.org
Thu Jul 31 11:14:33 PDT 2008


Author: kris
Date: 2008-07-31 11:14:33 -0700 (Thu, 31 Jul 2008)
New Revision: 2506

Modified:
   pbibuild/pbi-source/PBIsource/pbi.cpp
   pbibuild/pbi-source/PBItext/main.cpp
Log:

Update the PBI installer to fix adding menu entries for Games / Educational programs



Modified: pbibuild/pbi-source/PBIsource/pbi.cpp
===================================================================
--- pbibuild/pbi-source/PBIsource/pbi.cpp	2008-07-31 17:27:41 UTC (rev 2505)
+++ pbibuild/pbi-source/PBIsource/pbi.cpp	2008-07-31 18:14:33 UTC (rev 2506)
@@ -810,7 +810,7 @@
 	         QFile xdgfile( tmp );
                  if ( xdgfile.open( QIODevice::WriteOnly | QIODevice::Text) ) {
 
-                   QString ParentCat;
+                   QString ParentCat, SubCat;
 		   if ( ExeKdeCat[exenum] == "Development")
 		   {
 		       ParentCat = "Development";
@@ -825,43 +825,53 @@
 		   }
 		   if ( ExeKdeCat[exenum] == "Edutainment/Languages")
 		   {
-		       ParentCat = "Languages";
+		       ParentCat = "Education";
+		       SubCat = "Languages";
 		   }
 		   if ( ExeKdeCat[exenum] == "Edutainment/Math")
 		   {
-		       ParentCat = "Mathmatics";
+		       ParentCat = "Education";
+		       SubCat = "Mathmatics";
 		   }
 		   if ( ExeKdeCat[exenum] == "Edutainment/Misc")
 		   {
-		       ParentCat = "Edutainment";
+		       ParentCat = "Education";
+		       SubCat = "Misc";
 		   }
 		   if ( ExeKdeCat[exenum] == "Edutainment/Science")
 		   {
-		       ParentCat = "Science";
+		       ParentCat = "Education";
+		       SubCat = "Science";
 		   }
 		   if ( ExeKdeCat[exenum] == "Edutainment/Teaching")
 		   {
-		       ParentCat = "Edutainment";
+		       ParentCat = "Education";
+		       SubCat = "Teaching";
 		   }
 		   if ( ExeKdeCat[exenum] == "Games/Arcade")
 		   {
-		       ParentCat = "Arcade";
+		       ParentCat = "Games";
+                       SubCat = "Arcade";
 		   }
 		   if ( ExeKdeCat[exenum] == "Games/Board")
 		   {
-		       ParentCat = "Board";
+		       ParentCat = "Games";
+		       SubCat = "Board";
 		   }
 		   if ( ExeKdeCat[exenum] == "Games/Card")
 		   {
-		       ParentCat = "Card";
+		       ParentCat = "Games";
+                       SubCat = "Card";
 		   }
 		   if ( ExeKdeCat[exenum] == "Games/Kidsgames")
 		   {
-		       ParentCat = "Kidsgames";
+		       ParentCat = "Games";
+                       SubCat = "Kidsgames";
 		   }
 		   if ( ExeKdeCat[exenum] == "Games/TacticStrategy")
 		   {
-		       ParentCat = "TacticStrategy";
+		       ParentCat = "Games";
+                       SubCat = "TacticStrategy";
 		   }
 		   if ( ExeKdeCat[exenum] == "Games")
 		   {
@@ -901,13 +911,22 @@
 		      streamxdg << "<Menu>\n";
 		      streamxdg << " <Menu>\n";
 		      streamxdg << "  <Name>" << ParentCat << "</Name>\n";
-		      streamxdg << "  <Menu>\n";
-		      streamxdg << "   <Name>" << ProgramName << "</Name>\n";
-		      streamxdg << "     <Directory>PBI-" << ProgDirName << ".directory</Directory>\n";
-		      streamxdg << "     <Include>\n";
-		      streamxdg << "       <Category>X-" << ProgDirName << "</Category>\n";
-		      streamxdg << "     </Include>\n";
-		      streamxdg << "  </Menu>\n";
+                      if ( ! SubCat.isEmpty() )
+                      {
+                         streamxdg << "  <Menu>\n";
+		         streamxdg << "   <Name>" << SubCat << "</Name>\n";
+                      }
+		      streamxdg << "   <Menu>\n";
+		      streamxdg << "    <Name>" << ProgramName << "</Name>\n";
+		      streamxdg << "      <Directory>PBI-" << ProgDirName << ".directory</Directory>\n";
+		      streamxdg << "      <Include>\n";
+		      streamxdg << "        <Category>X-" << ProgDirName << "</Category>\n";
+		      streamxdg << "      </Include>\n";
+		      streamxdg << "   </Menu>\n";
+                      if ( ! SubCat.isEmpty() )
+                      {
+                         streamxdg << "  </Menu>\n";
+		      }
 		      streamxdg << " </Menu>\n";
 		      streamxdg << "</Menu>\n";
 

Modified: pbibuild/pbi-source/PBItext/main.cpp
===================================================================
--- pbibuild/pbi-source/PBItext/main.cpp	2008-07-31 17:27:41 UTC (rev 2505)
+++ pbibuild/pbi-source/PBItext/main.cpp	2008-07-31 18:14:33 UTC (rev 2506)
@@ -755,7 +755,7 @@
 	         QFile xdgfile( tmp );
                  if ( xdgfile.open( QIODevice::WriteOnly | QIODevice::Text) ) {
 
-                   QString ParentCat;
+                   QString ParentCat, SubCat;
 		   if ( ExeKdeCat[exenum] == "Development")
 		   {
 		       ParentCat = "Development";
@@ -770,43 +770,53 @@
 		   }
 		   if ( ExeKdeCat[exenum] == "Edutainment/Languages")
 		   {
-		       ParentCat = "Languages";
+		       ParentCat = "Education";
+		       SubCat = "Languages";
 		   }
 		   if ( ExeKdeCat[exenum] == "Edutainment/Math")
 		   {
-		       ParentCat = "Mathmatics";
+		       ParentCat = "Education";
+		       SubCat = "Mathmatics";
 		   }
 		   if ( ExeKdeCat[exenum] == "Edutainment/Misc")
 		   {
-		       ParentCat = "Edutainment";
+		       ParentCat = "Education";
+		       SubCat = "Misc";
 		   }
 		   if ( ExeKdeCat[exenum] == "Edutainment/Science")
 		   {
-		       ParentCat = "Science";
+		       ParentCat = "Education";
+		       SubCat = "Science";
 		   }
 		   if ( ExeKdeCat[exenum] == "Edutainment/Teaching")
 		   {
-		       ParentCat = "Edutainment";
+		       ParentCat = "Education";
+		       SubCat = "Teaching";
 		   }
 		   if ( ExeKdeCat[exenum] == "Games/Arcade")
 		   {
-		       ParentCat = "Arcade";
+		       ParentCat = "Games";
+                       SubCat = "Arcade";
 		   }
 		   if ( ExeKdeCat[exenum] == "Games/Board")
 		   {
-		       ParentCat = "Board";
+		       ParentCat = "Games";
+		       SubCat = "Board";
 		   }
 		   if ( ExeKdeCat[exenum] == "Games/Card")
 		   {
-		       ParentCat = "Card";
+		       ParentCat = "Games";
+                       SubCat = "Card";
 		   }
 		   if ( ExeKdeCat[exenum] == "Games/Kidsgames")
 		   {
-		       ParentCat = "Kidsgames";
+		       ParentCat = "Games";
+                       SubCat = "Kidsgames";
 		   }
 		   if ( ExeKdeCat[exenum] == "Games/TacticStrategy")
 		   {
-		       ParentCat = "TacticStrategy";
+		       ParentCat = "Games";
+                       SubCat = "TacticStrategy";
 		   }
 		   if ( ExeKdeCat[exenum] == "Games")
 		   {
@@ -841,22 +851,33 @@
 		       ParentCat = "Utility";
 		   }
 
-                      QTextStream streamxdg( &xdgfile );
+                     QTextStream streamxdg( &xdgfile );
 		      streamxdg << "<!DOCTYPE Menu PUBLIC \"-//freedesktop//DTD Menu 1.0//EN\" \"http://www.freedesktop.org/standards/menu-spec/1.0/menu.dtd\">\n";
 		      streamxdg << "<Menu>\n";
 		      streamxdg << " <Menu>\n";
 		      streamxdg << "  <Name>" << ParentCat << "</Name>\n";
-		      streamxdg << "  <Menu>\n";
-		      streamxdg << "   <Name>" << ProgramName << "</Name>\n";
-		      streamxdg << "     <Directory>PBI-" << ProgDirName << ".directory</Directory>\n";
-		      streamxdg << "     <Include>\n";
-		      streamxdg << "       <Category>X-" << ProgDirName << "</Category>\n";
-		      streamxdg << "     </Include>\n";
-		      streamxdg << "  </Menu>\n";
+                      if ( ! SubCat.isEmpty() )
+                      {
+                         streamxdg << "  <Menu>\n";
+		         streamxdg << "   <Name>" << SubCat << "</Name>\n";
+                      }
+		      streamxdg << "   <Menu>\n";
+		      streamxdg << "    <Name>" << ProgramName << "</Name>\n";
+		      streamxdg << "      <Directory>PBI-" << ProgDirName << ".directory</Directory>\n";
+		      streamxdg << "      <Include>\n";
+		      streamxdg << "        <Category>X-" << ProgDirName << "</Category>\n";
+		      streamxdg << "      </Include>\n";
+		      streamxdg << "   </Menu>\n";
+                      if ( ! SubCat.isEmpty() )
+                      {
+                         streamxdg << "  </Menu>\n";
+		      }
 		      streamxdg << " </Menu>\n";
 		      streamxdg << "</Menu>\n";
 
                       xdgfile.close();
+
+                      xdgfile.close();
                  }
 
 		 stream << "Categories=Qt;KDE;X-" + ProgDirName + ";\n";



More information about the Commits mailing list