fs: remove ArchiveFactory_ExtSaveData::Initialize

This is unnecessary as any open archive would create the full path for themselves
This commit is contained in:
Weiyi Wang 2018-09-28 17:08:39 -04:00
parent 7c97e8df62
commit b03332d09b
3 changed files with 2 additions and 25 deletions

View File

@ -194,15 +194,6 @@ ArchiveFactory_ExtSaveData::ArchiveFactory_ExtSaveData(const std::string& mount_
LOG_DEBUG(Service_FS, "Directory {} set as base for ExtSaveData.", mount_point); LOG_DEBUG(Service_FS, "Directory {} set as base for ExtSaveData.", mount_point);
} }
bool ArchiveFactory_ExtSaveData::Initialize() {
if (!FileUtil::CreateFullPath(mount_point)) {
LOG_ERROR(Service_FS, "Unable to create ExtSaveData base path.");
return false;
}
return true;
}
Path ArchiveFactory_ExtSaveData::GetCorrectedPath(const Path& path) { Path ArchiveFactory_ExtSaveData::GetCorrectedPath(const Path& path) {
if (!shared) if (!shared)
return path; return path;

View File

@ -20,12 +20,6 @@ class ArchiveFactory_ExtSaveData final : public ArchiveFactory {
public: public:
ArchiveFactory_ExtSaveData(const std::string& mount_point, bool shared); ArchiveFactory_ExtSaveData(const std::string& mount_point, bool shared);
/**
* Initialize the archive.
* @return true if it initialized successfully
*/
bool Initialize();
std::string GetName() const override { std::string GetName() const override {
return "ExtSaveData"; return "ExtSaveData";
} }

View File

@ -646,19 +646,11 @@ void RegisterArchiveTypes() {
auto extsavedata_factory = auto extsavedata_factory =
std::make_unique<FileSys::ArchiveFactory_ExtSaveData>(sdmc_directory, false); std::make_unique<FileSys::ArchiveFactory_ExtSaveData>(sdmc_directory, false);
if (extsavedata_factory->Initialize())
RegisterArchiveType(std::move(extsavedata_factory), ArchiveIdCode::ExtSaveData); RegisterArchiveType(std::move(extsavedata_factory), ArchiveIdCode::ExtSaveData);
else
LOG_ERROR(Service_FS, "Can't instantiate ExtSaveData archive with path {}",
extsavedata_factory->GetMountPoint());
auto sharedextsavedata_factory = auto sharedextsavedata_factory =
std::make_unique<FileSys::ArchiveFactory_ExtSaveData>(nand_directory, true); std::make_unique<FileSys::ArchiveFactory_ExtSaveData>(nand_directory, true);
if (sharedextsavedata_factory->Initialize())
RegisterArchiveType(std::move(sharedextsavedata_factory), ArchiveIdCode::SharedExtSaveData); RegisterArchiveType(std::move(sharedextsavedata_factory), ArchiveIdCode::SharedExtSaveData);
else
LOG_ERROR(Service_FS, "Can't instantiate SharedExtSaveData archive with path {}",
sharedextsavedata_factory->GetMountPoint());
// Create the NCCH archive, basically a small variation of the RomFS archive // Create the NCCH archive, basically a small variation of the RomFS archive
auto savedatacheck_factory = std::make_unique<FileSys::ArchiveFactory_NCCH>(); auto savedatacheck_factory = std::make_unique<FileSys::ArchiveFactory_NCCH>();