[PC-BSD Commits] r7912 - in pcbsd/current/src-qt4: pc-sounderror pc-sysmanager

svn at pcbsd.org svn at pcbsd.org
Tue Oct 26 10:05:41 PDT 2010


Author: kris
Date: 2010-10-26 10:05:41 -0700 (Tue, 26 Oct 2010)
New Revision: 7912

Modified:
   pcbsd/current/src-qt4/pc-sounderror/main.cpp
   pcbsd/current/src-qt4/pc-sysmanager/fastestcvsup.cpp
   pcbsd/current/src-qt4/pc-sysmanager/main.cpp
   pcbsd/current/src-qt4/pc-sysmanager/pbsystemtab.cpp
   pcbsd/current/src-qt4/pc-sysmanager/pbsystemtab.h
   pcbsd/current/src-qt4/pc-sysmanager/systemupdates.cpp
Log:

Updated pc-sounderror / pc-sysmanager to use PREFIX / config.h



Modified: pcbsd/current/src-qt4/pc-sounderror/main.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-sounderror/main.cpp	2010-10-26 16:50:43 UTC (rev 7911)
+++ pcbsd/current/src-qt4/pc-sounderror/main.cpp	2010-10-26 17:05:41 UTC (rev 7912)
@@ -4,6 +4,7 @@
 #include <qlocale.h>
 #include "snddialog.h"
 #include "ui_snddialog.h"
+#include "../config.h"
 
 int main( int argc, char ** argv )
 {
@@ -12,9 +13,9 @@
     QTranslator translator;
     QLocale mylocale;
     QString langCode = mylocale.name();
-    if ( ! QFile::exists("/usr/local/share/pcbsd/i18n/SoundError_" + langCode + ".qm" ) )
+    if ( ! QFile::exists( PREFIX + "/share/pcbsd/i18n/SoundError_" + langCode + ".qm" ) )
       langCode.truncate(langCode.indexOf("_"));
-    translator.load( QString("SoundError_") + langCode, "/usr/local/share/pcbsd/i18n/" );
+    translator.load( QString("SoundError_") + langCode, PREFIX + "/share/pcbsd/i18n/" );
     a.installTranslator( &translator );
     qDebug() << "Locale:" << langCode;
 

Modified: pcbsd/current/src-qt4/pc-sysmanager/fastestcvsup.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-sysmanager/fastestcvsup.cpp	2010-10-26 16:50:43 UTC (rev 7911)
+++ pcbsd/current/src-qt4/pc-sysmanager/fastestcvsup.cpp	2010-10-26 17:05:41 UTC (rev 7912)
@@ -13,6 +13,7 @@
 #include <qtextstream.h>
 #include <qlistwidget.h>
 #include <QDebug>
+#include "../config.h"
 
 void FastestCvsup::init()
 {  
@@ -21,7 +22,7 @@
 
     QStringList servers;
     serverMap = QMap<QString, QString>();
-    QFile file("/usr/local/share/apps/pcbsd/scripts/fastest_cvsup");
+    QFile file( PREFIX + "/share/apps/pcbsd/scripts/fastest_cvsup");
     if (file.open(QIODevice::ReadOnly))
     {
 	QTextStream stream(&file);
@@ -54,7 +55,7 @@
 {
     mainWidget->setCurrentIndex(1);
     
-    QString prog = "/usr/local/share/apps/pcbsd/scripts/fastest_cvsup";
+    QString prog = PREFIX + "/share/apps/pcbsd/scripts/fastest_cvsup";
     QStringList args;
 
     args << "-m";

Modified: pcbsd/current/src-qt4/pc-sysmanager/main.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-sysmanager/main.cpp	2010-10-26 16:50:43 UTC (rev 7911)
+++ pcbsd/current/src-qt4/pc-sysmanager/main.cpp	2010-10-26 17:05:41 UTC (rev 7912)
@@ -5,6 +5,7 @@
 #include <qdesktopwidget.h>
 #include <QDebug>
 #include "pbsystemtab.h"
+#include "../config.h"
 
 int main( int argc, char ** argv )
 {
@@ -13,9 +14,9 @@
    QTranslator translator;
    QLocale mylocale;
    QString langCode = mylocale.name();
-   if ( ! QFile::exists("/usr/local/share/pcbsd/i18n/PBSystem_" + langCode + ".qm" ) )
+   if ( ! QFile::exists( PREFIX + "/share/pcbsd/i18n/PBSystem_" + langCode + ".qm" ) )
      langCode.truncate(langCode.indexOf("_"));
-   translator.load( QString("PBSystem_") + langCode, "/usr/local/share/pcbsd/i18n/" );
+   translator.load( QString("PBSystem_") + langCode, PREFIX + "/share/pcbsd/i18n/" );
    a.installTranslator( &translator );
    qDebug() << "Locale:" << langCode;
 

Modified: pcbsd/current/src-qt4/pc-sysmanager/pbsystemtab.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-sysmanager/pbsystemtab.cpp	2010-10-26 16:50:43 UTC (rev 7911)
+++ pcbsd/current/src-qt4/pc-sysmanager/pbsystemtab.cpp	2010-10-26 17:05:41 UTC (rev 7912)
@@ -18,6 +18,7 @@
 #include <QNetworkReply>
 #include <QProgressDialog>
 #include <QDebug>
+#include "../config.h"
 
 #include "pbsystemtab.h"
 
@@ -182,7 +183,7 @@
 {
     
     	SheetGenScript = new QProcess( this );
-	QString prog = "/usr/local/share/apps/pcbsd/scripts/GenDiagSheet.sh";
+	QString prog = PREFIX + "/share/apps/pcbsd/scripts/GenDiagSheet.sh";
 	QStringList args;
 	args << SheetFileName;
 	connect( SheetGenScript, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(finishedSheet()) );
@@ -401,7 +402,7 @@
     settings.setValue("/PCBSD/splash-screen", code);
     
     //Move files about
-    system("cp /usr/local/share/pcbsd/splash-screens/loading-screen-" + code.toAscii() + ".pcx /boot/loading-screen.pcx");
+    system("cp " + PREFIX.toAscii() + "/share/pcbsd/splash-screens/loading-screen-" + code.toAscii() + ".pcx /boot/loading-screen.pcx");
     system("chmod 644 /boot/loading-screen.pcx");
     
     if ( showBootCheck->isChecked() )
@@ -436,10 +437,10 @@
 void PBSystemTab::loadBootData()
 {
     //Trawl screens directory
-    QDir screens = QDir("/usr/local/share/pcbsd/splash-screens/");
+    QDir screens = QDir(PREFIX + "/share/pcbsd/splash-screens/");
     if (! screens.exists())
     {
-	qWarning("/usr/local/share/pcbsd/splash-screens doesn't exist!");
+        QMessageBox::critical( 0, tr("Refresh Mirrors"), PREFIX + "/share/pcbsd/splash-screens/ " + tr("doesn't exist!"), QMessageBox::Ok );
 	return;
     }
     screens.setFilter(QDir::Files);
@@ -986,7 +987,7 @@
 // Function which starts script to locate installation media
 QString PBSystemTab::findLocalInstallMedia()
 {
-	return getLineFromCommandOutput("/usr/local/share/pcbsd/scripts/find-install-media.sh").simplified();
+	return getLineFromCommandOutput(PREFIX + "/share/pcbsd/scripts/find-install-media.sh").simplified();
 }
 
 bool PBSystemTab::haveAMetaDesktop()

Modified: pcbsd/current/src-qt4/pc-sysmanager/pbsystemtab.h
===================================================================
--- pcbsd/current/src-qt4/pc-sysmanager/pbsystemtab.h	2010-10-26 16:50:43 UTC (rev 7911)
+++ pcbsd/current/src-qt4/pc-sysmanager/pbsystemtab.h	2010-10-26 17:05:41 UTC (rev 7912)
@@ -17,9 +17,10 @@
 #include "ui_pbsystemtab.h"
 #include "portsnapprogress.h"
 #include "cvsupprogress.h"
+#include "../config.h"
 
 /* Change this to switch the default patch tmpdir */
-#define PATCHTMPDIR_DEFAULT "/usr/local/tmp"
+const QString PATCHTMPDIR_DEFAULT( PREFIX + "/tmp" );
 #define SYSTRIGGER "/tmp/.sysupdatetraytrigger"
 
 /* The Update STATUS Flags */

Modified: pcbsd/current/src-qt4/pc-sysmanager/systemupdates.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-sysmanager/systemupdates.cpp	2010-10-26 16:50:43 UTC (rev 7911)
+++ pcbsd/current/src-qt4/pc-sysmanager/systemupdates.cpp	2010-10-26 17:05:41 UTC (rev 7912)
@@ -6,6 +6,7 @@
 #include <QSettings>
 #include <QDateTime>
 #include <QDebug>
+#include "../config.h"
 
 
 /***********************************************************************************/
@@ -232,7 +233,7 @@
   // Run our KIO Job to fetch the system-update patch data for this version of PC-BSD
 
   // First, get some variables to figure out the full patch URL
-  QFile file( "/usr/local/share/pcbsd/pc-sysmanager/conf/sysupdate.conf" );
+  QFile file( PREFIX + "/share/pcbsd/pc-sysmanager/conf/sysupdate.conf" );
   if ( file.open( QIODevice::ReadOnly ) ) {
       QTextStream stream( &file );
       while ( !stream.atEnd() ) {
@@ -293,7 +294,7 @@
    // Now traverse the directory, see if we have updates.
   QString prog = "sh";
   QStringList args;
-  args << "/usr/local/share/pcbsd/pc-sysmanager/bin/readSysUpdates.sh" << Version;
+  args << PREFIX + "/share/pcbsd/pc-sysmanager/bin/readSysUpdates.sh" << Version;
 
   // Check to see if the update download was successful and warn if not
   if ( sysFetchReply->error() != QNetworkReply::NoError )



More information about the Commits mailing list