forked from mia/Aegisub
Improved loading of config.dat
Originally committed to SVN as r1281.
This commit is contained in:
parent
24d941b2bc
commit
2d4032d83b
3 changed files with 4 additions and 4 deletions
|
@ -64,7 +64,7 @@ void AssStyleStorage::Load(wxString name) {
|
||||||
if (name.IsEmpty()) return;
|
if (name.IsEmpty()) return;
|
||||||
Clear();
|
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;
|
AssStyle *curStyle;
|
||||||
while (file.HasMoreLines()) {
|
while (file.HasMoreLines()) {
|
||||||
|
|
|
@ -43,6 +43,7 @@
|
||||||
#include <wx/mimetype.h>
|
#include <wx/mimetype.h>
|
||||||
#include <wx/utils.h>
|
#include <wx/utils.h>
|
||||||
#include <wx/stdpaths.h>
|
#include <wx/stdpaths.h>
|
||||||
|
#include <wx/filefn.h>
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "frame_main.h"
|
#include "frame_main.h"
|
||||||
#include "options.h"
|
#include "options.h"
|
||||||
|
@ -88,10 +89,12 @@ bool AegisubApp::OnInit() {
|
||||||
|
|
||||||
// Set config file
|
// Set config file
|
||||||
Options.SetFile(StandardPaths::DecodePath(_T("?data/config.dat")));
|
Options.SetFile(StandardPaths::DecodePath(_T("?data/config.dat")));
|
||||||
|
Options.LoadDefaults();
|
||||||
Options.Load();
|
Options.Load();
|
||||||
if (!Options.AsBool(_T("Local config"))) {
|
if (!Options.AsBool(_T("Local config"))) {
|
||||||
Options.SetFile(StandardPaths::DecodePath(_T("?user/config.dat")));
|
Options.SetFile(StandardPaths::DecodePath(_T("?user/config.dat")));
|
||||||
Options.Load();
|
Options.Load();
|
||||||
|
wxRemoveFile(StandardPaths::DecodePath(_T("?data/config.dat")));
|
||||||
}
|
}
|
||||||
Options.Save();
|
Options.Save();
|
||||||
AssTime::UseMSPrecision = Options.AsBool(_T("Use nonstandard Milisecond Times"));
|
AssTime::UseMSPrecision = Options.AsBool(_T("Use nonstandard Milisecond Times"));
|
||||||
|
|
|
@ -392,9 +392,6 @@ void OptionsManager::Save() {
|
||||||
////////
|
////////
|
||||||
// Load
|
// Load
|
||||||
void OptionsManager::Load() {
|
void OptionsManager::Load() {
|
||||||
// Load defaults
|
|
||||||
LoadDefaults();
|
|
||||||
|
|
||||||
// Check if file exists
|
// Check if file exists
|
||||||
wxFileName path(filename);
|
wxFileName path(filename);
|
||||||
if (!path.FileExists()) {
|
if (!path.FileExists()) {
|
||||||
|
|
Loading…
Reference in a new issue