diff options
| author | SulfurNitride <SulfurNitride@users.noreply.github.com> | 2026-02-11 02:37:39 -0600 |
|---|---|---|
| committer | SulfurNitride <SulfurNitride@users.noreply.github.com> | 2026-02-11 02:37:39 -0600 |
| commit | 7ee008e150bc5bcf76082d726f719ee0fdfda982 (patch) | |
| tree | 27fb39be241fdb5ac2734c574de678977d1856d0 /libs/bsapacker/src/BsaPackerWorker.cpp | |
Fluorine Manager: full Linux port of Mod Organizer 2
Complete native Linux port with FUSE-based virtual filesystem,
Proton/umu-run integration, and Flatpak packaging.
Key features:
- FUSE VFS replacing Windows USVFS (in-process + standalone helper for Flatpak)
- Proton/GE-Proton/umu-run launcher with env var forwarding
- Flatpak support (sandbox-aware VFS, NXM handler, umu-run)
- Wine prefix management UI
- Case-insensitive path resolution for Linux filesystems
- QSettings-safe INI handling (avoids Bethesda INI corruption)
- Portable instance support with auto-generated launcher scripts
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'libs/bsapacker/src/BsaPackerWorker.cpp')
| -rw-r--r-- | libs/bsapacker/src/BsaPackerWorker.cpp | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/libs/bsapacker/src/BsaPackerWorker.cpp b/libs/bsapacker/src/BsaPackerWorker.cpp new file mode 100644 index 0000000..3b9e558 --- /dev/null +++ b/libs/bsapacker/src/BsaPackerWorker.cpp @@ -0,0 +1,66 @@ +#include "BsaPackerWorker.h" + +#include <QMessageBox> + +#include <bsapacker/ArchiveBuildDirector.h> +#include <bsapacker/ModDtoFactory.h> + +namespace BsaPacker +{ + BsaPackerWorker::BsaPackerWorker( + const ISettingsService* settingsService, + const IModDtoFactory* modDtoFactory, + const IArchiveBuilderFactory* archiveBuilderFactory, + const IArchiveAutoService* archiveAutoService, + const IDummyPluginServiceFactory* dummyPluginServiceFactory, + const IHideLooseAssetService* hideLooseAssetService, + const IArchiveNameService* archiveNameService, + const IOverrideFileService* overrideFileService) : + m_SettingsService(settingsService), + m_ModDtoFactory(modDtoFactory), + m_ArchiveBuilderFactory(archiveBuilderFactory), + m_ArchiveAutoService(archiveAutoService), + m_DummyPluginServiceFactory(dummyPluginServiceFactory), + m_HideLooseAssetService(hideLooseAssetService), + m_ArchiveNameService(archiveNameService), + m_OverrideFileService(overrideFileService) + { + } + + void BsaPackerWorker::DoWork() const + { + QStringList createdArchives; + const std::unique_ptr<IModDto> modDto = this->m_ModDtoFactory->Create(); // handles PackerDialog and validation, implements Null Object pattern + const std::vector<bsa_archive_type_e> types = this->m_ArchiveBuilderFactory->GetArchiveTypes(modDto.get()); + for (auto&& type : types) { + const std::unique_ptr<IArchiveBuilder> builder = this->m_ArchiveBuilderFactory->Create(type, modDto.get()); + ArchiveBuildDirector director(this->m_SettingsService, builder.get()); + director.Construct(); // must check if cancelled + const std::vector<std::unique_ptr<libbsarch::bs_archive_auto>> archives = builder->getArchives(); + for (const auto& archive : archives) { + if (archive) { + const QFileInfo fileInfo(this->m_ArchiveNameService->GetArchiveFullPath(type, modDto.get())); + bool res = this->m_ArchiveAutoService->CreateBSA( + archive.get(), fileInfo.absoluteFilePath(), type, + modDto->Directory(), modDto->NexusId()); + if (res) { + createdArchives.append(fileInfo.completeBaseName()); + } + } + } + } + + if (!createdArchives.isEmpty()) { + QMessageBox::information(nullptr, "", + QObject::tr("Created archive(s):") + "\n" + createdArchives.join(modDto->ArchiveExtension() +",\n") + modDto->ArchiveExtension()); + this->m_OverrideFileService->CreateOverrideFile(modDto->NexusId(), modDto->Directory(), createdArchives); + } + + const std::unique_ptr<IDummyPluginService> pluginService = this->m_DummyPluginServiceFactory->Create(); + pluginService->CreatePlugin(modDto->Directory(), modDto->ArchiveName()); + + if (!modDto->Directory().isEmpty()) { + this->m_HideLooseAssetService->HideLooseAssets(modDto->Directory()); + } + } +} |
