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

svn at pcbsd.org svn at pcbsd.org
Tue Jul 21 14:08:31 PDT 2009


Author: kris
Date: 2009-07-21 14:08:30 -0700 (Tue, 21 Jul 2009)
New Revision: 4261

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

Fixed a bug when creating sub-menus within another sub-menu. Disable the xdg routine in this
case, since it doesn't work very well, and still adds itself to the main menu. 



Modified: pbibuild/pbi-source/PBIsource/pbi.cpp
===================================================================
--- pbibuild/pbi-source/PBIsource/pbi.cpp	2009-07-21 19:44:31 UTC (rev 4260)
+++ pbibuild/pbi-source/PBIsource/pbi.cpp	2009-07-21 21:08:30 UTC (rev 4261)
@@ -936,20 +936,27 @@
              desktopdirfile.close();
            }
 
-           // Add this desktop file to our install script
-           IconScript << " " << "xdg-desktop-menu install " + MenuDir + "/PBI-" + ProgDirName + ".directory " \
+	  if ( ExeOwndir[exenum] == 0 ) {
+            // Add this desktop file to our install script
+            IconScript << " " << "xdg-desktop-menu install " + MenuDir + "/PBI-" + ProgDirName + ".directory " \
 			+ MenuDir + "/PBI-" + ProgDirName + "-" + Binary + ".desktop";
-           IconUnScript << " " << "xdg-desktop-menu uninstall " + MenuDir + "/PBI-" + ProgDirName + ".directory " \
+            IconUnScript << " " << "xdg-desktop-menu uninstall " + MenuDir + "/PBI-" + ProgDirName + ".directory " \
 			+ MenuDir + "/PBI-" + ProgDirName + "-" + Binary + ".desktop";
+          } else {
+            
+	    // Add this desktop file to our install script
+            IconScript << " " << "xdg-desktop-menu install " + MenuDir + "/PBI-" \
+					+ ProgDirName + "-" + Binary + ".desktop";
+            IconUnScript << " " << "xdg-desktop-menu uninstall " + MenuDir + "/PBI-" \
+					+ ProgDirName + "-" + Binary + ".desktop";
 	
-          // Create a directory in a KDE sub-menu
-          if (ExeOwndir[exenum] == 1) {	
+            // Create a directory in a KDE sub-menu
             QDir xdgdir;
             xdgdir.mkpath ( "/usr/local/etc/xdg/menus/applications-merged");
 	    tmp = "/usr/local/etc/xdg/menus/applications-merged/PBI-" + ProgDirName + ".merge.menu";
 
             // Make sure we cleanup and remove this file during uninstall
-            IconUnScript << " " << "rm " + tmp;
+            IconUnScript << " " << "rm " + tmp + " >/dev/null 2>/dev/null" ;
 
 	    QFile xdgfile( tmp );
             if ( xdgfile.open( QIODevice::WriteOnly | QIODevice::Text) ) {

Modified: pbibuild/pbi-source/PBItext/main.cpp
===================================================================
--- pbibuild/pbi-source/PBItext/main.cpp	2009-07-21 19:44:31 UTC (rev 4260)
+++ pbibuild/pbi-source/PBItext/main.cpp	2009-07-21 21:08:30 UTC (rev 4261)
@@ -899,21 +899,27 @@
              desktopdirfile.close();
            }
 
-           // Add this desktop file to our install script
-           IconScript << " " << "xdg-desktop-menu install " + MenuDir + "/PBI-" + ProgDirName + ".directory " \
+	  if ( ExeOwndir[exenum] == 0 ) {
+            // Add this desktop file to our install script
+            IconScript << " " << "xdg-desktop-menu install " + MenuDir + "/PBI-" + ProgDirName + ".directory " \
 			+ MenuDir + "/PBI-" + ProgDirName + "-" + Binary + ".desktop";
-           IconUnScript << " " << "xdg-desktop-menu uninstall " + MenuDir + "/PBI-" + ProgDirName + ".directory " \
+            IconUnScript << " " << "xdg-desktop-menu uninstall " + MenuDir + "/PBI-" + ProgDirName + ".directory " \
 			+ MenuDir + "/PBI-" + ProgDirName + "-" + Binary + ".desktop";
+          } else {
+            
+	    // Add this desktop file to our install script
+            IconScript << " " << "xdg-desktop-menu install " + MenuDir + "/PBI-" \
+					+ ProgDirName + "-" + Binary + ".desktop";
+            IconUnScript << " " << "xdg-desktop-menu uninstall " + MenuDir + "/PBI-" \
+					+ ProgDirName + "-" + Binary + ".desktop";
 	
-          // Create a directory in a KDE sub-menu
-          if (ExeOwndir[exenum] == 1) {	
+            // Create a directory in a KDE sub-menu
             QDir xdgdir;
             xdgdir.mkpath ( "/usr/local/etc/xdg/menus/applications-merged");
 	    tmp = "/usr/local/etc/xdg/menus/applications-merged/PBI-" + ProgDirName + ".merge.menu";
 
             // Make sure we cleanup and remove this file during uninstall
-            IconUnScript << " " << "rm " + tmp;
-
+            IconUnScript << " " << "rm " + tmp + " >/dev/null 2>/dev/null" ;
 	    QFile xdgfile( tmp );
             if ( xdgfile.open( QIODevice::WriteOnly | QIODevice::Text) ) {
               QString ParentCat, SubCat;



More information about the Commits mailing list