Skip to content
Extraits de code Groupes Projets
Valider 436ea23e rédigé par Amar Takhar's avatar Amar Takhar
Parcourir les fichiers

Instantiate agi::Path, I have no idea if this works on windows since my build...

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.
parent 355ad911
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -89,6 +89,7 @@ ...@@ -89,6 +89,7 @@
namespace config { namespace config {
agi::Options *opt; agi::Options *opt;
agi::MRUManager *mru; agi::MRUManager *mru;
agi::Path *path;
} }
...@@ -181,6 +182,10 @@ bool AegisubApp::OnInit() { ...@@ -181,6 +182,10 @@ bool AegisubApp::OnInit() {
emit_stdout->Enable(); emit_stdout->Enable();
#endif #endif
std::string path(agi::Path::Config());
config::path = new agi::Path(path.append("path.json"), GET_DEFAULT_CONFIG(default_path));
// Init command manager // Init command manager
cmd::cm = new cmd::CommandManager(); cmd::cm = new cmd::CommandManager();
...@@ -335,6 +340,7 @@ int AegisubApp::OnExit() { ...@@ -335,6 +340,7 @@ int AegisubApp::OnExit() {
delete config::opt; delete config::opt;
delete config::mru; delete config::mru;
delete agi::hotkey::hotkey; delete agi::hotkey::hotkey;
delete config::path;
#ifdef WITH_AUTOMATION #ifdef WITH_AUTOMATION
delete global_scripts; delete global_scripts;
......
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
#include "aegisublocale.h" #include "aegisublocale.h"
#include <libaegisub/mru.h> #include <libaegisub/mru.h>
#include <libaegisub/option.h> #include <libaegisub/option.h>
#include <libaegisub/path.h>
////////////// //////////////
// Prototypes // Prototypes
...@@ -63,6 +64,7 @@ namespace agi { ...@@ -63,6 +64,7 @@ namespace agi {
namespace config { namespace config {
extern agi::Options *opt; ///< Options extern agi::Options *opt; ///< Options
extern agi::MRUManager *mru; ///< Most Recently Used extern agi::MRUManager *mru; ///< Most Recently Used
extern agi::Path *path; ///< Paths
} }
/// DOCME /// DOCME
...@@ -80,6 +82,12 @@ namespace Automation4 { class AutoloadScriptManager; } ...@@ -80,6 +82,12 @@ namespace Automation4 { class AutoloadScriptManager; }
/// Macro to unsubscribe to OptionValue changes /// Macro to unsubscribe to OptionValue changes
#define OPT_UNSUB(x, ...) config::opt->Get(x)->Unsubscribe(__VA_ARGS__) #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 /// DOCME
/// @class AegisubApp /// @class AegisubApp
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter