Instantiate agi::Path, I have no idea if this works on windows since my build is still broken and jfs' code is untested. If someone else doesn't get to it I'll see about fixing my build and making it work. (if it's even broken...)
Originally committed to SVN as r5323.
This commit is contained in:
parent
355ad91105
commit
436ea23e4c
2 changed files with 14 additions and 0 deletions
|
@ -89,6 +89,7 @@
|
|||
namespace config {
|
||||
agi::Options *opt;
|
||||
agi::MRUManager *mru;
|
||||
agi::Path *path;
|
||||
}
|
||||
|
||||
|
||||
|
@ -181,6 +182,10 @@ bool AegisubApp::OnInit() {
|
|||
emit_stdout->Enable();
|
||||
#endif
|
||||
|
||||
std::string path(agi::Path::Config());
|
||||
config::path = new agi::Path(path.append("path.json"), GET_DEFAULT_CONFIG(default_path));
|
||||
|
||||
|
||||
// Init command manager
|
||||
cmd::cm = new cmd::CommandManager();
|
||||
|
||||
|
@ -335,6 +340,7 @@ int AegisubApp::OnExit() {
|
|||
delete config::opt;
|
||||
delete config::mru;
|
||||
delete agi::hotkey::hotkey;
|
||||
delete config::path;
|
||||
|
||||
#ifdef WITH_AUTOMATION
|
||||
delete global_scripts;
|
||||
|
|
|
@ -46,6 +46,7 @@
|
|||
#include "aegisublocale.h"
|
||||
#include <libaegisub/mru.h>
|
||||
#include <libaegisub/option.h>
|
||||
#include <libaegisub/path.h>
|
||||
|
||||
//////////////
|
||||
// Prototypes
|
||||
|
@ -63,6 +64,7 @@ namespace agi {
|
|||
namespace config {
|
||||
extern agi::Options *opt; ///< Options
|
||||
extern agi::MRUManager *mru; ///< Most Recently Used
|
||||
extern agi::Path *path; ///< Paths
|
||||
}
|
||||
|
||||
/// DOCME
|
||||
|
@ -80,6 +82,12 @@ namespace Automation4 { class AutoloadScriptManager; }
|
|||
/// Macro to unsubscribe to OptionValue changes
|
||||
#define OPT_UNSUB(x, ...) config::opt->Get(x)->Unsubscribe(__VA_ARGS__)
|
||||
|
||||
/// Macro to get a path.
|
||||
#define PATH_GET(x) AegisubApp::Get()->path->Get(x)
|
||||
|
||||
/// Macro to set a path.
|
||||
#define PATH_SET(x, y) AegisubApp::Get()->path->Set(x, y)
|
||||
|
||||
|
||||
/// DOCME
|
||||
/// @class AegisubApp
|
||||
|
|
Loading…
Reference in a new issue