vfs: Allow folders without vfs

This commit is contained in:
Christian Kamm 2018-11-12 11:31:15 +01:00 committed by Kevin Ottens
parent e39d751b59
commit e0ae6012b1
No known key found for this signature in database
GPG key ID: 074BBBCB8DECC9E2

View file

@ -139,24 +139,26 @@ Folder::Folder(const FolderDefinition &definition,
}
}
}
if (!_vfs) {
// ### error handling; possibly earlier than in the ctor
qFatal("Could not load any vfs plugin.");
if (_definition.virtualFilesMode != Vfs::Off) {
if (!_vfs) {
// ### error handling; possibly earlier than in the ctor
qFatal("Could not load any vfs plugin.");
}
VfsSetupParams vfsParams;
vfsParams.filesystemPath = path();
vfsParams.remotePath = remotePath();
vfsParams.account = _accountState->account();
vfsParams.journal = &_journal;
vfsParams.providerName = Theme::instance()->appNameGUI();
vfsParams.providerVersion = Theme::instance()->version();
connect(_vfs, &OCC::Vfs::beginHydrating, this, &Folder::slotHydrationStarts);
connect(_vfs, &OCC::Vfs::doneHydrating, this, &Folder::slotHydrationDone);
_vfs->registerFolder(vfsParams); // Do this always?
_vfs->start(vfsParams);
}
VfsSetupParams vfsParams;
vfsParams.filesystemPath = path();
vfsParams.remotePath = remotePath();
vfsParams.account = _accountState->account();
vfsParams.journal = &_journal;
vfsParams.providerName = Theme::instance()->appNameGUI();
vfsParams.providerVersion = Theme::instance()->version();
connect(_vfs, &OCC::Vfs::beginHydrating, this, &Folder::slotHydrationStarts);
connect(_vfs, &OCC::Vfs::doneHydrating, this, &Folder::slotHydrationDone);
_vfs->registerFolder(vfsParams); // Do this always?
_vfs->start(vfsParams);
}
Folder::~Folder()