aboutsummaryrefslogtreecommitdiff
path: root/launcher/InstanceCopyTask.h
diff options
context:
space:
mode:
authorMarcelo Hernandez <marcelohdez.inq@gmail.com>2022-10-22 14:50:32 -0400
committerMarcelo Hernandez <marcelohdez.inq@gmail.com>2022-10-23 19:30:28 -0400
commite7e56eb1e397a528df91f9ce99f738c49bde363c (patch)
treef4308127a25ba76f1ef930e48f7e83ce43df6750 /launcher/InstanceCopyTask.h
parent8b28ed67ae25ed95c73e5c486b2a5e81b3a72268 (diff)
downloadPrismLauncher-e7e56eb1e397a528df91f9ce99f738c49bde363c.tar.gz
PrismLauncher-e7e56eb1e397a528df91f9ce99f738c49bde363c.tar.bz2
PrismLauncher-e7e56eb1e397a528df91f9ce99f738c49bde363c.zip
add more options to copy instance dialog
- Copy game options, copy resource packs, copy shaders, copy servers, and copy mods - Also made a new InstanceCopyPrefs struct to store those options rather than passing 7 different booleans into InstanceCopyTask's constructor Signed-off-by: Marcelo Hernandez <marcelohdez.inq@gmail.com>
Diffstat (limited to 'launcher/InstanceCopyTask.h')
-rw-r--r--launcher/InstanceCopyTask.h20
1 files changed, 13 insertions, 7 deletions
diff --git a/launcher/InstanceCopyTask.h b/launcher/InstanceCopyTask.h
index 82901732..d66bec55 100644
--- a/launcher/InstanceCopyTask.h
+++ b/launcher/InstanceCopyTask.h
@@ -1,20 +1,21 @@
#pragma once
-#include "tasks/Task.h"
-#include "net/NetJob.h"
-#include <QUrl>
#include <QFuture>
#include <QFutureWatcher>
-#include "settings/SettingsObject.h"
-#include "BaseVersion.h"
+#include <QUrl>
#include "BaseInstance.h"
+#include "BaseVersion.h"
+#include "InstanceCopyPrefs.h"
#include "InstanceTask.h"
+#include "net/NetJob.h"
+#include "settings/SettingsObject.h"
+#include "tasks/Task.h"
class InstanceCopyTask : public InstanceTask
{
Q_OBJECT
public:
- explicit InstanceCopyTask(InstancePtr origInstance, bool copySaves, bool keepPlaytime);
+ explicit InstanceCopyTask(InstancePtr origInstance, InstanceCopyPrefs prefs);
protected:
//! Entry point for tasks.
@@ -22,7 +23,12 @@ protected:
void copyFinished();
void copyAborted();
-private: /* data */
+private:
+ // Helper functions to avoid repeating code
+ static void appendToFilter(QString &filter, const QString &append);
+ void resetFromMatcher(const QString &regexp);
+
+ /* data */
InstancePtr m_origInstance;
QFuture<bool> m_copyFuture;
QFutureWatcher<bool> m_copyFutureWatcher;