mirror of
https://github.com/chylex/Nextcloud-Desktop.git
synced 2025-04-09 19:15:43 +02:00
on switch to VFS real plugin, convert existing files to placeholders
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
This commit is contained in:
parent
6ad63fb770
commit
9658aea963
src
@ -669,8 +669,10 @@ void Folder::setVirtualFilesEnabled(bool enabled)
|
||||
|
||||
_definition.virtualFilesMode = newMode;
|
||||
startVfs();
|
||||
if (newMode != Vfs::Off)
|
||||
if (newMode != Vfs::Off) {
|
||||
_saveInFoldersWithPlaceholders = true;
|
||||
SyncEngine::switchToVirtualFiles(path(), _journal, *_vfs);
|
||||
}
|
||||
saveToSettings();
|
||||
}
|
||||
}
|
||||
|
@ -1019,6 +1019,16 @@ void SyncEngine::wipeVirtualFiles(const QString &localPath, SyncJournalDb &journ
|
||||
// But hydrated placeholders may still be around.
|
||||
}
|
||||
|
||||
void SyncEngine::switchToVirtualFiles(const QString &localPath, SyncJournalDb &journal, Vfs &vfs)
|
||||
{
|
||||
qCInfo(lcEngine) << "Convert to virtual files inside" << localPath;
|
||||
journal.getFilesBelowPath({}, [&](const SyncJournalFileRecord &rec) {
|
||||
SyncFileItem item;
|
||||
QString localFile = localPath + rec.path();
|
||||
vfs.convertToPlaceholder(localFile, item, localFile);
|
||||
});
|
||||
}
|
||||
|
||||
void SyncEngine::abort()
|
||||
{
|
||||
if (_propagator)
|
||||
|
@ -134,6 +134,8 @@ public:
|
||||
*/
|
||||
static void wipeVirtualFiles(const QString &localPath, SyncJournalDb &journal, Vfs &vfs);
|
||||
|
||||
static void switchToVirtualFiles(const QString &localPath, SyncJournalDb &journal, Vfs &vfs);
|
||||
|
||||
auto getPropagator() { return _propagator; } // for the test
|
||||
|
||||
signals:
|
||||
|
Loading…
Reference in New Issue
Block a user