vfs: Allow folders without vfs
authorChristian Kamm <mail@ckamm.de>
Mon, 12 Nov 2018 10:31:15 +0000 (11:31 +0100)
committerKevin Ottens <kevin.ottens@nextcloud.com>
Tue, 15 Dec 2020 09:58:22 +0000 (10:58 +0100)
src/gui/folder.cpp

index 052b37c8ed9d0cec23154e1a22c9c984b9559c25..3f284938c46d90e966cc5ec87c8002913f47a241 100644 (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();
+        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);
+        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);
+        _vfs->registerFolder(vfsParams); // Do this always?
+        _vfs->start(vfsParams);
+    }
 }
 
 Folder::~Folder()