// ================================================================
HelpWindow::HelpWindow( SALOME_InstallWizard* wizard ) : QMainWindow( 0, "SalomeProHelpWindow", WDestructiveClose )
{
- QString hlpFile = QDir::currentDirPath() + "/doc/readme.html";
+ QString hlpFile = QDir( SALOME_InstallWizard::rootDirPath() ).filePath( "doc/readme.html" );
QString hlpDir = ".";
// caption
setCaption( wizard->getCaption() + " " + wizard->getIWName() + " " + tr( "Help" ) );
// ================================================================
HelpWindow* HelpWindow::openHelp( SALOME_InstallWizard* wizard )
{
- if ( QFile::exists( QDir::currentDirPath() + "/doc/readme.html" ) )
+ if ( QFile::exists( QDir( SALOME_InstallWizard::rootDirPath() ).filePath( "doc/readme.html" ) ) )
return new HelpWindow( wizard );
else
return 0;
singleDir = aSingleDir;
stateChanged = true;
- QDir appDir( qApp->applicationDirPath() );
- appDir.cdUp();
- binPath = appDir.filePath( "Products/BINARIES" );
- srcPath = appDir.filePath( "Products/SOURCES" );
+ QDir rootDir( rootDirPath() );
+ binPath = rootDir.filePath( "Products/BINARIES" );
+ srcPath = rootDir.filePath( "Products/SOURCES" );
oneProdDirName = "PRODUCTS";
commonPlatform = "Debian 3.1";
if ( !platArch.isEmpty() ) vals.append( platArch );
return vals;
}
+
+// ================================================================
+/*!
+ * SALOME_InstallWizard::rootDirPath
+ * Get application root dir
+ */
+// ================================================================
+QString SALOME_InstallWizard::rootDirPath()
+{
+ static QString rootDir;
+ if ( rootDir.isEmpty() ) {
+ QDir appDir( qApp->applicationDirPath() );
+ appDir.cdUp();
+ rootDir = appDir.absPath();
+ }
+ return rootDir;
+}
+
// ================================================================
/*!
* SALOME_InstallWizard::getPlatformBinPath
if ( !aXmlFileName.isEmpty() )
xmlList.append( aXmlFileName );
else {
- QDir dir( QDir::currentDirPath() );
+ QDir dir( rootDirPath() );
xmlList = dir.entryList( "*.xml", QDir::Files | QDir::Readable );
}
if ( xmlList.remove( "config.xml" ) )
pageLayout->addLayout( hLayout );
// loading README file
- QString readmeFile = QDir::currentDirPath() + "/README";
+ QString readmeFile = QDir( rootDirPath() ).filePath( "README" );
QString text;
if ( readFile( readmeFile, text ) )
readme->setText( text );
if ( notInstall.contains( prodProc ) || prodProc == "gcc" ) {
shellProcess->addArgument( "try_preinstalled" );
shellProcess->addArgument( QFileInfo( tmpFolder ).absFilePath() );
- shellProcess->addArgument( QDir::currentDirPath() + "/Products" );
+ shellProcess->addArgument( QDir( rootDirPath() ).filePath( "Products" ) );
statusLab->setText( tr( "Collecting environment for '" ) + prodProc + "'..." );
}
// ... binaries ?
script += item->text(2) + " ";
script += "pickup_env ";
script += QUOTE( QFileInfo( QDir::cleanDirPath( tempFolder->text().stripWhiteSpace() ) + TEMPDIRNAME ).absFilePath() ) + " ";
- script += QUOTE( QFileInfo( QDir::cleanDirPath( QDir::currentDirPath() + "/Products" ) ).absFilePath() ) + " ";
+ script += QUOTE( QFileInfo( QDir::cleanDirPath( QDir( rootDirPath() ).filePath( "Products" ) ) ).absFilePath() ) + " ";
script += QUOTE( QFileInfo( QDir::cleanDirPath( targetFolder->text().stripWhiteSpace() ) ).absFilePath() ) + " ";
script += depproducts + " ";
script += item->text(0) + " ";