From: Hannah von Reth Date: Fri, 17 Jul 2020 12:28:16 +0000 (+0200) Subject: Fix placeholders are reverted to OnlineOnly X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~21^2~468^2~62 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=020c6d642408526638041b1610faf0c05c26991f;p=nextcloud-desktop.git Fix placeholders are reverted to OnlineOnly Fixes: #7779 --- diff --git a/src/gui/folder.cpp b/src/gui/folder.cpp index d437241bc..4a793f611 100644 --- a/src/gui/folder.cpp +++ b/src/gui/folder.cpp @@ -660,14 +660,6 @@ void Folder::setSupportsVirtualFiles(bool enabled) } } -bool Folder::newFilesAreVirtual() const -{ - if (!supportsVirtualFiles()) - return false; - auto pinState = _vfs->pinState(QString()); - return pinState && *pinState == PinState::OnlineOnly; -} - void Folder::setRootPinState(PinState state) { _vfs->setPinState(QString(), state); @@ -718,9 +710,6 @@ void Folder::saveToSettings() const settings->beginGroup(FolderMan::escapeAlias(_definition.alias)); FolderDefinition::save(*settings, _definition); - // Technically redundant, just for older clients - settings->setValue(QLatin1String("usePlaceholders"), newFilesAreVirtual()); - settings->sync(); qCInfo(lcFolder) << "Saved folder" << _definition.alias << "to settings, status" << settings->status(); } diff --git a/src/gui/folder.h b/src/gui/folder.h index 0686b119b..771d9e460 100644 --- a/src/gui/folder.h +++ b/src/gui/folder.h @@ -279,12 +279,6 @@ public: bool supportsVirtualFiles() const; void setSupportsVirtualFiles(bool enabled); - /** whether new remote files shall become virtual locally - * - * This happens when the root folder pin state is OnlineOnly, but can be - * overridden by explicit subfolder pin states. - */ - bool newFilesAreVirtual() const; void setRootPinState(PinState state); /** Whether user desires a switch that couldn't be executed yet, see member */ diff --git a/src/gui/folderman.cpp b/src/gui/folderman.cpp index 3ee51b955..b04ffa227 100644 --- a/src/gui/folderman.cpp +++ b/src/gui/folderman.cpp @@ -297,7 +297,9 @@ void FolderMan::setupFoldersHelper(QSettings &settings, AccountStatePtr account, // Migrate the old "usePlaceholders" setting to the root folder pin state if (settings.value(QLatin1String(versionC), 1).toInt() == 1 && settings.value(QLatin1String("usePlaceholders"), false).toBool()) { + qCInfo(lcFolderMan) << "Migrate: From usePlaceholders to PinState::OnlineOnly"; f->setRootPinState(PinState::OnlineOnly); + settings.remove(QStringLiteral("usePlaceholders")); } // Migration: Mark folders that shall be saved in a backwards-compatible way