diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2021-01-10 22:06:38 -0500 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2021-01-18 08:20:07 -0500 |
| commit | 3bca0e761597f590fa3b1c6a57ee325e774e3f49 (patch) | |
| tree | 34a49c4754a26073a59f658b905b5cdae72e2235 /src/moapplication.h | |
| parent | 59f055ba93381b965cdc04557ac1dce2df36bd07 (diff) | |
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
Diffstat (limited to 'src/moapplication.h')
| -rw-r--r-- | src/moapplication.h | 27 |
1 files changed, 18 insertions, 9 deletions
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<env::ModuleNotification> m_modules;
+
+ std::unique_ptr<Instance> m_instance;
+ std::unique_ptr<Settings> m_settings;
+ std::unique_ptr<NexusInterface> m_nexus;
+ std::unique_ptr<PluginContainer> m_plugins;
+ std::unique_ptr<OrganizerCore> m_core;
int doOneRun(MOMultiProcess& multiProcess);
- std::optional<Instance> getCurrentInstance();
+ std::unique_ptr<Instance> getCurrentInstance();
std::optional<int> setupInstanceLoop(Instance& currentInstance, PluginContainer& pc);
void purgeOldFiles();
- void resetForRestart();
};
|
