From 6f3aa65bd69f5155fa1ee56dee840e2e7e1d3c6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sat, 31 Jan 2015 16:59:03 +0100 Subject: NOISSUE Split MultiMC app object into MultiMC and Env --- MultiMC.h | 93 ++++++++++++++++++++++++++------------------------------------- 1 file changed, 38 insertions(+), 55 deletions(-) (limited to 'MultiMC.h') diff --git a/MultiMC.h b/MultiMC.h index 59ff32d2..ccf950d1 100644 --- a/MultiMC.h +++ b/MultiMC.h @@ -40,6 +40,9 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(UpdateFlags); class MultiMC : public QApplication { + // friends for the purpose of limiting access to deprecated stuff + friend class MultiMCPage; + friend class MainWindow; Q_OBJECT public: enum Status @@ -53,106 +56,92 @@ public: MultiMC(int &argc, char **argv, bool test_mode = false); virtual ~MultiMC(); + // InstanceList, IconList, OneSixFTBInstance, LegacyUpdate, LegacyInstance, MCEditTool, JVisualVM, MinecraftInstance, JProfiler, BaseInstance std::shared_ptr settings() { return m_settings; } + // InstanceList, OneSixUpdate, MinecraftInstance, OneSixProfileStrategy + std::shared_ptr minecraftlist(); - std::shared_ptr instances() - { - return m_instances; - } - - std::shared_ptr accounts() - { - return m_accounts; - } - + // LegacyInstance, BaseInstance, OneSixInstance, InstanceList std::shared_ptr icons(); QIcon getThemedIcon(const QString& name); void setIconTheme(const QString& name); - Status status() - { - return m_status; - } - - std::shared_ptr qnam() - { - return m_qnam; - } - - std::shared_ptr metacache() - { - return m_metacache; - } - + // DownloadUpdateTask std::shared_ptr updateChecker() { return m_updateChecker; } + // LegacyUpdate std::shared_ptr lwjgllist(); + // APPLICATION ONLY std::shared_ptr forgelist(); + // APPLICATION ONLY std::shared_ptr liteloaderlist(); - std::shared_ptr minecraftlist(); - + // APPLICATION ONLY std::shared_ptr javalist(); + // APPLICATION ONLY + std::shared_ptr instances() + { + return m_instances; + } + + // APPLICATION ONLY + std::shared_ptr accounts() + { + return m_accounts; + } + + // APPLICATION ONLY + Status status() + { + return m_status; + } + + // APPLICATION ONLY QMap> profilers() { return m_profilers; } + + // APPLICATION ONLY QMap> tools() { return m_tools; } + // APPLICATION ONLY void installUpdates(const QString updateFilesDir, UpdateFlags flags = None); - /*! - * Updates the application proxy settings from the settings object. - */ - void updateProxySettings(); - /*! * Opens a json file using either a system default editor, or, if note empty, the editor * specified in the settings */ bool openJsonEditor(const QString &filename); +protected: /* to be removed! */ + // FIXME: remove. used by MultiMCPage to enumerate translations. /// this is the static data. it stores things that don't move. const QString &staticData() { return staticDataPath; } + + // FIXME: remove. used by MainWindow to create application update tasks /// this is the root of the 'installation'. Used for automatic updates const QString &root() { return rootPath; } - /// this is the where the binary files reside - const QString &bin() - { - return binPath; - } - /// this is the work/data path. All user data is here. - const QString &data() - { - return dataPath; - } - /** - * this is the original work path before it was changed by the adjustment mechanism - */ - const QString &origcwd() - { - return origcwdPath; - } private slots: /** @@ -165,8 +154,6 @@ private: void initGlobalSettings(bool test_mode); - void initHttpMetaCache(); - void initTranslations(); private: @@ -180,8 +167,6 @@ private: std::shared_ptr m_updateChecker; std::shared_ptr m_accounts; std::shared_ptr m_icons; - std::shared_ptr m_qnam; - std::shared_ptr m_metacache; std::shared_ptr m_lwjgllist; std::shared_ptr m_forgelist; std::shared_ptr m_liteloaderlist; @@ -200,9 +185,7 @@ private: QString rootPath; QString staticDataPath; - QString binPath; QString dataPath; - QString origcwdPath; Status m_status = MultiMC::Failed; }; -- cgit v1.2.3