Vfs: Clear up relationship between _type and pin state
authorChristian Kamm <mail@ckamm.de>
Wed, 3 Apr 2019 11:32:05 +0000 (13:32 +0200)
committerKevin Ottens <kevin.ottens@nextcloud.com>
Tue, 15 Dec 2020 09:58:46 +0000 (10:58 +0100)
commit590db285419ab3eeae8f7f87542fa1642ec4fad3
treef87abe1deb7376e159bc8a3d55b7dfa521bc6a5e
parent2738f110f230a425c7bec0a0b068bb3c50802134
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.
src/common/pinstate.h
src/csync/csync.h
src/gui/accountsettings.cpp
src/gui/application.cpp
src/gui/folder.cpp
src/gui/folder.h
src/gui/socketapi.cpp
src/libsync/discovery.cpp
src/libsync/discovery.h
test/testsyncvirtualfiles.cpp