diff options
author | Christian Kamm <mail@ckamm.de> | 2019-04-03 14:32:05 +0300 |
---|---|---|
committer | Kevin Ottens <kevin.ottens@nextcloud.com> | 2020-12-15 12:58:46 +0300 |
commit | 590db285419ab3eeae8f7f87542fa1642ec4fad3 (patch) | |
tree | f87abe1deb7376e159bc8a3d55b7dfa521bc6a5e /src/gui/accountsettings.cpp | |
parent | 2738f110f230a425c7bec0a0b068bb3c50802134 (diff) |
Vfs: Clear up relationship between _type and pin state
The pin state is a per-item attribute that has an effect on _type:
AlwaysLocal dehydrated files will be marked for hydration and OnlineOnly
hydrated files will be marked for dehydration.
Where exactly this effect materializes depends on how the pin states are
stored. If they're stored in the db (suffix) the dbEntry._type is
changed during the discovery.
If the pin state is stored in the filesystem, the localEntry._type must
be adjusted by the plugin's stat callback.
This patch makes pin states behave more consistently between plugins.
Previously with suffix-vfs pin states only had an effect on new remote
files. Now the effect of pinning or unpinning files or directories is as
documented and similar to other plugins.
Diffstat (limited to 'src/gui/accountsettings.cpp')
-rw-r--r-- | src/gui/accountsettings.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/gui/accountsettings.cpp b/src/gui/accountsettings.cpp index a409b613c..69ade7872 100644 --- a/src/gui/accountsettings.cpp +++ b/src/gui/accountsettings.cpp @@ -762,14 +762,9 @@ void AccountSettings::slotSetCurrentFolderAvailability(PinState state) if (!selected.isValid() || !folder) return; - // similar to socket api: set pin state, wipe sub pin-states and sync + // similar to socket api: sets pin state recursively and sync folder->setNewFilesAreVirtual(state == PinState::OnlineOnly); - - if (state == PinState::AlwaysLocal) { - folder->downloadVirtualFile(""); - } else { - folder->dehydrateFile(""); - } + folder->scheduleThisFolderSoon(); } void AccountSettings::showConnectionLabel(const QString &message, QStringList errors) |