diff --git a/aegisub/reporter/Makefile b/aegisub/reporter/Makefile index cc30f3f51..01f319a28 100644 --- a/aegisub/reporter/Makefile +++ b/aegisub/reporter/Makefile @@ -33,6 +33,7 @@ SRC = \ progress.cpp \ report.cpp \ upload.cpp \ + util.cpp \ view.cpp diff --git a/aegisub/reporter/aegisub.cpp b/aegisub/reporter/aegisub.cpp index 2603832f2..e1511bba1 100644 --- a/aegisub/reporter/aegisub.cpp +++ b/aegisub/reporter/aegisub.cpp @@ -19,12 +19,10 @@ /// @ingroup base #ifndef R_PRECOMP -#include -#include #endif #include "aegisub.h" - +#include "util.h" #ifdef __WINDOWS__ #include "../src/config.h" @@ -33,18 +31,8 @@ #endif Aegisub::Aegisub() { - wxStandardPathsBase &paths = wxStandardPaths::Get(); -// Using ifdefs is a pain but it's much easier to centralise this. -#if defined(__APPLE__) - std::string conf_user(wxString::Format("%s-%s/config.json", paths.GetUserDataDir(), _T(AEGISUB_VERSION_DATA))); -#elif defined(__UNIX__) - std::string conf_user(wxString::Format("%s/.aegisub-%s/config.json", paths.GetUserConfigDir(), _T(AEGISUB_VERSION_DATA))); -#else - std::string conf_user(wxString::Format("%s/Aegisub/config.json", paths.GetUserConfigDir())); -#endif - std::string default_config("{}"); - opt = new agi::Options(conf_user, default_config, agi::Options::FLUSH_SKIP); + opt = new agi::Options(config_path() + "config.json", default_config, agi::Options::FLUSH_SKIP); } diff --git a/aegisub/reporter/main.cpp b/aegisub/reporter/main.cpp index 374619d9d..b514cdd60 100644 --- a/aegisub/reporter/main.cpp +++ b/aegisub/reporter/main.cpp @@ -22,25 +22,28 @@ #include #include -#include -#include +#include #include -#include +#include +#include #include #include -#include -#include -#include #include -#include +#include #endif +#include + #include "main.h" #include "upload.h" +#include "util.h" /// @brief Init the reporter. -bool Reporter::OnInit() -{ +bool Reporter::OnInit() { + + const std::string path_log(config_path() + "log/"); + wxFileName::Mkdir(path_log, 0777, wxPATH_MKDIR_FULL); + agi::log::log = new agi::log::LogSink(path_log); // if ( !wxApp::OnInit() ) // return false;