XDG home directory support
This commit is contained in:
1 parent
da4f9bd13d
commit
0ebf1df742
18 files changed
+527
-143
No files matched your search
@@ -335,10 +335,10 @@ qboolean CL_OpenAVIForWriting( const char *fileName )
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
if( ( afd.f = FS_FOpenFileWrite( fileName ) ) <= 0 )
|
||||
if( ( afd.f = FS_FOpenFileWrite_HomeData( fileName ) ) <= 0 )
|
||||
return qfalse;
|
||||
|
||||
if( ( afd.idxF = FS_FOpenFileWrite(
|
||||
if( ( afd.idxF = FS_FOpenFileWrite_HomeData(
|
||||
va( "%s" INDEX_FILE_EXTENSION, fileName ) ) ) <= 0 )
|
||||
{
|
||||
FS_FCloseFile( afd.f );
|
||||
@@ -635,7 +635,7 @@ qboolean CL_CloseAVI( void )
|
||||
FS_FCloseFile( afd.idxF );
|
||||
|
||||
// Remove temp index file
|
||||
FS_HomeRemove( idxFileName );
|
||||
FS_Remove_HomeData( idxFileName );
|
||||
|
||||
// Write the real header
|
||||
FS_Seek( afd.f, 0, FS_SEEK_SET );
|
||||
|
||||
@@ -201,7 +201,7 @@ void Con_Dump_f (void)
|
||||
return;
|
||||
}
|
||||
|
||||
f = FS_FOpenFileWrite( filename );
|
||||
f = FS_FOpenFileWrite_HomeData( filename );
|
||||
if (!f)
|
||||
{
|
||||
Com_Printf ("ERROR: couldn't open %s.\n", filename);
|
||||
|
||||
@@ -1577,7 +1577,7 @@ void CL_SaveConsoleHistory( void )
|
||||
|
||||
consoleSaveBufferSize = strlen( consoleSaveBuffer );
|
||||
|
||||
f = FS_FOpenFileWrite( CONSOLE_HISTORY_FILE );
|
||||
f = FS_FOpenFileWrite_HomeState( CONSOLE_HISTORY_FILE );
|
||||
if( !f )
|
||||
{
|
||||
Com_Printf( "Couldn't write %s.\n", CONSOLE_HISTORY_FILE );
|
||||
|
||||
@@ -742,7 +742,7 @@ void CL_Record_f( void ) {
|
||||
#endif
|
||||
Com_sprintf(name, sizeof(name), "demos/%s.%s%d", demoName, DEMOEXT, com_protocol->integer);
|
||||
|
||||
if (!FS_FileExists(name))
|
||||
if (!FS_FileExists_HomeData(name))
|
||||
break; // file doesn't exist
|
||||
}
|
||||
}
|
||||
@@ -750,7 +750,7 @@ void CL_Record_f( void ) {
|
||||
// open the demo file
|
||||
|
||||
Com_Printf ("recording to %s.\n", name);
|
||||
clc.demofile = FS_FOpenFileWrite( name );
|
||||
clc.demofile = FS_FOpenFileWrite_HomeData( name );
|
||||
if ( !clc.demofile ) {
|
||||
Com_Printf ("ERROR: couldn't open.\n");
|
||||
return;
|
||||
@@ -903,7 +903,7 @@ void CL_DemoCompleted( void )
|
||||
else
|
||||
numFrames = clc.timeDemoFrames - 1;
|
||||
|
||||
f = FS_FOpenFileWrite( cl_timedemoLog->string );
|
||||
f = FS_FOpenFileWrite_HomeData( cl_timedemoLog->string );
|
||||
if( f )
|
||||
{
|
||||
FS_Printf( f, "# %s", buffer );
|
||||
@@ -2197,7 +2197,7 @@ static void CL_BeginHttpDownload( const char *remoteURL ) {
|
||||
CL_HTTP_BeginDownload(remoteURL);
|
||||
Q_strncpyz(clc.downloadURL, remoteURL, sizeof(clc.downloadURL));
|
||||
|
||||
clc.download = FS_BaseDir_FOpenFileWrite(clc.downloadTempName);
|
||||
clc.download = FS_BaseDir_FOpenFileWrite_HomeData(clc.downloadTempName);
|
||||
if(!clc.download) {
|
||||
Com_Error(ERR_DROP, "CL_BeginHTTPDownload: failed to open "
|
||||
"%s for writing", clc.downloadTempName);
|
||||
@@ -2233,7 +2233,7 @@ void CL_NextDownload(void)
|
||||
// A download has finished, check whether this matches a referenced checksum
|
||||
if(*clc.downloadName)
|
||||
{
|
||||
char *zippath = FS_BaseDir_BuildOSPath(Cvar_VariableString("fs_homepath"), clc.downloadName);
|
||||
char *zippath = FS_BaseDir_BuildOSPath(Cvar_VariableString("fs_homedatapath"), clc.downloadName);
|
||||
|
||||
if(!FS_CompareZipChecksum(zippath))
|
||||
Com_Error(ERR_DROP, "Incorrect checksum for file: %s", clc.downloadName);
|
||||
@@ -2977,7 +2977,7 @@ void CL_Frame ( int msec ) {
|
||||
clc.download = 0;
|
||||
}
|
||||
|
||||
FS_BaseDir_Rename(clc.downloadTempName, clc.downloadName, qfalse);
|
||||
FS_BaseDir_Rename_HomeData(clc.downloadTempName, clc.downloadName, qfalse);
|
||||
clc.downloadRestart = qtrue;
|
||||
CL_NextDownload();
|
||||
}
|
||||
@@ -3307,7 +3307,7 @@ void CL_InitRef( void ) {
|
||||
ri.FS_FreeFileList = FS_FreeFileList;
|
||||
ri.FS_ListFiles = FS_ListFiles;
|
||||
ri.FS_FileIsInPAK = FS_FileIsInPAK;
|
||||
ri.FS_FileExists = FS_FileExists;
|
||||
ri.FS_FileExists = FS_FileExists_HomeData;
|
||||
ri.Cvar_Get = Cvar_Get;
|
||||
ri.Cvar_Set = Cvar_Set;
|
||||
ri.Cvar_SetValue = Cvar_SetValue;
|
||||
@@ -3418,7 +3418,7 @@ void CL_Video_f( void )
|
||||
Com_sprintf( filename, MAX_OSPATH, "videos/video%d%d%d%d.avi",
|
||||
a, b, c, d );
|
||||
|
||||
if( !FS_FileExists( filename ) )
|
||||
if( !FS_FileExists_HomeData( filename ) )
|
||||
break; // file doesn't exist
|
||||
}
|
||||
|
||||
@@ -3471,7 +3471,7 @@ static void CL_GenerateQKey(void)
|
||||
Com_Printf( "QKEY building random string\n" );
|
||||
Com_RandomBytes( buff, sizeof(buff) );
|
||||
|
||||
f = FS_BaseDir_FOpenFileWrite( QKEY_FILE );
|
||||
f = FS_BaseDir_FOpenFileWrite_HomeState( QKEY_FILE );
|
||||
if( !f ) {
|
||||
Com_Printf( "QKEY could not open %s for write\n",
|
||||
QKEY_FILE );
|
||||
|
||||
@@ -608,7 +608,7 @@ void CL_ParseDownload ( msg_t *msg ) {
|
||||
// open the file if not opened yet
|
||||
if (!clc.download)
|
||||
{
|
||||
clc.download = FS_BaseDir_FOpenFileWrite( clc.downloadTempName );
|
||||
clc.download = FS_BaseDir_FOpenFileWrite_HomeData( clc.downloadTempName );
|
||||
|
||||
if (!clc.download) {
|
||||
Com_Printf( "Could not create %s\n", clc.downloadTempName );
|
||||
@@ -635,7 +635,7 @@ void CL_ParseDownload ( msg_t *msg ) {
|
||||
clc.download = 0;
|
||||
|
||||
// rename the file
|
||||
FS_BaseDir_Rename ( clc.downloadTempName, clc.downloadName, qfalse );
|
||||
FS_BaseDir_Rename_HomeData ( clc.downloadTempName, clc.downloadName, qfalse );
|
||||
}
|
||||
|
||||
// send intentions now
|
||||
|
||||
+1
-1
@@ -74,7 +74,7 @@ LAN_SaveServersToCache
|
||||
*/
|
||||
void LAN_SaveServersToCache( void ) {
|
||||
int size;
|
||||
fileHandle_t fileOut = FS_BaseDir_FOpenFileWrite("servercache.dat");
|
||||
fileHandle_t fileOut = FS_BaseDir_FOpenFileWrite_HomeState("servercache.dat");
|
||||
FS_Write(&cls.numglobalservers, sizeof(int), fileOut);
|
||||
FS_Write(&cls.numfavoriteservers, sizeof(int), fileOut);
|
||||
size = sizeof(cls.globalServers) + sizeof(cls.favoriteServers);
|
||||
|
||||
Reference in new issue
Block a user