Add config entry "allowSymlinks"
This commit is contained in:
		
							parent
							
								
									dcdfea55f1
								
							
						
					
					
						commit
						10b3e04dee
					
				
					 6 changed files with 13 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -39,7 +39,8 @@ Config::Config()
 | 
			
		|||
      defScreenH(480),
 | 
			
		||||
      fixedFramerate(0),
 | 
			
		||||
      solidFonts(false),
 | 
			
		||||
      gameFolder(".")
 | 
			
		||||
      gameFolder("."),
 | 
			
		||||
      allowSymlinks(false)
 | 
			
		||||
{}
 | 
			
		||||
 | 
			
		||||
void Config::read()
 | 
			
		||||
| 
						 | 
				
			
			@ -59,6 +60,7 @@ void Config::read()
 | 
			
		|||
	READ_VAL(fixedFramerate, Int);
 | 
			
		||||
	READ_VAL(solidFonts,  Bool);
 | 
			
		||||
	READ_VAL(gameFolder, ByteArray);
 | 
			
		||||
	READ_VAL(allowSymlinks, Bool);
 | 
			
		||||
	READ_VAL(customScript, ByteArray);
 | 
			
		||||
 | 
			
		||||
	QStringList _rtps = confFile.value("RTPs").toStringList();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -45,6 +45,7 @@ struct Config
 | 
			
		|||
	bool solidFonts;
 | 
			
		||||
 | 
			
		||||
	QByteArray gameFolder;
 | 
			
		||||
	bool allowSymlinks;
 | 
			
		||||
 | 
			
		||||
	QByteArray customScript;
 | 
			
		||||
	QVector<QByteArray> rtps;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -679,12 +679,16 @@ struct FileSystemPrivate
 | 
			
		|||
	}
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
FileSystem::FileSystem(const char *argv0)
 | 
			
		||||
FileSystem::FileSystem(const char *argv0,
 | 
			
		||||
                       bool allowSymlinks)
 | 
			
		||||
{
 | 
			
		||||
	p = new FileSystemPrivate;
 | 
			
		||||
 | 
			
		||||
	PHYSFS_init(argv0);
 | 
			
		||||
	PHYSFS_registerArchiver(&RGSS_Archiver);
 | 
			
		||||
 | 
			
		||||
	if (allowSymlinks)
 | 
			
		||||
		PHYSFS_permitSymbolicLinks(1);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
FileSystem::~FileSystem()
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -54,7 +54,8 @@ struct FileSystemPrivate;
 | 
			
		|||
class FileSystem
 | 
			
		||||
{
 | 
			
		||||
public:
 | 
			
		||||
	FileSystem(const char *argv0);
 | 
			
		||||
	FileSystem(const char *argv0,
 | 
			
		||||
	           bool allowSymlinks);
 | 
			
		||||
	~FileSystem();
 | 
			
		||||
 | 
			
		||||
	void addPath(const char *path);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -99,7 +99,7 @@ struct SharedStatePrivate
 | 
			
		|||
	SharedStatePrivate(RGSSThreadData *threadData)
 | 
			
		||||
	    : bindingData(0),
 | 
			
		||||
	      sdlWindow(threadData->window),
 | 
			
		||||
	      fileSystem(threadData->argv0),
 | 
			
		||||
	      fileSystem(threadData->argv0, threadData->config.allowSymlinks),
 | 
			
		||||
	      eThread(*threadData->ethread),
 | 
			
		||||
	      rtData(*threadData),
 | 
			
		||||
	      config(threadData->config),
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue