@@ -124,8 +124,6 @@ Folder::Folder(const FolderDefinition &definition, const AccountStatePtr &accoun
124124 }
125125 });
126126
127- // Potentially upgrade suffix vfs to windows vfs
128- OC_ENFORCE (_vfs);
129127 // Initialize the vfs plugin. Do this after the UI is running, so we can show a dialog when something goes wrong.
130128 QTimer::singleShot (0 , this , &Folder::startVfs);
131129 }
@@ -186,7 +184,12 @@ bool Folder::checkLocalPath()
186184 error = pathLengthCheck.error ();
187185 }
188186
189- if (error.isEmpty ()) {
187+ // Potentially upgrade suffix vfs to windows vfs
188+ OC_ENFORCE (_vfs);
189+ const auto result = VfsPluginManager::instance ().checkAvailability (path (), _vfs->mode ());
190+ if (!result) {
191+ error = result.error ();
192+ } else if (error.isEmpty ()) {
190193 qCDebug (lcFolder) << u" Checked local path ok" ;
191194 if (!_journal.open ()) {
192195 error = tr (" Failed to open the database for »%1«." ).arg (_definition.localPath ());
@@ -518,13 +521,6 @@ void Folder::startVfs()
518521 OC_ENFORCE (_vfs);
519522 OC_ENFORCE (_vfs->mode () == _definition.virtualFilesMode );
520523
521- const auto result = Vfs::checkAvailability (path (), _vfs->mode ());
522- if (!result) {
523- _syncResult.appendErrorString (result.error ());
524- setSyncState (SyncResult::SetupError);
525- return ;
526- }
527-
528524 VfsSetupParams vfsParams (_accountState->account (), webDavUrl (), _definition.spaceId (), displayName (), _engine.get ());
529525 vfsParams.filesystemPath = path ();
530526 vfsParams.journal = &_journal;
0 commit comments