File yal-default_paths.patch of Package yal
Index: src/Settings.cpp
===================================================================
--- src/Settings.cpp.orig
+++ src/Settings.cpp
@@ -26,8 +26,13 @@ bool Settings::initialize()
{
if( ! ipLauncher6.loadIni( FILEPATHS.getGameLauncherIni() ) )
{
- qWarning( "launcher6.ini not found, select exec using browse button." );
- return false;
+ if( ! QFile::exists( FS2EXEC_PATH ) )
+ {
+ qWarning( "launcher6.ini not found, select exec using browse button." );
+ return false;
+ } else {
+ return setExeFilePath( FS2EXEC_PATH );
+ }
}
}
@@ -39,15 +44,6 @@ bool Settings::setExeFilePath( const QSt
{
QString qstrExe = QFileInfo( qstrExeFilePath ).canonicalFilePath();
- /* check if the exe is in our game dir */
- if( QFileInfo( qstrExe ).exists() && QFileInfo( qstrExe ).path() != FILEPATHS.getGameDir() )
- {
- System::warning( "The launcher must be in the same directory as the binary you are trying to use. Trying to find binary in the launcher directory instead." );
-
- /* try to find it in our current dir */
- qstrExe = FILEPATHS.getGameDir() + '/' + QFileInfo( qstrExeFilePath ).fileName();
- }
-
/*
* the following should never happen as we select file by file
* dialog, the only option is to modify launcher6.ini by hand
Index: src/unix/FilePaths_unix.cpp
===================================================================
--- src/unix/FilePaths_unix.cpp.orig
+++ src/unix/FilePaths_unix.cpp
@@ -20,28 +20,10 @@
bool FilePaths::initialize( const QString & qstrArgv0 )
{
- QFileInfo qfiPath = qstrArgv0;
-
- /* launcher was run by giving a path to the executable */
- if( qfiPath.exists() )
- m_qstrGameDir = qfiPath.canonicalPath();
-
- /* launcher was run by PATH, we need to find it to read symlink */
+ if( QFile::exists("root_fs2.vp") || QFile::exists("Root_fs2.vp"))
+ m_qstrGameDir = QDir::currentPath();
else
- {
- QString qstrPathEnv = getenv( "PATH" );
- QStringList qstrlPaths = qstrPathEnv.split( ":", QString::SkipEmptyParts );
-
- for( int i = 0; i < qstrlPaths.size(); i++ )
- {
- QString qstrPath = qstrlPaths.at( i );
- qstrPath.append( "/" ).append( qstrArgv0 );
- qfiPath = qstrPath;
-
- if( qfiPath.exists() )
- m_qstrGameDir = qfiPath.canonicalPath();
- }
- }
+ m_qstrGameDir = GAMEDIR_PATH;
qWarning( "gamedir: %s", m_qstrGameDir.toAscii().data() );