summaryrefslogtreecommitdiffstats
path: root/api/logic/Env.h
diff options
context:
space:
mode:
Diffstat (limited to 'api/logic/Env.h')
-rw-r--r--api/logic/Env.h24
1 files changed, 10 insertions, 14 deletions
diff --git a/api/logic/Env.h b/api/logic/Env.h
index dcf1947f..989b4f3c 100644
--- a/api/logic/Env.h
+++ b/api/logic/Env.h
@@ -7,6 +7,8 @@
#include "multimc_logic_export.h"
+#include "QObjectPtr.h"
+
class QNetworkAccessManager;
class HttpMetaCache;
class BaseVersionList;
@@ -22,16 +24,15 @@ class MULTIMC_LOGIC_EXPORT Env
{
friend class MultiMC;
private:
+ class Private;
Env();
+ ~Env();
public:
static Env& getInstance();
- // call when Qt stuff is being torn down
- void destroy();
-
- std::shared_ptr<QNetworkAccessManager> qnam();
+ QNetworkAccessManager &qnam() const;
- std::shared_ptr<HttpMetaCache> metacache();
+ shared_qobject_ptr<HttpMetaCache> metacache();
std::shared_ptr<IIconList> icons();
@@ -51,16 +52,11 @@ public:
void registerIconList(std::shared_ptr<IIconList> iconlist);
- std::shared_ptr<WonkoIndex> wonkoIndex();
+ shared_qobject_ptr<WonkoIndex> wonkoIndex();
- QString wonkoRootUrl() const { return m_wonkoRootUrl; }
- void setWonkoRootUrl(const QString &url) { m_wonkoRootUrl = url; }
+ QString wonkoRootUrl() const;
+ void setWonkoRootUrl(const QString &url);
protected:
- std::shared_ptr<QNetworkAccessManager> m_qnam;
- std::shared_ptr<HttpMetaCache> m_metacache;
- std::shared_ptr<IIconList> m_iconlist;
- QMap<QString, std::shared_ptr<BaseVersionList>> m_versionLists;
- std::shared_ptr<WonkoIndex> m_wonkoIndex;
- QString m_wonkoRootUrl;
+ Private * d;
};