From 3bca0e761597f590fa3b1c6a57ee325e774e3f49 Mon Sep 17 00:00:00 2001 From: isanae <14251494+isanae@users.noreply.github.com> Date: Sun, 10 Jan 2021 22:06:38 -0500 Subject: split run() into setup() and run() this is so command line processing can happen outside of MOApplication many important objects were local to run(), so they're not members of MOApplication instead --- src/moapplication.h | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'src/moapplication.h') diff --git a/src/moapplication.h b/src/moapplication.h index 91b8023a..7e427ca8 100644 --- a/src/moapplication.h +++ b/src/moapplication.h @@ -27,20 +27,24 @@ class Settings; class MOMultiProcess; class Instance; class PluginContainer; +class OrganizerCore; +class NexusInterface; namespace MOBase { class IPluginGame; } -namespace cl { class CommandLine; } +namespace env { class ModuleNotification; } class MOApplication : public QApplication { Q_OBJECT public: - MOApplication(cl::CommandLine& cl, int& argc, char** argv); + MOApplication(int& argc, char** argv); - // sets up everything, creates the main window and runs it - // + int setup(MOMultiProcess& multiProcess); int run(MOMultiProcess& multiProcess); + void resetForRestart(); + + OrganizerCore& core(); virtual bool notify(QObject* receiver, QEvent* event); @@ -51,16 +55,21 @@ private slots: void updateStyle(const QString& fileName); private: - QFileSystemWatcher m_StyleWatcher; - QString m_DefaultStyle; - cl::CommandLine& m_cl; + QFileSystemWatcher m_styleWatcher; + QString m_defaultStyle; + std::unique_ptr m_modules; + + std::unique_ptr m_instance; + std::unique_ptr m_settings; + std::unique_ptr m_nexus; + std::unique_ptr m_plugins; + std::unique_ptr m_core; int doOneRun(MOMultiProcess& multiProcess); - std::optional getCurrentInstance(); + std::unique_ptr getCurrentInstance(); std::optional setupInstanceLoop(Instance& currentInstance, PluginContainer& pc); void purgeOldFiles(); - void resetForRestart(); }; -- cgit v1.3.1