| 15 | #include "document.hpp" |
| 16 | |
| 17 | CSMDoc::DocumentManager::DocumentManager(const Files::ConfigurationManager& configuration) |
| 18 | : mConfiguration(configuration) |
| 19 | , mEncoding(ToUTF8::WINDOWS_1252) |
| 20 | { |
| 21 | std::filesystem::path projectPath = configuration.getUserDataPath() / "projects"; |
| 22 | |
| 23 | if (!std::filesystem::is_directory(projectPath)) |
| 24 | std::filesystem::create_directories(projectPath); |
| 25 | |
| 26 | mLoader.moveToThread(&mLoaderThread); |
| 27 | mLoaderThread.start(); |
| 28 | |
| 29 | connect(&mLoader, &Loader::documentLoaded, this, &DocumentManager::documentLoaded); |
| 30 | connect(&mLoader, &Loader::documentNotLoaded, this, &DocumentManager::documentNotLoaded); |
| 31 | connect(this, &DocumentManager::loadRequest, &mLoader, &Loader::loadDocument); |
| 32 | connect(&mLoader, &Loader::nextStage, this, &DocumentManager::nextStage); |
| 33 | connect(&mLoader, &Loader::nextRecord, this, &DocumentManager::nextRecord); |
| 34 | connect(this, &DocumentManager::cancelLoading, &mLoader, &Loader::abortLoading); |
| 35 | connect(&mLoader, &Loader::loadMessage, this, &DocumentManager::loadMessage); |
| 36 | } |
| 37 | |
| 38 | CSMDoc::DocumentManager::~DocumentManager() |
| 39 | { |
nothing calls this directly
no test coverage detected