void FileHistory::Save(wxConfigBase& config) { wxString old = config.GetPath(); config.SetPath(m_configSubdir); wxFileHistory::Save(config); config.SetPath(old); }
void FileHistory::LoadFromSubDir(wxConfigBase& config) { wxString old = config.GetPath(); config.SetPath(m_configSubdir); Load(config); config.SetPath(old); }
void wxSTEditorOptions::SaveFileConfig(wxConfigBase &config) { const wxString oldpath = config.GetPath(); wxFileHistory *fileHistory = GetFileHistory(); if (!fileHistory) return; wxString configPath = FixConfigPath(GetConfigPath(STE_OPTION_CFGPATH_FILEHISTORY), false); config.Write(configPath+wxT("/LastDir"), GetDefaultFilePath()); config.SetPath(configPath); fileHistory->Save(config); config.SetPath(oldpath); }
void wxSTEditorOptions::LoadFileConfig( wxConfigBase &config) { const wxString oldpath = config.GetPath(); wxFileHistory *fileHistory = GetFileHistory(); if (!fileHistory) return; wxString configPath = FixConfigPath(GetConfigPath(STE_OPTION_CFGPATH_FILEHISTORY), false); wxString value, key = configPath+wxT("/LastDir"); if (config.Read(key, &value) && wxDirExists(value)) SetDefaultFilePath(value); config.SetPath(configPath); fileHistory->Load(config); config.SetPath(oldpath); }