1
0
Fork 0
Commit Graph

41 Commits

Author SHA1 Message Date
Matthieu Gallien 25669938fd let clang-tidy add missing override after enabling again the check
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2021-08-31 08:35:56 +00:00
Matthieu Gallien 8ad6f89fed bring back dynamic load of VFS plugins
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2021-07-08 08:11:17 +00:00
Hannah von Reth e7e218d8e6 Improve the error message returned by updateMetadata
Also properly handle the case the the file can't be converted to a placeholder
as it is locked
2021-07-06 14:03:53 +00:00
allexzander 193e50311b Refresh Windows download dialog progress when hydrating a placeholder
Signed-off-by: allexzander <blackslayer4@gmail.com>
2021-03-24 14:09:06 +02:00
Kevin Ottens a89b483773
Add the plumbing for a new extended attributes backend
Ideally this will end up being the backend we use for both Linux and
macOS but that will require work with desktop environments on the Linux
side and to reverse engineering at least on xattr value on macOS.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2021-01-14 12:57:02 +01:00
Kevin Ottens da3ff631ef
Use Q_REQUIRED_RESULT directly like in other places
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-30 16:20:42 +01:00
Hannah von Reth 72b6118c3e
Mark vfs functions as OC_REQUIRED_RESULT 2020-12-30 16:17:48 +01:00
Hannah von Reth aadda32633
Handle errors in convertToPlaceholder 2020-12-30 16:17:47 +01:00
Kevin Ottens c57eff6fd8
Please the clang-tidy overlord
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 11:01:53 +01:00
Kevin Ottens 201dbd54db
Remove the plugin loader mechanism for VFS backends
We will have all the code in public anyway so it can just be compiled
in. Thus no need to go through the plugin loading dance. Replaced the
loading with factory functions. Kept mostly the same structure
otherwise.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:59:24 +01:00
Hannah von Reth dd3e70b667
VirtualFiles: Ensure the target location supports vfs
Fixes: #8131
2020-12-15 10:59:20 +01:00
Hannah von Reth 82dbf8b5e1
VFS: remove now unused parameter 2020-12-15 10:59:16 +01:00
Hannah von Reth f932dfc648
VFS: Tell the vfs plugin whether we have multiple accounts
This allows us to decide on the presentation of the account
2020-12-15 10:59:14 +01:00
Hannah von Reth 9176afe263
Make sure all cases are handled 2020-12-15 10:59:08 +01:00
Olivier Goffart 66f7b27121
VFS: Do not overwrite existing files by placeholder
For issue #7557 and #7556

Note: this change the API of the VFS plugin, so the VFS plugin needs small
adaptations
2020-12-15 10:59:03 +01:00
Christian Kamm 8a5a185752
Fix 'unused parameter name' warnings 2020-12-15 10:58:55 +01:00
Christian Kamm 0df3b83bd2
Vfs: Add hook to allow update-metadata for unchanged files
Allows winvfs to convert files to placeholders when vfs is enabled. This
is required to mark files as in-sync #7329.
2020-12-15 10:58:53 +01:00
Christian Kamm 5acb157a7e
VfsSuffix: Wipe stale pin states #7273
Previously the pin states of deleted files stayed in the 'flags'
database and could be inadvertently reused when a new file with the same
name appeared. Now they are deleted.

To make this work right, the meaning of the 'path' column in the 'flags'
table was changed: Previously it never had the .owncloud file suffix.
Now it's the same as in metadata.path.

This takes the safe parts from #7274 for inclusion in 2.6. The more
elaborate database schema changes (why use 'path' the join the two
tables in the first place?) shall go into master.
2020-12-15 10:58:52 +01:00
Christian Kamm 7774b8049e
Vfs: Distinguish availability error kinds #7143
Previously "no-availability" meant db-error and querying the
availability of a nonexistant path returned AllHydrated.

Now, the availability has a DbError and a NoSuchItem error case.
2020-12-15 10:58:49 +01:00
Christian Kamm 40d9fc4f4b
Vfs: Adjust and centralise action text #7143
Saying "Currently available locally" sounds more like an indicator than
"Availably locally" does. Centralizing translations avoids consistency
issues between shell context menus and sync folder context menu.
2020-12-15 10:58:49 +01:00
Christian Kamm dcf34316fd
Vfs: Add 'availability', a simplified, user-facing pin state #7111
The idea is that the user's question is "is this folder's data available
offline?" and not "does this folder have AlwaysLocal pin state?".
The the answers to the two questions can differ: an always-local
folder can have subitems that are not always-local and are dehydrated.

The new availability enum intends to describe the answer to the user's
actual question and can be derived from pin states. If pin states aren't
stored in the database the way of calculating availability will depend
on the vfs plugin.
2020-12-15 10:58:47 +01:00
Christian Kamm 4c04351360
Fix warnings about signedness
Sizes are always qint64, not unsigned.
TransferIds are always uint.
2020-12-15 10:58:41 +01:00
Christian Kamm b06f67baf0
Vfs: Ensure VfsOff works without start() being called
In tests an un-started Vfs instance is sometimes passed to SyncEngine
via SyncOptions.
2020-12-15 10:58:40 +01:00
Christian Kamm 6a977edeee
Vfs: Remove VfsDefaults
That just complicated things. It's ok if Vfs is not a fully abstract
interface class.

The pinstate-in-db methods are instead provided directly on Vfs and
VfsSuffix and VfsOff use them to implement pin states.

The start() method is simply non-virtual and calls into startImpl() for
the plugin-specific startup code.
2020-12-15 10:58:40 +01:00
Christian Kamm e9cbe13598
Vfs: Add option to hide socketapi pin actions
Because some plugins provide alternative ui.
2020-12-15 10:58:40 +01:00
Christian Kamm 6c5fa1dadd
Vfs: dehydration is separate action
Allows for better attribute preservation.

Also add verifyFileUnchanged() call before dehydration to avoid data
loss when discovery takes a while.
2020-12-15 10:58:39 +01:00
Christian Kamm 83a818678f
PinStates cleanup
- SyncJournalDB functions now behind internalPinStates() to avoid
accidental usage, when nearly everyone should go through Vfs.
- Rename Vfs::getPinState() to Vfs::pinState()
2020-12-15 10:58:39 +01:00
Christian Kamm 0eb4065197
Folder: Add remoteFolderTrailingSlash()
There were cases where the "/" exception wasn't handled correctly
and there'd be extra slashes in generated paths.
2020-12-15 10:58:39 +01:00
Christian Kamm 597cc60f52
Vfs: Enable propagating attributes on download 2020-12-15 10:58:38 +01:00
Christian Kamm 7f400e3226
Pin state updates
- unspecified and inherited are different
- move enum to header in common/
- access through Vfs instead of directly in Journal
2020-12-15 10:58:38 +01:00
Christian Kamm 2722c61515
Vfs: Shell integration is enabled optionally
Needs to be disabled for tests in some cases.
2020-12-15 10:58:38 +01:00
Christian Kamm e2eea24a03
Vfs: Send SyncFileStatusTracker data to vfs plugins 2020-12-15 10:58:37 +01:00
Christian Kamm 31394f14b5
Vfs: Make files that end up in db placeholders
Since 'placeholder' just means that it's an item of the special type
that the vfs plugin can deal with - no matter whether hydrated or
dehydrated - all done items should become placeholders. Even
directories.

Now every file that passes through updateMetadata() will be converted to
a placeholder if necessary.
2020-12-15 10:58:37 +01:00
Christian Kamm d87c2b803d
vfs: Make Vfs ctor explicit 2020-12-15 10:58:27 +01:00
Christian Kamm b30f79edf6
vfs: Ensure SyncOptions::_vfs is never null
- Create a VfsOff derived class
- Make it a shared pointer shared with Folder::_vfs
2020-12-15 10:58:26 +01:00
Christian Kamm fa2450cf11
vfs: Be more careful about Vfs instance ownership 2020-12-15 10:58:25 +01:00
Christian Kamm 9ced8dd836
vfs: Improve modeFromString() signature 2020-12-15 10:58:24 +01:00
Christian Kamm e7e6b839c0
vfs: Add API docs 2020-12-15 10:58:24 +01:00
Dominik Schmidt bfe136da7a
Fix export of vfs functions 2020-12-15 10:58:23 +01:00
Christian Kamm fa6f3cd847
vfs: Fix plugin decision in wizards, sanitize loading 2020-12-15 10:58:23 +01:00
Christian Kamm 2b20985875
winvfs: initial work
Done by ckamm and dschmidt
2020-12-15 10:58:21 +01:00