From a994405c7110fda8d6286254cc7632f7b132c504 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Sverre=20Lien=20Sell=C3=A6g?= Date: Tue, 8 Sep 2020 00:05:49 +0200 Subject: [PATCH] load config and plugins early --- src/juci.cpp | 6 ++++-- src/window.cpp | 5 +---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/juci.cpp b/src/juci.cpp index a9e5ab8..95c5bf4 100644 --- a/src/juci.cpp +++ b/src/juci.cpp @@ -144,8 +144,10 @@ int main(int argc, char *argv[]) { signal(SIGPIPE, SIG_IGN); // Do not terminate application when writing to a process fails #endif auto &config = Config::get(); + config.load(); Plugins plugins(config); - plugins.load(); - + if(Config::get().plugins.enabled) { + plugins.load(); + } return Application(plugins).run(argc, argv); } diff --git a/src/window.cpp b/src/window.cpp index d8342b2..40bcb32 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -161,13 +161,9 @@ void Window::init() { about.set_comments("This is an open source IDE with high-end features to make your programming experience juicy"); about.set_license_type(Gtk::License::LICENSE_MIT_X11); about.set_transient_for(*this); - if(Config::get().plugins.enabled) { - plugins.load(); - } } void Window::configure() { - Config::get().load(); Snippets::get().load(); auto screen = get_screen(); @@ -471,6 +467,7 @@ void Window::set_menu_actions() { if(auto view = Notebook::get().get_current_view()) { if(Notebook::get().save_current()) { if(view->file_path == Config::get().home_juci_path / "config" / "config.json") { + Config::get().load(); configure(); for(size_t c = 0; c < Notebook::get().size(); c++) { Notebook::get().get_view(c)->configure();