forceSrc = aForceSrc;
singleDir = aSingleDir;
stateChanged = true;
- binPath = QDir::currentDirPath() + "/Products/BINARIES";
- srcPath = QDir::currentDirPath() + "/Products/SOURCES";
+
+ QDir appDir( qApp->applicationDirPath() );
+ appDir.cdUp();
+ binPath = appDir.filePath( "Products/BINARIES" );
+ srcPath = appDir.filePath( "Products/SOURCES" );
oneProdDirName = "PRODUCTS";
commonPlatform = "Debian 3.1";
//
// ... get current platform
curPlatform = currentPlatform().join(" ");
-// cout << "curOS = " << curPlatform << endl;
-// curPlatform = "";
+ //cout << "curOS = " << curPlatform << endl;
+ //curPlatform = "";
refPlatform = "";
// ... check XML and platform definition
getXmlAndPlatform();
QFile file( osFileName );
if ( file.open( IO_ReadOnly ) ) {
QTextStream stream( &file );
- QString str = stream.readLine();
- file.close();
- // parse line
- QRegExp regvar = QRegExp( "(.*)\\s+[^\\s]*[R|r]elease[^\\s]*\\s+([\\d.]*)" );
- int pos = regvar.search( str );
- if ( pos == -1 ) {
- regvar = QRegExp( "(.*)\\s+[^\\s]*[L|l][I|i][N|n][U|u][X|x][^\\s]*(.*)\\s+([\\d.]*)\\s+" );
- pos = regvar.search( str );
- }
- if ( pos >= 0 ) {
- QStringList name;
- for ( int i = 1; i < regvar.numCaptures(); i++ )
- name.append( regvar.cap( i ) );
-
- // retrieve platform name
- platName = QStringList::split( " ", name.join( " " ) ).join( " " );
- platName = platName.replace( "Linux", "" ).replace( "linux", "" ).replace( "LINUX", "" ).stripWhiteSpace();
- platName = platName.replace( "Welcome to", "" ).stripWhiteSpace();
- platName = QStringList::split( " ", platName ).join( " " );
- // retrieve platform version number
- platVersion = regvar.cap( regvar.numCaptures() );
- // retrieve platform
- utsname uname_data;
- uname( &uname_data );
- if ( QString( uname_data.machine ) == "x86_64" )
- platArch = "64bit";
+ while( !stream.atEnd() ) {
+ QString str = stream.readLine().stripWhiteSpace();
+ if ( str.isEmpty() ) continue;
+ file.close();
+ // parse line
+ QRegExp regvar = QRegExp( "(.*)\\s+[^\\s]*[R|r]elease[^\\s]*\\s+([\\d.]*)" );
+ int pos = regvar.search( str );
+ if ( pos == -1 ) {
+ regvar = QRegExp( "(.*)\\s+[^\\s]*[L|l][I|i][N|n][U|u][X|x][^\\s]*(.*)\\s+([\\d.]*)\\s+" );
+ pos = regvar.search( str );
+ }
+ if ( pos >= 0 ) {
+ QStringList name;
+ for ( int i = 1; i < regvar.numCaptures(); i++ )
+ name.append( regvar.cap( i ) );
+
+ // retrieve platform name
+ platName = QStringList::split( " ", name.join( " " ) ).join( " " );
+ platName = platName.replace( "Linux", "" ).replace( "linux", "" ).replace( "LINUX", "" ).stripWhiteSpace();
+ platName = platName.replace( "Welcome to", "" ).stripWhiteSpace();
+ platName = QStringList::split( " ", platName ).join( " " );
+ // retrieve platform version number
+ platVersion = regvar.cap( regvar.numCaptures() );
+ // retrieve platform
+ utsname uname_data;
+ uname( &uname_data );
+ if ( QString( uname_data.machine ) == "x86_64" )
+ platArch = "64bit";
+ break;
+ }
}
}
}