mirror of
https://github.com/izzy2lost/dolphin.git
synced 2026-06-19 01:16:48 -07:00
DiscIO: Use Common::Lazy for loading filesystems
This simplifies FileMonitor a lot and also lets us clean up FilesystemPanel.
This commit is contained in:
@@ -4,7 +4,6 @@
|
||||
|
||||
#include "DiscIO/Filesystem.h"
|
||||
#include <memory>
|
||||
#include "DiscIO/FileSystemGCWii.h"
|
||||
#include "DiscIO/Volume.h"
|
||||
|
||||
namespace DiscIO
|
||||
@@ -18,20 +17,4 @@ FileSystem::FileSystem(const Volume* volume, const Partition& partition)
|
||||
|
||||
FileSystem::~FileSystem() = default;
|
||||
|
||||
std::unique_ptr<FileSystem> CreateFileSystem(const Volume* volume, const Partition& partition)
|
||||
{
|
||||
if (!volume)
|
||||
return nullptr;
|
||||
|
||||
std::unique_ptr<FileSystem> filesystem = std::make_unique<FileSystemGCWii>(volume, partition);
|
||||
|
||||
if (!filesystem)
|
||||
return nullptr;
|
||||
|
||||
if (!filesystem->IsValid())
|
||||
filesystem.reset();
|
||||
|
||||
return filesystem;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user