Config: Move gzip index template to base config

This commit is contained in:
Connor McLaughlin 2021-09-17 18:25:52 +10:00 committed by Kojin
parent 15365c8702
commit 307feefa87
5 changed files with 20 additions and 7 deletions

View File

@ -16,7 +16,7 @@
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#include <fstream> #include <fstream>
#include <wx/stdpaths.h> #include <wx/stdpaths.h>
#include "gui/AppConfig.h" #include "Config.h"
#include "ChunksCache.h" #include "ChunksCache.h"
#include "CompressedFileReaderUtils.h" #include "CompressedFileReaderUtils.h"
#include "GzippedFileReader.h" #include "GzippedFileReader.h"
@ -185,7 +185,7 @@ static wxString iso2indexname(const wxString& isoname)
wxDirName appRoot = // TODO: have only one of this in PCSX2. Right now have few... wxDirName appRoot = // TODO: have only one of this in PCSX2. Right now have few...
(wxDirName)(wxFileName(wxStandardPaths::Get().GetExecutablePath()).GetPath()); (wxDirName)(wxFileName(wxStandardPaths::Get().GetExecutablePath()).GetPath());
//TestTemplate(appRoot, isoname, false); //TestTemplate(appRoot, isoname, false);
return ApplyTemplate(L"gzip index", appRoot, g_Conf->GzipIsoIndexTemplate, isoname, false); return ApplyTemplate(L"gzip index", appRoot, EmuConfig.GzipIsoIndexTemplate, isoname, false);
} }
GzippedFileReader::GzippedFileReader(void) GzippedFileReader::GzippedFileReader(void)

View File

@ -567,6 +567,8 @@ struct Pcsx2Config
FolderOptions Folders; FolderOptions Folders;
FilenameOptions BaseFilenames; FilenameOptions BaseFilenames;
wxString GzipIsoIndexTemplate; // for quick-access index with gzipped ISO
// Set at runtime, not loaded from config. // Set at runtime, not loaded from config.
CDVD_SourceType CdvdSource; CDVD_SourceType CdvdSource;
wxString CurrentIso; wxString CurrentIso;

View File

@ -20,7 +20,11 @@
#include "common/IniInterface.h" #include "common/IniInterface.h"
#include "Config.h" #include "Config.h"
#include "GS.h" #include "GS.h"
#include "gui/GSFrame.h" #include "CDVD/CDVDaccess.h"
#ifndef PCSX2_CORE
#include "gui/AppConfig.h"
#endif
void TraceLogFilters::LoadSave( IniInterface& ini ) void TraceLogFilters::LoadSave( IniInterface& ini )
{ {
@ -439,7 +443,11 @@ void Pcsx2Config::FilenameOptions::LoadSave(IniInterface& ini)
//when saving in portable mode, we just save the non-full-path filename //when saving in portable mode, we just save the non-full-path filename
// --> on load they'll be initialized with default (relative) paths (works for bios) // --> on load they'll be initialized with default (relative) paths (works for bios)
//note: this will break if converting from install to portable, and custom folders are used. We can live with that. //note: this will break if converting from install to portable, and custom folders are used. We can live with that.
#ifndef PCSX2_CORE
bool needRelativeName = ini.IsSaving() && IsPortable(); bool needRelativeName = ini.IsSaving() && IsPortable();
#else
bool needRelativeName = ini.IsSaving();
#endif
if (needRelativeName) if (needRelativeName)
{ {
@ -485,6 +493,8 @@ Pcsx2Config::Pcsx2Config()
EnablePatches = true; EnablePatches = true;
BackupSavestate = true; BackupSavestate = true;
GzipIsoIndexTemplate = L"$(f).pindex.tmp";
CdvdSource = CDVD_SourceType::Iso; CdvdSource = CDVD_SourceType::Iso;
} }
@ -522,6 +532,8 @@ void Pcsx2Config::LoadSave( IniInterface& ini )
Debugger .LoadSave( ini ); Debugger .LoadSave( ini );
Trace .LoadSave( ini ); Trace .LoadSave( ini );
IniEntry(GzipIsoIndexTemplate);
// For now, this in the derived config for backwards ini compatibility. // For now, this in the derived config for backwards ini compatibility.
#ifdef PCSX2_CORE #ifdef PCSX2_CORE
BaseFilenames.LoadSave(ini); BaseFilenames.LoadSave(ini);
@ -577,6 +589,8 @@ void Pcsx2Config::CopyConfig(const Pcsx2Config& cfg)
BaseFilenames = cfg.BaseFilenames; BaseFilenames = cfg.BaseFilenames;
Framerate = cfg.Framerate; Framerate = cfg.Framerate;
GzipIsoIndexTemplate = cfg.GzipIsoIndexTemplate;
CdvdVerboseReads = cfg.CdvdVerboseReads; CdvdVerboseReads = cfg.CdvdVerboseReads;
CdvdDumpBlocks = cfg.CdvdDumpBlocks; CdvdDumpBlocks = cfg.CdvdDumpBlocks;
CdvdShareWrite = cfg.CdvdShareWrite; CdvdShareWrite = cfg.CdvdShareWrite;

View File

@ -479,8 +479,6 @@ AppConfig::AppConfig()
// Folder memory card is autodetected later. // Folder memory card is autodetected later.
Mcd[slot].Type = MemoryCardType::MemoryCard_File; Mcd[slot].Type = MemoryCardType::MemoryCard_File;
} }
GzipIsoIndexTemplate = L"$(f).pindex.tmp";
} }
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
@ -566,7 +564,7 @@ void AppConfig::LoadSaveRootItems( IniInterface& ini )
ini.EnumEntry( L"LanguageId", LanguageId, NULL, LanguageId ); ini.EnumEntry( L"LanguageId", LanguageId, NULL, LanguageId );
IniEntry( LanguageCode ); IniEntry( LanguageCode );
IniEntry( RecentIsoCount ); IniEntry( RecentIsoCount );
IniEntry( GzipIsoIndexTemplate ); ini.Entry(wxT("GzipIsoIndexTemplate"), EmuConfig.GzipIsoIndexTemplate, EmuConfig.GzipIsoIndexTemplate);
IniEntry( Listbook_ImageSize ); IniEntry( Listbook_ImageSize );
IniEntry( Toolbar_ImageSize ); IniEntry( Toolbar_ImageSize );
IniEntry( Toolbar_ShowLabels ); IniEntry( Toolbar_ShowLabels );

View File

@ -286,7 +286,6 @@ public:
// Memorycard options - first 2 are default slots, last 6 are multitap 1 and 2 // Memorycard options - first 2 are default slots, last 6 are multitap 1 and 2
// slots (3 each) // slots (3 each)
McdOptions Mcd[8]; McdOptions Mcd[8];
wxString GzipIsoIndexTemplate; // for quick-access index with gzipped ISO
ConsoleLogOptions ProgLogBox; ConsoleLogOptions ProgLogBox;
FolderOptions Folders; FolderOptions Folders;