| 9 | #include "tasks/Task.h" |
| 10 | |
| 11 | InstanceCopyTask::InstanceCopyTask(InstancePtr 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 | auto matcherReal = new RegexpMatcher(filters); |
| 34 | matcherReal->caseSensitive(false); |
| 35 | m_matcher.reset(matcherReal); |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | void InstanceCopyTask::executeTask() |
| 40 | { |
nothing calls this directly
no test coverage detected