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

svn at pcbsd.org svn at pcbsd.org
Thu Jan 29 10:37:30 PST 2009


Author: kris
Date: 2009-01-29 10:37:29 -0800 (Thu, 29 Jan 2009)
New Revision: 3361

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

Updated PBI installer, to set XDG_DATA_DIRS, and update LD_LIBRARY_PATH better, removed old GTK massage, not used anymore

This improves icons showing up properly in apps which include share/icons within them



Modified: pbibuild/pbi-source/PBIsource/pbi.cpp
===================================================================
--- pbibuild/pbi-source/PBIsource/pbi.cpp	2009-01-28 21:11:01 UTC (rev 3360)
+++ pbibuild/pbi-source/PBIsource/pbi.cpp	2009-01-29 18:37:29 UTC (rev 3361)
@@ -55,8 +55,6 @@
    gridLayout6->setMargin(0);
    gridLayout6->setSpacing(2);
   
-    GTKFound=0;
-    
     ProgramDir = ProgDir;
     OverWrote = 0;
      
@@ -415,15 +413,6 @@
     QString pathLoc="";
    
     
-    QFile GTKCheck("/Programs/" + ProgDirName + "/autolibs/pangorc");
-    if (GTKCheck.exists() )
-    {
-         GTKFound = 1;
-         MassageGTKFiles();
-    }
-    
-    
-    
     if ( OverWrote == 1)
     {
 	
@@ -572,21 +561,15 @@
              stream2 << "# Auto-Generated by PC-BSD\n";
              stream2 << "PATH=\"/Programs/" + ProgDirName + "/bin:$PATH\"; export PATH\n";     
              stream2 << "LANG=\"`grep ^Language= ~/.kde/share/config/kdeglobals | cut -d \"=\" -f2`\"; export LANG\n";     
+             stream2 << "XDG_DATA_DIRS=\"/Programs/" + ProgDirName + "/share:/Programs/" + ProgDirName + "/kde4/share:${XDG_DATA_DIRS}\"; export XDG_DATA_DIRS\n";     
 
              if ( LibDir == "Auto")
-	{
-	     stream2 << "LD_LIBRARY_PATH=\"/Programs/" + ProgDirName + "/autolibs/\" ; export LD_LIBRARY_PATH\n";
-	} else if ( LibDir != "NONE" ) {
+	     {
+                   stream2 << "LD_LIBRARY_PATH=\"/Programs/" + ProgDirName + "/autolibs/:/Programs/" + ProgDirName + "/lib:/Programs/" + ProgDirName + "/kde4/lib\" ; export LD_LIBRARY_PATH\n";
+	      } else if ( LibDir != "NONE" ) {
                    stream2 << "LD_LIBRARY_PATH=\"/Programs/" + ProgDirName + "/" + LibDir + "/\" ; export LD_LIBRARY_PATH\n"; 
               }
 	
-	if ( GTKFound == 1 )
-	{
-	    stream2 << "\nGDK_PIXBUF_MODULE_FILE=\"/Programs/" + ProgDirName + "/autolibs/etc/gtk-dir/gdk-pixbuf.loaders\" ; export GDK_PIXBUF_MODULE_FILE\n";
-	    stream2 << "PANGO_RC_FILE=\"/Programs/" + ProgDirName + "/autolibs/pangorc\"; export PANGO_RC_FILE\n\n";
-	}
-	
-	     
 	 if ( RunShell[i] == "1" )
 	{
 	stream2 << "/Programs/" + ProgDirName + "/" + ExePath[i] + "  \"$@\"";	 
@@ -1708,103 +1691,7 @@
 }
 
 
-void PBI::MassageGTKFiles()
-{
-    
-    QString EditFile;
-    QString tmp;
-        QString line;
-	
-    // Create the pangorc file
-    QFile GTKCheck("/Programs/" + ProgDirName + "/autolibs/pangorc");
-    if ( GTKCheck.open( IO_WriteOnly) ) {
-                QTextStream stream( &GTKCheck );
-	     stream << "[Pango]\n";
-	     stream << "ModuleFiles=/Programs/" + ProgDirName + "/autolibs/etc/pango-dir/pango.modules\n";
-	     stream << "[PangoX]\n";
-	     stream << "AliasFiles=/Programs/" +ProgDirName + "/autolibs/etc/pango-dir/pangox.aliases";
-    
-	 }
-    
-    // Edit the GTK etc files
-    QFile file( "/Programs/" + ProgDirName + "/autolibs/etc/gtk-dir/gdk-pixbuf.loaders" );
-    if ( file.open( IO_ReadOnly ) ) {
-        QTextStream stream( &file );
 
-        while ( !stream.atEnd() ) {
-            line = stream.readLine(); // line of text excluding '\n'
-	    if ( line.indexOf("\"/usr/X11R6/lib/gtk" ) == 0)
-	    {
-		tmp = line.replace("\"/usr/X11R6/lib/", "");
-		//tmp.remove(0, tmp.indexOf("/") + 1 );
-		tmp = "\"/Programs/" + ProgDirName + "/autolibs/" + tmp;
-		EditFile = EditFile + tmp + "\n";
-            } else if ( line.indexOf("\"/usr/local/lib/gtk" ) == 0)
-            {
-                tmp = line.replace("\"/usr/local/lib/", "");
-                //tmp.remove(0, tmp.indexOf("/") + 1 );
-                tmp = "\"/Programs/" + ProgDirName + "/autolibs/" + tmp;
-		EditFile = EditFile + tmp + "\n";
-	    } else {
-		EditFile = EditFile + line + "\n";
-	    }
-	}
-	
-    }
-    
-    file.close();
-    
-   QFile GTKWrite("/Programs/" + ProgDirName + "/autolibs/etc/gtk-dir/gdk-pixbuf.loaders");
-    if ( GTKWrite.open( IO_WriteOnly) ) {
-                QTextStream streamGTK( &GTKWrite );
-	     streamGTK << EditFile;
-    }
-    GTKWrite.close();
-    EditFile = "";
-    
-        // Edit the GTK etc files
-    QFile Pangofile( "/Programs/" + ProgDirName + "/autolibs/etc/pango-dir/pango.modules" );
-    if ( Pangofile.open( IO_ReadOnly ) ) {
-        QTextStream stream2( &Pangofile );
-
-        while ( !stream2.atEnd() ) {
-            line = stream2.readLine(); // line of text excluding '\n'
-	    if ( line.indexOf("/usr/X11R6/lib/pango" ) == 0)
-	    {
-		tmp = line.replace("/usr/X11R6/lib/", "");
-		//tmp.remove(0, tmp.indexOf("/") + 1 );
-		tmp = "/Programs/" + ProgDirName + "/autolibs/" + tmp;
-		EditFile = EditFile + tmp + "\n";
-            } else if ( line.indexOf("/usr/local/lib/pango" ) == 0)
-            {
-                tmp = line.replace("/usr/local/lib/", "");
-                //tmp.remove(0, tmp.indexOf("/") + 1 );
-                tmp = "/Programs/" + ProgDirName + "/autolibs/" + tmp;
-                EditFile = EditFile + tmp + "\n";
-	    } else {
-		EditFile = EditFile + line + "\n";
-	    }
-	}
-	
-    }
-    
-    Pangofile.close();
-    
-   QFile PangoWrite("/Programs/" + ProgDirName + "/autolibs/etc/pango-dir/pango.modules");
-    if ( PangoWrite.open( IO_WriteOnly) ) {
-                QTextStream streamPango( &PangoWrite );
-	     streamPango << EditFile;
-    }
-    
-    PangoWrite.close();
-    
-    EditFile = "";
-    
-}
-
-
-
-
 void PBI::layOutTitleRow( QHBoxLayout * layout, const QString & title )
 {
     

Modified: pbibuild/pbi-source/PBIsource/pbi.h
===================================================================
--- pbibuild/pbi-source/PBIsource/pbi.h	2009-01-28 21:11:01 UTC (rev 3360)
+++ pbibuild/pbi-source/PBIsource/pbi.h	2009-01-29 18:37:29 UTC (rev 3361)
@@ -45,7 +45,6 @@
     void startInstallFirstRunCheck();
     void readyReadScriptOutput();
     void readyReadScriptOutput2();
-    void MassageGTKFiles();
     void layOutTitleRow( QHBoxLayout * layout, const QString &title );
     void reject();
     void extractOnlyFinished();

Modified: pbibuild/pbi-source/PBItext/main.cpp
===================================================================
--- pbibuild/pbi-source/PBItext/main.cpp	2009-01-28 21:11:01 UTC (rev 3360)
+++ pbibuild/pbi-source/PBItext/main.cpp	2009-01-29 18:37:29 UTC (rev 3361)
@@ -22,7 +22,6 @@
 void CheckScriptSlot(void);
 void CreateMimeSlot( int MimeNum );
 void acceptLicense(void);
-void MassageGTKFiles(void);
 void slotSetupCustomRemoveScript();
 void runKmenuRegen();
 
@@ -56,7 +55,6 @@
 QString ExeKdeCat[100];
 QString ExeTaskbar[100];
 QString ProgUpdateURL;
-int GTKFound = 0;
 int acceptlic = 0;
 int createdMimeFiles = 0;
 
@@ -404,15 +402,7 @@
 {
     
     
-    QFile GTKCheck("/Programs/" + ProgDirName + "/autolibs/pangorc");
-    if (GTKCheck.exists() )
-    {
-         GTKFound = 1;
-         MassageGTKFiles();
-    }
     
-    
-    
     if ( OverWrote == 1)
     {
 	
@@ -536,20 +526,16 @@
              stream2 << "# Auto-Generated by PC-BSD\n";
              stream2 << "PATH=\"/Programs/" + ProgDirName + "/bin:$PATH\"; export PATH\n";     
 	     stream2 << "LANG=\"`grep ^Language= ~/.kde/share/config/kdeglobals | cut -d \"=\" -f2`\"; export LANG\n";
+             stream2 << "XDG_DATA_DIRS=\"/Programs/" + ProgDirName + "/share:/Programs/" + ProgDirName + "/kde4/share:${XDG_DATA_DIRS}\"; export XDG_DATA_DIRS\n";
 
+
              if ( LibDir == "Auto")
-	{
-	     stream2 << "LD_LIBRARY_PATH=\"/Programs/" + ProgDirName + "/autolibs/\" ; export LD_LIBRARY_PATH\n";
-	} else if ( LibDir != "NONE" ) {
+	     {
+	           stream2 << "LD_LIBRARY_PATH=\"/Programs/" + ProgDirName + "/autolibs/:/Programs/" + ProgDirName + "/lib:/Programs/" + ProgDirName + "/kde4/lib\" ; export LD_LIBRARY_PATH\n";
+	      } else if ( LibDir != "NONE" ) {
                    stream2 << "LD_LIBRARY_PATH=\"/Programs/" + ProgDirName + "/" + LibDir + "/\" ; export LD_LIBRARY_PATH\n"; 
               }
 	
-	if ( GTKFound == 1 )
-	{
-	    stream2 << "\nGDK_PIXBUF_MODULE_FILE=\"/Programs/" + ProgDirName + "/autolibs/etc/gtk-dir/gdk-pixbuf.loaders\" ; export GDK_PIXBUF_MODULE_FILE\n";
-	    stream2 << "PANGO_RC_FILE=\"/Programs/" + ProgDirName + "/autolibs/pangorc\"; export PANGO_RC_FILE\n\n";
-	}
-	
 	     
 	 if ( RunShell[i] == "1" )
 	{
@@ -1324,97 +1310,3 @@
 
 }
 
-
-void MassageGTKFiles()
-{
-    
-    QString EditFile;
-    QString tmp;
-    QString line;
-	
-    // Create the pangorc file
-    QFile GTKCheck("/Programs/" + ProgDirName + "/autolibs/pangorc");
-    if ( GTKCheck.open(  QIODevice::WriteOnly) ) {
-                QTextStream stream( &GTKCheck );
-	     stream << "[Pango]\n";
-	     stream << "ModuleFiles=/Programs/" + ProgDirName + "/autolibs/etc/pango-dir/pango.modules\n";
-	     stream << "[PangoX]\n";
-	     stream << "AliasFiles=/Programs/" +ProgDirName + "/autolibs/etc/pango-dir/pangox.aliases";
-    
-	 }
-    
-    // Edit the GTK etc files
-    QFile file( "/Programs/" + ProgDirName + "/autolibs/etc/gtk-dir/gdk-pixbuf.loaders" );
-    if ( file.open(  QIODevice::ReadOnly ) ) {
-        QTextStream stream( &file );
-
-        while ( !stream.atEnd() ) {
-            line = stream.readLine(); // line of text excluding '\n'
-	    if ( line.indexOf("\"/usr/X11R6/lib/gtk" ) == 0)
-	    {
-		tmp = line.replace("\"/usr/X11R6/lib/", "");
-		//tmp.remove(0, tmp.indexOf("/") + 1 );
-		tmp = "\"/Programs/" + ProgDirName + "/autolibs/" + tmp;
-		EditFile = EditFile + tmp + "\n";
-            } else if ( line.indexOf("\"/usr/local/lib/gtk" ) == 0)
-            {
-                tmp = line.replace("\"/usr/local/lib/", "");
-                //tmp.remove(0, tmp.indexOf("/") + 1 );
-                tmp = "\"/Programs/" + ProgDirName + "/autolibs/" + tmp;
-                EditFile = EditFile + tmp + "\n";
-	    } else {
-		EditFile = EditFile + line + "\n";
-	    }
-	}
-	
-    }
-    
-    file.close();
-    
-   QFile GTKWrite("/Programs/" + ProgDirName + "/autolibs/etc/gtk-dir/gdk-pixbuf.loaders");
-    if ( GTKWrite.open(  QIODevice::WriteOnly) ) {
-                QTextStream streamGTK( &GTKWrite );
-	     streamGTK << EditFile;
-    }
-    GTKWrite.close();
-    EditFile = "";
-    
-        // Edit the GTK etc files
-    QFile Pangofile( "/Programs/" + ProgDirName + "/autolibs/etc/pango-dir/pango.modules" );
-    if ( Pangofile.open(  QIODevice::ReadOnly ) ) {
-        QTextStream stream2( &Pangofile );
-
-        while ( !stream2.atEnd() ) {
-            line = stream2.readLine(); // line of text excluding '\n'
-	    if ( line.indexOf("/usr/X11R6/lib/pango" ) == 0)
-	    {
-		tmp = line.replace("/usr/X11R6/lib/", "");
-		//tmp.remove(0, tmp.indexOf("/") + 1 );
-		tmp = "/Programs/" + ProgDirName + "/autolibs/" + tmp;
-		EditFile = EditFile + tmp + "\n";
-            } else if ( line.indexOf("/usr/local/lib/pango" ) == 0)
-            {
-                tmp = line.replace("/usr/local/lib/", "");
-                //tmp.remove(0, tmp.indexOf("/") + 1 );
-                tmp = "/Programs/" + ProgDirName + "/autolibs/" + tmp;
-                EditFile = EditFile + tmp + "\n";
-	    } else {
-		EditFile = EditFile + line + "\n";
-	    }
-	}
-	
-    }
-    
-    Pangofile.close();
-    
-   QFile PangoWrite("/Programs/" + ProgDirName + "/autolibs/etc/pango-dir/pango.modules");
-    if ( PangoWrite.open(  QIODevice::WriteOnly) ) {
-                QTextStream streamPango( &PangoWrite );
-	     streamPango << EditFile;
-    }
-    
-    PangoWrite.close();
-    
-    EditFile = "";
-    
-}



More information about the Commits mailing list