MCPcopy Create free account
hub / github.com/ElyPrismLauncher/Launcher / InstanceCopyTask

Method InstanceCopyTask

launcher/InstanceCopyTask.cpp:11–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9#include "tasks/Task.h"
10
11InstanceCopyTask::InstanceCopyTask(BaseInstance* origInstance, const InstanceCopyPrefs& prefs)
12{
13 m_origInstance = origInstance;
14 m_keepPlaytime = prefs.isKeepPlaytimeEnabled();
15 m_useLinks = prefs.isUseSymLinksEnabled();
16 m_linkRecursively = prefs.isLinkRecursivelyEnabled();
17 m_useHardLinks = prefs.isLinkRecursivelyEnabled() && prefs.isUseHardLinksEnabled();
18 m_copySaves = prefs.isLinkRecursivelyEnabled() && prefs.isDontLinkSavesEnabled() && prefs.isCopySavesEnabled();
19 m_useClone = prefs.isUseCloneEnabled();
20
21 QString filters = prefs.getSelectedFiltersAsRegex();
22 if (m_useLinks || m_useHardLinks) {
23 if (!filters.isEmpty())
24 filters += "|";
25 filters += "instance.cfg";
26 }
27
28 qDebug() << "CopyFilters:" << filters;
29
30 if (!filters.isEmpty()) {
31 // Set regex filter:
32 // FIXME: get this from the original instance type...
33 QRegularExpression regexp(filters, QRegularExpression::CaseInsensitiveOption);
34 m_matcher = Filters::regexp(regexp);
35 }
36}
37
38void InstanceCopyTask::executeTask()
39{

Callers

nothing calls this directly

Calls 10

regexpFunction · 0.85
isKeepPlaytimeEnabledMethod · 0.80
isUseSymLinksEnabledMethod · 0.80
isUseHardLinksEnabledMethod · 0.80
isCopySavesEnabledMethod · 0.80
isUseCloneEnabledMethod · 0.80
isEmptyMethod · 0.45

Tested by

no test coverage detected