| 19 | } |
| 20 | |
| 21 | CraftRuntime::CraftRuntime(const QString& craftRoot, const QString& pythonExecutable) |
| 22 | : m_craftRoot(craftRoot) |
| 23 | , m_pythonExecutable(pythonExecutable) |
| 24 | { |
| 25 | Q_ASSERT(!pythonExecutable.isEmpty()); |
| 26 | |
| 27 | m_watcher.addPath(craftRoot + craftSetupHelperRelativePath()); |
| 28 | |
| 29 | connect(&m_watcher, &QFileSystemWatcher::fileChanged, this, [this](const QString& path) { |
| 30 | if (QFileInfo::exists(path)) { |
| 31 | refreshEnvCache(); |
| 32 | if (!m_watcher.files().contains(path)) { |
| 33 | m_watcher.addPath(path); |
| 34 | } |
| 35 | } |
| 36 | }); |
| 37 | refreshEnvCache(); |
| 38 | } |
| 39 | |
| 40 | QString CraftRuntime::name() const |
| 41 | { |
nothing calls this directly
no test coverage detected