Improved loading of config.dat

Originally committed to SVN as r1281.
This commit is contained in:
Rodrigo Braz Monteiro 2007-06-21 06:52:15 +00:00
parent 24d941b2bc
commit 2d4032d83b
3 changed files with 4 additions and 4 deletions

View File

@ -64,7 +64,7 @@ void AssStyleStorage::Load(wxString name) {
if (name.IsEmpty()) return;
Clear();
TextFileReader file(StandardPaths::DecodePath(_T("?data/catalog/")+name+_T(".sty")), _T("UTF-8"));
TextFileReader file(StandardPaths::DecodePath(_T("?user/catalog/")+name+_T(".sty")), _T("UTF-8"));
AssStyle *curStyle;
while (file.HasMoreLines()) {

View File

@ -43,6 +43,7 @@
#include <wx/mimetype.h>
#include <wx/utils.h>
#include <wx/stdpaths.h>
#include <wx/filefn.h>
#include "main.h"
#include "frame_main.h"
#include "options.h"
@ -88,10 +89,12 @@ bool AegisubApp::OnInit() {
// Set config file
Options.SetFile(StandardPaths::DecodePath(_T("?data/config.dat")));
Options.LoadDefaults();
Options.Load();
if (!Options.AsBool(_T("Local config"))) {
Options.SetFile(StandardPaths::DecodePath(_T("?user/config.dat")));
Options.Load();
wxRemoveFile(StandardPaths::DecodePath(_T("?data/config.dat")));
}
Options.Save();
AssTime::UseMSPrecision = Options.AsBool(_T("Use nonstandard Milisecond Times"));

View File

@ -392,9 +392,6 @@ void OptionsManager::Save() {
////////
// Load
void OptionsManager::Load() {
// Load defaults
LoadDefaults();
// Check if file exists
wxFileName path(filename);
if (!path.FileExists()) {