| 712 | } |
| 713 | |
| 714 | bool PackProfile::installEmpty(const QString& uid, const QString& name) |
| 715 | { |
| 716 | QString patchDir = FS::PathCombine(d->m_instance->instanceRoot(), "patches"); |
| 717 | if (!FS::ensureFolderPathExists(patchDir)) { |
| 718 | return false; |
| 719 | } |
| 720 | auto f = std::make_shared<VersionFile>(); |
| 721 | f->name = name; |
| 722 | f->uid = uid; |
| 723 | f->version = "1"; |
| 724 | QString patchFileName = FS::PathCombine(patchDir, uid + ".json"); |
| 725 | QFile file(patchFileName); |
| 726 | if (!file.open(QFile::WriteOnly)) { |
| 727 | qCCritical(instanceProfileC) << d->m_instance->name() << "|" << "Error opening" << file.fileName() |
| 728 | << "for reading:" << file.errorString(); |
| 729 | return false; |
| 730 | } |
| 731 | file.write(OneSixVersionFormat::versionFileToJson(f).toJson()); |
| 732 | file.close(); |
| 733 | |
| 734 | appendComponent(makeShared<Component>(this, f->uid, f)); |
| 735 | scheduleSave(); |
| 736 | invalidateLaunchProfile(); |
| 737 | return true; |
| 738 | } |
| 739 | |
| 740 | bool PackProfile::removeComponent_internal(ComponentPtr patch) |
| 741 | { |
no test coverage detected