Managers: add a VFS to BackupManager.
Crashes at runtime. Needs debugging.
This commit is contained in:
parent
e11fa34c09
commit
e10a2df906
2 changed files with 16 additions and 1 deletions
|
@ -35,7 +35,9 @@
|
|||
|
||||
namespace mbst { namespace Managers {
|
||||
|
||||
BackupManager::BackupManager() {
|
||||
BackupManager::BackupManager():
|
||||
_vfs()
|
||||
{
|
||||
refresh();
|
||||
}
|
||||
|
||||
|
@ -49,6 +51,8 @@ BackupManager::refresh() {
|
|||
_backups = Containers::Array<Backup>{};
|
||||
|
||||
scanSubdir(""_s);
|
||||
|
||||
_vfs.build(_backups);
|
||||
}
|
||||
|
||||
Containers::ArrayView<const Backup>
|
||||
|
@ -56,6 +60,12 @@ BackupManager::backups() const {
|
|||
return _backups;
|
||||
}
|
||||
|
||||
const Vfs::VirtualFileSystem<Backup>&
|
||||
BackupManager::vfs() const
|
||||
{
|
||||
return _vfs;
|
||||
}
|
||||
|
||||
bool
|
||||
BackupManager::create(const GameObjects::Profile& profile) {
|
||||
if(!profile.valid()) {
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
|
||||
#include "Backup.h"
|
||||
#include "../GameObjects/Profile.h"
|
||||
#include "Vfs/VirtualFileSystem.h"
|
||||
|
||||
using namespace Corrade;
|
||||
|
||||
|
@ -40,6 +41,8 @@ class BackupManager {
|
|||
|
||||
auto backups() const -> Containers::ArrayView<const Backup>;
|
||||
|
||||
auto vfs() const -> const Vfs::VirtualFileSystem<Backup>&;
|
||||
|
||||
bool create(const GameObjects::Profile& profile);
|
||||
bool remove(std::size_t index);
|
||||
bool restore(std::size_t index);
|
||||
|
@ -50,6 +53,8 @@ class BackupManager {
|
|||
Containers::String _lastError;
|
||||
|
||||
Containers::Array<Backup> _backups;
|
||||
|
||||
Vfs::VirtualFileSystem<Backup> _vfs;
|
||||
};
|
||||
|
||||
}}
|
||||
|
|
Loading…
Reference in a new issue