aboutsummaryrefslogtreecommitdiff
path: root/launcher/InstanceCopyPrefs.cpp
diff options
context:
space:
mode:
authorTrial97 <alexandru.tripon97@gmail.com>2023-05-04 20:29:33 +0300
committerTrial97 <alexandru.tripon97@gmail.com>2023-05-04 20:29:33 +0300
commit9fbec3793f02f6bb3e692f98f2d86cad12c52190 (patch)
tree9f375cbb5e46020f172fd01acd92988fe17655bc /launcher/InstanceCopyPrefs.cpp
parentb2ecb9ac09573d13c6edf8f6ea0924c1f7006b4b (diff)
parent64ba5e4ed1456bed159cfe7b41ed9175b8baf5c4 (diff)
downloadPrismLauncher-9fbec3793f02f6bb3e692f98f2d86cad12c52190.tar.gz
PrismLauncher-9fbec3793f02f6bb3e692f98f2d86cad12c52190.tar.bz2
PrismLauncher-9fbec3793f02f6bb3e692f98f2d86cad12c52190.zip
Merge branch 'develop' of https://github.com/PrismLauncher/PrismLauncher into develop
Diffstat (limited to 'launcher/InstanceCopyPrefs.cpp')
-rw-r--r--launcher/InstanceCopyPrefs.cpp59
1 files changed, 59 insertions, 0 deletions
diff --git a/launcher/InstanceCopyPrefs.cpp b/launcher/InstanceCopyPrefs.cpp
index 7b93a516..0650002b 100644
--- a/launcher/InstanceCopyPrefs.cpp
+++ b/launcher/InstanceCopyPrefs.cpp
@@ -16,9 +16,14 @@ bool InstanceCopyPrefs::allTrue() const
copyScreenshots;
}
+
// Returns a single RegEx string of the selected folders/files to filter out (ex: ".minecraft/saves|.minecraft/server.dat")
QString InstanceCopyPrefs::getSelectedFiltersAsRegex() const
{
+ return getSelectedFiltersAsRegex({});
+}
+QString InstanceCopyPrefs::getSelectedFiltersAsRegex(const QStringList& additionalFilters) const
+{
QStringList filters;
if(!copySaves)
@@ -42,6 +47,10 @@ QString InstanceCopyPrefs::getSelectedFiltersAsRegex() const
if(!copyScreenshots)
filters << "screenshots";
+ for (auto filter : additionalFilters) {
+ filters << filter;
+ }
+
// If we have any filters to add, join them as a single regex string to return:
if (!filters.isEmpty()) {
const QString MC_ROOT = "[.]?minecraft/";
@@ -93,6 +102,31 @@ bool InstanceCopyPrefs::isCopyScreenshotsEnabled() const
return copyScreenshots;
}
+bool InstanceCopyPrefs::isUseSymLinksEnabled() const
+{
+ return useSymLinks;
+}
+
+bool InstanceCopyPrefs::isUseHardLinksEnabled() const
+{
+ return useHardLinks;
+}
+
+bool InstanceCopyPrefs::isLinkRecursivelyEnabled() const
+{
+ return linkRecursively;
+}
+
+bool InstanceCopyPrefs::isDontLinkSavesEnabled() const
+{
+ return dontLinkSaves;
+}
+
+bool InstanceCopyPrefs::isUseCloneEnabled() const
+{
+ return useClone;
+}
+
// ======= Setters =======
void InstanceCopyPrefs::enableCopySaves(bool b)
{
@@ -133,3 +167,28 @@ void InstanceCopyPrefs::enableCopyScreenshots(bool b)
{
copyScreenshots = b;
}
+
+void InstanceCopyPrefs::enableUseSymLinks(bool b)
+{
+ useSymLinks = b;
+}
+
+void InstanceCopyPrefs::enableLinkRecursively(bool b)
+{
+ linkRecursively = b;
+}
+
+void InstanceCopyPrefs::enableUseHardLinks(bool b)
+{
+ useHardLinks = b;
+}
+
+void InstanceCopyPrefs::enableDontLinkSaves(bool b)
+{
+ dontLinkSaves = b;
+}
+
+void InstanceCopyPrefs::enableUseClone(bool b)
+{
+ useClone = b;
+} \ No newline at end of file