aboutsummaryrefslogtreecommitdiff
path: root/api/logic/minecraft/PackProfile_p.h
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2020-06-27 12:02:31 +0200
committerPetr Mrázek <peterix@gmail.com>2020-06-27 12:02:31 +0200
commita0ef20a264656c127dd62eb9140e89a2fda6a8e0 (patch)
tree43b9262f501e9ec835939ec50cc23473e661b291 /api/logic/minecraft/PackProfile_p.h
parent4ca62916f562ca2d233d0fb4771054a106f1afc3 (diff)
downloadPrismLauncher-a0ef20a264656c127dd62eb9140e89a2fda6a8e0.tar.gz
PrismLauncher-a0ef20a264656c127dd62eb9140e89a2fda6a8e0.tar.bz2
PrismLauncher-a0ef20a264656c127dd62eb9140e89a2fda6a8e0.zip
NOISSUE rename ComponentList to PackProfile
It's not just components, so the naming needed cleaning up.
Diffstat (limited to 'api/logic/minecraft/PackProfile_p.h')
-rw-r--r--api/logic/minecraft/PackProfile_p.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/api/logic/minecraft/PackProfile_p.h b/api/logic/minecraft/PackProfile_p.h
new file mode 100644
index 00000000..2f7cc3d7
--- /dev/null
+++ b/api/logic/minecraft/PackProfile_p.h
@@ -0,0 +1,43 @@
+#pragma once
+
+#include "Component.h"
+#include <map>
+#include <QTimer>
+#include <QList>
+#include <QMap>
+
+class MinecraftInstance;
+using ComponentContainer = QList<ComponentPtr>;
+using ComponentIndex = QMap<QString, ComponentPtr>;
+using ConnectionList = QList<QMetaObject::Connection>;
+
+struct PackProfileData
+{
+ // the instance this belongs to
+ MinecraftInstance *m_instance;
+
+ // the launch profile (volatile, temporary thing created on demand)
+ std::shared_ptr<LaunchProfile> m_profile;
+
+ // version information migrated from instance.cfg file. Single use on migration!
+ std::map<QString, QString> m_oldConfigVersions;
+ QString getOldConfigVersion(const QString& uid) const
+ {
+ const auto iter = m_oldConfigVersions.find(uid);
+ if(iter != m_oldConfigVersions.cend())
+ {
+ return (*iter).second;
+ }
+ return QString();
+ }
+
+ // persistent list of components and related machinery
+ ComponentContainer components;
+ ComponentIndex componentIndex;
+ bool dirty = false;
+ QTimer m_saveTimer;
+ shared_qobject_ptr<Task> m_updateTask;
+ bool loaded = false;
+ bool interactionDisabled = true;
+};
+