1
0
Fork 0
Commit Graph

7788 Commits

Author SHA1 Message Date
Christian Kamm cbb32edee2
vfs: Disable selective sync if vfs support is available 2020-12-15 10:58:32 +01:00
Christian Kamm aa23058d76
Wizard: Ensure client cert doesn't get lost #6911 2020-12-15 10:58:32 +01:00
Christian Kamm c470825c8f
Wizard: Drop unused function 2020-12-15 10:58:32 +01:00
Markus Goetz 4fcad0d8b0
Sync: Display theme in debug log 2020-12-15 10:58:32 +01:00
Christian Kamm b4e73690b7
sqlite: Set exclusive locking_mode to avoid WAL issues #6881
Can be overridden with OWNCLOUD_SQLITE_LOCKING_MODE
2020-12-15 10:58:32 +01:00
Dominik Schmidt 17465a6f94
Fix lookup of system wide settings 2020-12-15 10:58:32 +01:00
Olivier Goffart f258af1198
sqlite: Update bundled version to 3.26.0
For OS X and Windows.
2020-12-15 10:58:31 +01:00
Olivier Goffart c31d3f277f
HttpCredentials: Do not re-enter the event loop
https://sentry.io/owncloud/desktop-win-and-mac/issues/777907931/
mention a crash in OCC::HttpCredentialsGui::showDialog
One possible explaination is that this is caused by re-entring the event loop.
So don't do that.
2020-12-15 10:58:31 +01:00
Olivier Goffart 51d2e41d8b
Chunking Move: Fix too many starting slashes in the destination header
Commit 6ca724f fixed it for the move case. But the upload MOVE did the same

Issue #6904
2020-12-15 10:58:31 +01:00
Olivier Goffart 0e56dfe3a4
Gui: do not show the settings when opening a virtual file
Issue #6764
2020-12-15 10:58:31 +01:00
Christian Kamm c4dfa82661
SocketAPI: Overhaul ui for 'available locally' vs 'online only'
For #6815
2020-12-15 10:58:30 +01:00
Christian Kamm aa382eda29
Db: Add wiping of pin state for subtrees 2020-12-15 10:58:30 +01:00
Christian Kamm d956f518a8
vfs: Remove newFilesAreVirtual - use root PinState instead
This unifies how to deal with pin states.

Also enable reading a folders direct pin state vs its effective pin
state.
2020-12-15 10:58:30 +01:00
Olivier Goffart 62ec4c9330
Discovery: Handle the blacklistFiles from the server capabilities
Issue #434

Ideally one could add the blacklist to the exlucde reggexp, but this
is simpler
2020-12-15 10:58:30 +01:00
Christian Kamm 8fecff5153
Progress: Virtual file creation needs no transfer progress #6933
Treat virtual file creation as a size-less action, similar to
propagating renames or deletions.
2020-12-15 10:58:30 +01:00
Christian Kamm cdf61b9e82
vfs: Show "new files are virtual" option only with vfs
If there's no vfs possibility, showing it makes little sense.
2020-12-15 10:58:30 +01:00
Christian Kamm 8f895fc83c
vfs: SocketAPI actions adjust pin state of directories #6815
Downloading a folder also sets its pin state; releasing a folder sets
its pin state.
2020-12-15 10:58:29 +01:00
Christian Kamm 486c25cb47
vfs: Use PinState in sync algorithm #6815
New files are virtual if the file's pin state is OnlineOnly.
2020-12-15 10:58:29 +01:00
Christian Kamm 68126ac208
vfs: Introduce PinState db storage #6815
The idea is to allow folders (and later maybe files?) to be
- pinned to be available locally
- pinned to be online only
- inherit their pin from the parent

Where this pinning only controls the default for new files.
Subfolders may have a different pin state, and contained files
may be hydrated or dehydrated based on user actions.

This value is stored in a new 'flags' table. The idea is to store
data there that doesn't necessarily exist for each metadata entry.
The selective sync state could be migrated to this table.
2020-12-15 10:58:29 +01:00
Olivier Goffart a29320b18d
Discovery: Set right direction when restoring deleted discovery because it has modified files
(Catched by a faillure of t1.pl)
2020-12-15 10:58:29 +01:00
Olivier Goffart 6da96cd026
Port the exclude test to the QTest Framework
This is just a port to QtTest, I did not change the layout of the test.
I did search and replace to replace the assert with QCOMPARE/QVERIFY
I still call setup and setup_init like before (only explicitly, now)

Also ported the preformence tests to QBENCHMAK because windows don't have
gettimeofday.

Relates #6358
2020-12-15 10:58:29 +01:00
Christian Kamm 69144566ce
Database: Change path for new dbs to .sync_* #5904
This is to avoid issues on OSX, where the ._ prefix has special meaning.

Originally (before 2.3.2) ._ was necessary to guarantee exclusion. But
since then the .sync_ prefix is excluded as well.

This does not affect existing database files.
2020-12-15 10:58:28 +01:00
Christian Kamm 30294e0c9a
Vfs: Have a static list of potential plugins for now
Fixes in-source builds and other cases where more non-plugin directories
are created in src/libsync/vfs.
2020-12-15 10:58:28 +01:00
Christian Kamm 75b9976526
Vfs: Ensure older versions gracefully ignore winvfs folders
Previously there'd likely be a mess if a 2.6 winvfs folder was attempted
to be used with a 2.5 client. Now the older clients will ignore these
folders.
2020-12-15 10:58:28 +01:00
Christian Kamm bdfda460e6
Vfs plugins: Available plugins must load
A plugin that can't be loaded due to dependency issues should not be
considered as available.
2020-12-15 10:58:28 +01:00
Olivier Goffart fd410a5a84
SyncEngine: Ensure that the paths passed to the discovery ends with slashes
This was making the tx.pl test fail
2020-12-15 10:58:28 +01:00
Olivier Goffart edd806960d
Propagator: Don't abort sync on error 503
Only do it when it is actually a maintenance mode

Issues #5088, #5859, https://github.com/owncloud/enterprise/issues/2637
2020-12-15 10:58:27 +01:00
Olivier Goffart feb770eca7
Allow to open log window via command line to already running client
Issue: #4098
2020-12-15 10:58:27 +01:00
Dominik Schmidt 687eb9665d
Fix installation of vfs suffix plugin 2020-12-15 10:58:27 +01:00
Olivier Goffart a7a54b6d11
VFS: Plugin needs to be installed, otherwise it can't be loaded 2020-12-15 10:58:27 +01:00
Olivier Goffart 47b2913357
Fix compilation warning
src/libsync/propagatorjobs.cpp:63:10: warning: lambda capture 'this' is not used [-Wunused-lambda-capture]
        [this, &deleted](const QString &path, bool isDir) {
         ^~~~~
2020-12-15 10:58:27 +01:00
Christian Kamm d87c2b803d
vfs: Make Vfs ctor explicit 2020-12-15 10:58:27 +01:00
Christian Kamm 305d439c41
vfs: Separate vfs availability from new-files-virtual
This helps support 2.5 settings where there are virtual files in the
tree but new files aren't created virtual.

It's also a prelude for #6815

There's currently no way of
- upgrading vfs plugins (a silent suffix->winvfs upgrade is attempted
  once only, when moving to master)
- disabling vfs capabilities outright
2020-12-15 10:58:27 +01:00
Christian Kamm 1e5e884805
vfs: Don't always load plugins, check metadata 2020-12-15 10:58:26 +01:00
Christian Kamm cc912f4d02
vfs: ensure backwards-compatible settings value is always set 2020-12-15 10:58:26 +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 842577e014
vfs: Switch order of deletion and journal removal in dehydration
To be more crash-resilient.
2020-12-15 10:58:26 +01:00
Christian Kamm 4e40b635da
vfs: Update outdated comment 2020-12-15 10:58:26 +01:00
Christian Kamm d7ad7854c1
vfs: Ensure local discovery is done on dehydration request 2020-12-15 10:58:26 +01:00
Christian Kamm f2b78b5efb
Folder settings: Keep "usePlaceholders" to be backwards compatible 2020-12-15 10:58:25 +01:00
Christian Kamm fa2450cf11
vfs: Be more careful about Vfs instance ownership 2020-12-15 10:58:25 +01:00
Christian Kamm 9196aa8e0a
vfs: Remove VfsSuffixPrivate 2020-12-15 10:58:25 +01:00
Christian Kamm 5b26b739f0
vfs: Document ignored return value. 2020-12-15 10:58:25 +01:00
Christian Kamm 77e5b956d1
Plugin: Drop PluginLoader 2020-12-15 10:58:25 +01:00
Christian Kamm 9bc28e3006
Plugin: style fixes 2020-12-15 10:58:25 +01:00
Christian Kamm a5264f7740
Checksums: Make file ownership more explicit 2020-12-15 10:58:24 +01:00
Christian Kamm 9ced8dd836
vfs: Improve modeFromString() signature 2020-12-15 10:58:24 +01:00
Christian Kamm f502a526fa
Generalize Result<> class, add Optional<>
To make it nicer to use outside of HTTP results.
2020-12-15 10:58:24 +01:00
Christian Kamm e7e6b839c0
vfs: Add API docs 2020-12-15 10:58:24 +01:00
Christian Kamm 85dd10eb9b
vfs: Fix dealing with missing vfs instance
Maybe there should just be a VfsOff instance to make this less error
prone.
2020-12-15 10:58:24 +01:00
Dominik Schmidt bfe136da7a
Fix export of vfs functions 2020-12-15 10:58:23 +01:00
Dominik Schmidt 1104883fba
Cleanup CMake (output) 2020-12-15 10:58:23 +01:00
Christian Kamm f074c1a07b
vfs: Add check for presence of win plugin 2020-12-15 10:58:23 +01:00
Christian Kamm 4bef96afe7
vfs: Make switching vfs on/off work again 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 d5a3604d39
vfs: Reenable local metadata updating of vfs files 2020-12-15 10:58:23 +01:00
Christian Kamm 96f4fd46e5
vfs: Make some behaviors suffix-vfs specific 2020-12-15 10:58:23 +01:00
Christian Kamm 90827c8162
vfs: Allow remote renames to propagate as such 2020-12-15 10:58:22 +01:00
Christian Kamm e0ae6012b1
vfs: Allow folders without vfs 2020-12-15 10:58:22 +01:00
Christian Kamm e39d751b59
Fix big-folder detection when vfs is disabled 2020-12-15 10:58:22 +01:00
Christian Kamm bee1b0edd4
vfs: Implement dehydration tagging 2020-12-15 10:58:22 +01:00
Christian Kamm ae9a7e088f
vfs: Fix suffix detection and handling 2020-12-15 10:58:22 +01:00
Christian Kamm 1ed005aafe
winvfs: Better error reporting
- fix download and validation error reporting
- add tests
2020-12-15 10:58:22 +01:00
Christian Kamm 0f2ef42ba2
Fixes after rebase to master
- use vfs suffix in ProcessDirectoryJob
- fix include vfs.h
- fix local vio passing vfs
- fix checksum computation
- vfs mode use
- mingw lambda compile issue
2020-12-15 10:58:21 +01:00
Christian Kamm 2b20985875
winvfs: initial work
Done by ckamm and dschmidt
2020-12-15 10:58:21 +01:00
Christian Kamm c3b1a872aa
FolderMan: Remove assumption of unique running sync 2020-12-15 10:58:21 +01:00
Christian Kamm 22e08cf6ad
Checksums: Work on QIODevice*s
Needed for cfapi where we want to feed data through a custom device
which retrieves data from the windows api.
2020-12-15 10:58:21 +01:00
Olivier Goffart a6614c18f1
IgnoreListEditor: increase a bit the size
Should Help for issue #6641
2020-12-15 10:58:21 +01:00
Olivier Goffart 7c1871ae65
Account: Fix crash when deleting an account
We should not have request parented to the account, otherwise we might get
a loop on the deletion order.

Issue #6893
2020-12-15 10:58:21 +01:00
Christian Kamm 6b0bb66b17
LockWatcher: Add chrono header 2020-12-15 10:58:20 +01:00
Christian Kamm 582803b6bd
cjhash: Fix build fix
See 17a4055e8d658f24b1fc47c44fd2daf66c7d5dbf
2020-12-15 10:58:20 +01:00
Olivier Goffart 175b064364
cjhash: use Q_FALLTHROUGH
This fixes the warning
   warning: unknown option after ‘#pragma GCC diagnostic’ kind [-Wpragmas]

Issue #6872
2020-12-15 10:58:20 +01:00
Kevin Ottens cce3d6f6fc
Excludes: switch all the path handling to QString
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:58:20 +01:00
Olivier Goffart 1c443ad021
CMakeLists.txt: increment sqlite version
3.9 is required for custom index to work
2020-12-15 10:58:20 +01:00
Olivier Goffart 5e05b61d2f
csync_vio_locale: use QString for the path in opendir
So we don't have to convert to utf8 and back again
2020-12-15 10:58:20 +01:00
Olivier Goffart f0c24cb6f9
Remove csync_misc: The code no longer use fnmatch 2020-12-15 10:58:20 +01:00
Olivier Goffart 3c3619f99a
Exclude: do everything with QString wiuthout converting to char* 2020-12-15 10:58:19 +01:00
Olivier Goffart 164051b0c9
ProcessDirectoryJob::process: optimize so there is only one map 2020-12-15 10:58:19 +01:00
Olivier Goffart 1783db5811
PropagateUpload: Avoid many allocations by using QByteArrayLiteral 2020-12-15 10:58:19 +01:00
Olivier Goffart d6a0290058
Optimisation: Add a cache SyncJournalDb::mapChecksumType
No need to do two sql query for something that's always the same and
there are very few checksum types
2020-12-15 10:58:19 +01:00
Olivier Goffart 69de2d5180
Sync: optimize by removing setFileRecordMetadata
Inh most case we already have a record from before, so avoid doing a useless
lookup in the database.
In owncloudpropagator.cpp, directories do not have a checksum so no need
to call a function that preserves it
2020-12-15 10:58:19 +01:00
Olivier Goffart 7e1840bb2f
OwnSql: Speedup by avoiding allocating an error string on success 2020-12-15 10:58:18 +01:00
Gerhard Gappmeier 7e55ce6640
owncloudcmd: fix compiliation with TOKEN_AUTH_ONLY 2020-12-15 10:58:18 +01:00
Gerhard Gappmeier b3792ac1f0
libsync: Fix build error with TOKEN_AUTH_ONLY
When enabling TOKEN_AUTH_ONLY, the code path using QPainter is disabled.
So we also don't need the includes.
This header is not available for Remarkable.
2020-12-15 10:58:18 +01:00
Gerhard Gappmeier ff9bd84c45
Disable stack protector features when cross compiling
When cross-compiling this for remarkable using the poky toolchain
this results in linker errors with stack protector: libssp_nonshared.a
not found
2020-12-15 10:58:18 +01:00
Gerhard Gappmeier 6aead6425e
Add CMake option to disable GUI build 2020-12-15 10:58:18 +01:00
Kevin Ottens 9131a68ec4
Get DatabaseErrorTest to pass
The E2EE code path would get the engine to go wrong in case of db error.
It's just better to have a failing upload or failing mkdir later in those
cases.

Emitting signals from a ctor is a bad idea anyway

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:58:18 +01:00
Olivier Goffart bb9ce8db21
Test that the sync behave well if there are errors while reading the database 2020-12-15 10:58:17 +01:00
Olivier Goffart b79e57d1c1
Discovery: fix double emission of finished in case of error 2020-12-15 10:58:17 +01:00
Olivier Goffart 7061f31887
Discovery: Fix downloading files when database is used for local discovery
This also fix the currently failling LockedFilesTest
2020-12-15 10:58:17 +01:00
Olivier Goffart 0eaa950e9e
Remove csync.cpp: It's only dead code 2020-12-15 10:58:17 +01:00
Christian Kamm 0d49056a13
Add Ctrl-L as log window shortcut
F12 is taken on OSX and there's no other way of showing it.
2020-12-15 10:58:17 +01:00
Christian Kamm 9d55590d10
Test: Add test for locked file tracking and propagation 2020-12-15 10:58:17 +01:00
Christian Kamm da178c1352
Folder: Treat file unlock similar to external change #6822
For consistent handling of incoming notifications.
2020-12-15 10:58:17 +01:00
Christian Kamm 815e0fee8f
Propagator: Add assert against duplicate done() calls 2020-12-15 10:58:16 +01:00
Olivier Goffart eb23776f16
Discovery: Fix renaming on windows
buf.type is ItemFileSkip because csync_vio_local_stat does not set this field
2020-12-15 10:58:16 +01:00
Olivier Goffart beee123c80
New Discovery: Fix trailing slash causing failure on windows 2020-12-15 10:58:16 +01:00
Olivier Goffart 60b17cd128
Folder: update the folder version
Since the new index would crash old version of the client, we need to
upgrade folder version so they do not load in the client 2.5.0
2020-12-15 10:58:15 +01:00
Christian Kamm 7de453d439
Settings: Make FoldersWithPlaceholders group sticky
If virtual files are disabled on a folder it might still have db entries
or local virtual files that would confuse older client versions.
2020-12-15 10:58:15 +01:00
Olivier Goffart ab85c60205
owncloudcmd: Read the server version from the capabilities
Issue: #6846
2020-12-15 10:58:15 +01:00
Olivier Goffart 3e4486c078
owncloudcmd: fetch the dav user
This is required to get the new endpoint working when the server
uses ldap or that the dav user is not the same as the login.

Issue #6830
2020-12-15 10:58:15 +01:00
Olivier Goffart ec8c02dad0
Sharing: add the `shareWithAdditionalInfo` string in autocompletion results
Issue #6749
2020-12-15 10:58:15 +01:00
Olivier Goffart 380d7b8028
Migration from 2.4: fallback to move file by file if directory move failled (#6807)
Migration from 2.4: fallback to move file by file if directory move failed

This can happen if the directory already exist because, say, it was
created by the ownCloud outlook plugin which save its file in the same directory
2020-12-15 10:58:15 +01:00
Olivier Goffart e20e1d110f
Move: Fix too many starting slashes in the destination header
QDir::cleanPath does not remove starting slashes on windows.
So use account::davUrl which is already cleaned

Issue: #6824
2020-12-15 10:58:15 +01:00
Olivier Goffart dcfbde2a67
Wizard: Reset the QSslConfiguration before checking the server
Because a previous call with another demain might have set some
config for another server.

Issue #6832
2020-12-15 10:58:14 +01:00
Olivier Goffart b820e46805
Fix compiler warning 2020-12-15 10:58:14 +01:00
Olivier Goffart 35967fc2d6
OAuth2: Refresh the token without aborting the sync
OAuth2 access token typically only has a token valid for 1 hour.
Before this patch, when the token was timing out during the sync, the
sync was aborted, and the ConnectionValidator was then requesting a new
token, so the sync can be started over.
If the discovery takes longer than the oauth2 validity, this means that
the sync can never proceed, as it would be always restarted from scratch.

With this patch, we try to transparently renew the OAuth2 token and restart
the jobs that failed because the access token was invalid.

Note that some changes were required in the GETFile job because it handled
the error itself and so it was erroring the jobs before its too late.

Issue #6814
2020-12-15 10:58:14 +01:00
Olivier Goffart 53a14c2041
HttpCredentials: initialize all member inline 2020-12-15 10:58:14 +01:00
Dominik Schmidt 5d9370594d
Disable autostartCheckBox if autostart is configured system wide 2020-12-15 10:58:14 +01:00
Christian Kamm 00edcf98a1
Discovery: Virtual file handling adjustments
- adjust virtual file path handing
- helpers for vfs suffix adding/removal
- helpers for isDirectory/isVirtual on SyncJournalRecords
- be clear about what PathTuple _local/_server mean
2020-12-15 10:58:14 +01:00
Olivier Goffart 58eaf9940a
Database: Add an index on the parent path
So we can quickly query the items in a parent directory

This uses a custom slite3 function, which means that when downgrading the client,
or using another tool to add entries in the database, any insertion in the metadata
table will produce an error: "unknown function: parent_hash()"
(This will crash the client 2.5)
2020-12-15 10:58:13 +01:00
Olivier Goffart e45e57982d
Add missing export 2020-12-15 10:58:13 +01:00
Christian Kamm b431f4ef0c
Discovery: Fix log output for instructions 2020-12-15 10:58:13 +01:00
Christian Kamm ce420d77a8
Discovery: Don't rebuild invalidFilname regex each call 2020-12-15 10:58:13 +01:00
Christian Kamm 113124cde5
Discovery: Introduce smaller functions 2020-12-15 10:58:13 +01:00
Christian Kamm 4f6f706f40
Excludes: drop csyncTraversalMatchFun()
The new discovery can call the traversal match function directly.
2020-12-15 10:58:13 +01:00
Olivier Goffart a4e139969c
Fix windows build 2020-12-15 10:58:12 +01:00
Olivier Goffart 8490664860
Account Settings: fix progress being written in white when there are errors 2020-12-15 10:58:12 +01:00
Christian Kamm dd34cbc751
Virtual files: Wipe selective sync settings when enabled 2020-12-15 10:58:12 +01:00
Christian Kamm 60de1c9720
virtual files: show option only when branding allows it 2020-12-15 10:58:12 +01:00
Christian Kamm 251e01a440
Virtual files: Use theme to check for option availability 2020-12-15 10:58:12 +01:00
Olivier Goffart 94e63ef7b9
Account Settings: Add a context menu entry to enable or disable virtual files
Issue #6725
2020-12-15 10:58:12 +01:00
Olivier Goffart 18f6e346b8
Upload: Do not error out if the server do not send the X-OC-MTime: accepted header
If the server does not set the mtime, it is not a big problem for the
synchronisation.

The test was used before so we could do a PROPPATCH for server that did not
support this header. But now that all server supports that we don't need to
to the check. (We do not do the PROPPATCH since we got rid of the neon
dependency)

Apparently, it may happen that some backend don't support setting mtime
and this can lead to this error.

https://github.com/owncloud/client/issues/6797
2020-12-15 10:58:11 +01:00
Olivier Goffart 15eab07866
OAuth2: Store 'Account::davUser' in the config, and use that user for connecting
We need to use the user id to check if we are connected to the right account.
These might be different from the HTTP Basic Auth login. (LDAP setups)

When the account was configured as an oauth2 account form the wisard, the
http_user was already set correctly to the user id. But when the server is
upgrading from basic auth to oauth2, we need to pick the right login.

Note that Account::davUser() already defaults to the HTTP user when none
is set, so this means the upgrade will be fine if this is not set in the
config.

Issues:
https://github.com/owncloud/oauth2/issues/109
https://github.com/owncloud/enterprise/issues/2781
2020-12-15 10:58:11 +01:00
Olivier Goffart 75f66ddaa1
Local discovery: always recurse within touched directory
If the file system watcher tells us a directory was modified, we should
recurse into it because it means it is probably a new directory

Issue #6804
2020-12-15 10:58:11 +01:00
Christian Kamm e10e953c66
PropagateUpload: Avoid crash due to cascading aborts
https://sentry.io/owncloud/desktop-win-and-mac/issues/698694072/activity/
2020-12-15 10:58:11 +01:00
Christian Kamm d1aedcfd3c
Discovery: restructure processFileAnalyzeLocalInfo 2020-12-15 10:58:10 +01:00
Christian Kamm a2839bd40a
Discovery: easy conditions first in processFileAnalyzeRemoteInfo
Removing two levels of indent that way
2020-12-15 10:58:10 +01:00
Christian Kamm 76341904e9
Discovery: Add comments 2020-12-15 10:58:10 +01:00
Olivier Goffart 5a1c93d0ac
Discovery: make sure finished is not called twice, even in case of errors 2020-12-15 10:58:10 +01:00
Olivier Goffart b86e1efc9a
Remove the backup deteciton code which was used for server < 9.1 2020-12-15 10:58:10 +01:00
Olivier Goffart f666511a4b
Discovery: Remove stale DB entries
And test the Remove/Remove case.

This means we need to always query the database for all the entries.
This showed another small bug in the test in which sync item for virtual
files at the root could have a slash in front of them.
2020-12-15 10:58:10 +01:00
Christian Kamm 5683278fab
Discovery: Comments and visibility adjustments 2020-12-15 10:58:09 +01:00
Olivier Goffart aa18e10ff5
Discovery: cleanups and comments 2020-12-15 10:58:09 +01:00
Olivier Goffart b10b3e5eeb
Discovery: move checkMovePermissions to its own function 2020-12-15 10:58:09 +01:00
Olivier Goffart edd866b32b
Discovery: Adjust the instruction in case of resolved conflict
When resolving a conflict because the file was just updated on the server,
we write all the metadata on the database immediatly, so INSTRUCITON_NONE
is enough and UPDATE_METADATA is not needed
2020-12-15 10:58:09 +01:00
Olivier Goffart 7cddaf82ab
ProcessDirectoryJob: always set _childModified to true, regardless the direction
This was like that to handle the case of CSYNC_INSTRUCTION_TYPE_CHANGE, but just add
a condition in this location.
2020-12-15 10:58:09 +01:00
Olivier Goffart 46510c2f39
Discovery phase: refactor some code in DiscoveryPhase::findAndCancelDeletedJob
Less code duplication
2020-12-15 10:58:09 +01:00
Olivier Goffart 1c2a3279bb
New Discovery Algorithm: more cleanups
- rename progress() to be more explicit
 - Make some more member of the discovery phase private
2020-12-15 10:58:09 +01:00
Olivier Goffart 2f8c77c54f
Fixup commit 835c9163374f42003aa2f7795ade3f4ff62c8877
The previous code considered the also HTTP 207 code without the
application/xml header to have this message.
httpCode 0 does not make much sense anyway.

This change the behavior to consider any 2xx without the xml header
to show this error message
2020-12-15 10:58:08 +01:00
Olivier Goffart c009dae1ce
New discovery algorithm: fixups
Adapt reviews from ckamm in https://github.com/owncloud/client/pull/6738#pullrequestreview-164623532

- SyncJournalFileRecord: initialize everything inline
- Add more comments
- And some ENFORCE
2020-12-15 10:58:08 +01:00
Olivier Goffart 059f722b3b
Move Result to its own header 2020-12-15 10:58:08 +01:00
Olivier Goffart afed46afcc
New discovery algorithm: Parallel PROPFIND 2020-12-15 10:58:08 +01:00
Olivier Goffart c8eff3da2d
New Discovery algorithm: Remove the sync cleanup phase
Since we do not recurse within some directories, many files are not seen.

The stale entry will cleanup by themself as the sync engine try to remove
the files that are already removed.
Should we need to actually do this cleanup, it should be dotected in the
discovery.
2020-12-15 10:58:08 +01:00
Olivier Goffart 35c0cf4e59
New discovery algorithm: Set the originalFile for ignored files
This is used to show the name in the UI
2020-12-15 10:58:08 +01:00
Olivier Goffart 52dcfcb166
New Propagation algorithm: Fetch, and emit, the root etag
Remove the feature to concatenate etags as servers that don't
have a root etag are no longer suported
2020-12-15 10:58:07 +01:00
Olivier Goffart d25d87e92c
New Discovery Algorithm: Ge tthe size of new folders
Also add a test that this works properly
2020-12-15 10:58:07 +01:00
Olivier Goffart ef542ac83d
New Discovery algorithm: Split the process function even further
Move the finialization in its own function.
This allow to save a bit of code duplication.

Also change the order of the parameter in the constructor for consistency
2020-12-15 10:58:07 +01:00
Olivier Goffart fc69dda246
New Discovery Algo: Refactor by splitting the processFile in two 2020-12-15 10:58:07 +01:00
Olivier Goffart b7d827d6d0
New Discovery Algorithm: Handle rename of virtual files 2020-12-15 10:58:07 +01:00
Christian Kamm e58a25d7c5
Virtual files: Renames propagate #6718 2020-12-15 10:58:07 +01:00
Olivier Goffart 3289675b8d
Folder Wizard: Disable the 'choose what to sync' treeview if virtual files are selected
Don't allow to configure virtual files with a selective sync blacklist
2020-12-15 10:58:07 +01:00
Olivier Goffart d8fa8e270f
AccountSetting: Fix Small Memoy leak 2020-12-15 10:58:06 +01:00
Olivier Goffart 0ba9dc7dd1
AccountSettings: Force sync should wipe the blacklist
Issue #6757
2020-12-15 10:58:06 +01:00
Olivier Goffart 68ace415d4
Virtual files: don't check for new big folders
https://github.com/owncloud/client/issues/6724#issuecomment-417368475
2020-12-15 10:58:06 +01:00
Olivier Goffart 75a57778d9
Virtual files: Don't show selective sync
Issue #6724
2020-12-15 10:58:06 +01:00
Olivier Goffart 46aa8fd1f8
Socket API: add an option to replace existing files with virtual files
Issue #6726
2020-12-15 10:58:06 +01:00
Olivier Goffart afc953b649
Update the minimum supported version
We want to warn if the server version is not supported and did not get
appropriate QA for this client version.

https://github.com/owncloud/enterprise/issues/2687
2020-12-15 10:58:05 +01:00
Markus Goetz 811ac50c05
CMakeLists.txt: Log the Qt version in compile 2020-12-15 10:58:05 +01:00
Christian Kamm 6b571b609c
Conflicts: Rename BasePath to InitialBasePath #6709 2020-12-15 10:58:05 +01:00
Olivier Goffart d81ccbb0c1
Checksum: Add support for SHA256 and SHA3
In case, some day, the server also supports it
2020-12-15 10:58:05 +01:00
Olivier Goffart bf6e4174c8
Move the checksum related routine from FileSystem to checksum, where they belong 2020-12-15 10:58:05 +01:00
Olivier Goffart 198b65e9fc
Fix a compilation error on windows 2020-12-15 10:58:05 +01:00
Olivier Goffart 21fe54fb13
New Discovery Algo: readability improvements
As proposed by ckamm on #6738
2020-12-15 10:58:04 +01:00
Olivier Goffart 3a06a7978f
New discovery algo: data finger print 2020-12-15 10:58:04 +01:00
Olivier Goffart 5683f1c33d
New Disco Algo: Handle spurious virtual files
Port commit 0b9049e6ff
for issue #6718
2020-12-15 10:58:04 +01:00
Olivier Goffart c3f745fa76
Conflict handling: add the OC-ConflictBasePath header
Issue #6702
2020-12-15 10:58:04 +01:00
Olivier Goffart 358aadfb98
Account Settings: Add a text for folder using vierual files
Issue #6723
2020-12-15 10:58:04 +01:00
Olivier Goffart 73d933115a
Virtual Files: Set the mtime of the virtual file to that of the server
Note: When the server mtime is modified, the mtime of the file is not updated

Issue #6727
2020-12-15 10:58:04 +01:00
Olivier Goffart a17a2a9c06
Virtual Files Mime Type: use "vnd." prefix instead of "x-"
As reported in https://github.com/owncloud/client/issues/6717#issuecomment-413703567
2020-12-15 10:58:03 +01:00
Christian Kamm c10f103fb8
Virtual files: Renaming to virtual doesn't delete data #6718
Unfortunately to do this, the local update phase must write to the
database, creating a new side-effect and order dependency (local update
must run before remote update).
2020-12-15 10:58:03 +01:00
Christian Kamm be0fa72fcb
RemotePermissions: Fix empty vs null
Fixes two bugs that appeared since the introduction of the struct:
- when reading permissions from the journal, null ("") was read as
  empty-not-null
- when reading permissinos from the server, empty ("") was read as null

Addresses #4608
2020-12-15 10:58:03 +01:00
Olivier Goffart 4837bc8d60
FolderStatusModel: Do not abort applying selective sync if one folder has an error
Issue #6675
2020-12-15 10:58:03 +01:00
Olivier Goffart 732069aaa7
SyncEngine: Fix the "direction" of the "all file delted" message when the server is reset
Using the direction of the "first" item is not enough as it might be a directory
which is a UPDATE_META_DATA,  or there can have been a few changes locally as well.

As reported on https://github.com/owncloud/client/issues/6317#issuecomment-412163113
2020-12-15 10:58:02 +01:00
Christian Kamm f6ca649308
Do not require server replies to contain an mtime
The check was added for #6317 in commit
13eb64584f.

We did see missing mtimes in replies in tests with live servers though.
Possibly those were old incomplete responses cached in the stat cache?
2020-12-15 10:58:02 +01:00
Olivier Goffart 9401273daf
New discovery algorithm: Call FolderDiscovered 2020-12-15 10:58:02 +01:00
Olivier Goffart a36ed56f01
New Discovery algorithm: Refactor a bit the way the signal are emited 2020-12-15 10:58:02 +01:00
Olivier Goffart 8f3ce6e520
Fix TestDownload: _ignore_hidden_files was not properly initialized 2020-12-15 10:58:02 +01:00
Olivier Goffart b6487181c6
New Discovery Phase: fix a few FIXME
Some FIXME were already fixed.
2020-12-15 10:58:02 +01:00
Olivier Goffart 9863500ec1
New discovery algorithm: handle symlinks 2020-12-15 10:58:01 +01:00
Olivier Goffart a9ec521bf1
New discovery algo: Handle Database error 2020-12-15 10:58:01 +01:00
Olivier Goffart 1bcbcd407c
New discovery phase: read the direct download URL and Cookie 2020-12-15 10:58:01 +01:00
Olivier Goffart ca32eb1cf7
More cleanup of csync remains 2020-12-15 10:58:01 +01:00
Olivier Goffart ac24cdbde6
New Discovery Algo: Permsission check 2020-12-15 10:58:01 +01:00
Olivier Goffart 0a6d2d0f46
Remove csync_update and csync_reconcile
I guess some other csync utilities can also be remove dnow but
that will be for later
2020-12-15 10:58:00 +01:00
Olivier Goffart 57068b0fd9
New Discovery Algorithm: handle server errors 2020-12-15 10:58:00 +01:00
Olivier Goffart 4031fb6d5b
Backport 64014dd374 2020-12-15 10:58:00 +01:00
Olivier Goffart 75a1f2d089
Convert p7.pl to a C++ test
This is just a translation of test/scripts/txpl/t7.pl to C++ using the test
framework.
2020-12-15 10:58:00 +01:00
Olivier Goffart f4a5167812
New Discovery Algo: Support the DatabaseAndFilesystem mode for local discovery 2020-12-15 10:57:59 +01:00
Olivier Goffart 370923791d
New Disco algortihm: Fix TestChunkingNG::connectionDroppedBeforeEtagRecieved
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:57:59 +01:00
Olivier Goffart 710934bdbd
New disco algo: Fix TestSyncFileStatusTracker 2020-12-15 10:57:59 +01:00
Olivier Goffart f926248937
New discovery algorithm: More work on virtual files 2020-12-15 10:57:59 +01:00
Olivier Goffart 35e40b58ca
New Disco algorithm: Type change (file to dir) 2020-12-15 10:57:59 +01:00
Olivier Goffart 1e8c37d3d6
New discovery algorithm: Virtual files
The commented tests lines were implementation details
2020-12-15 10:57:59 +01:00
Olivier Goffart 22d989e272
New discovery algorithm: Fix directory deletion
TestAllFilesDeleted passes
2020-12-15 10:57:59 +01:00
Olivier Goffart d54e00488a
New Discovery algorithm
Some error handling. In particular for the case where there is a conflict
between files and directories.

SyncEngineTest and SyncMoveTest passes
2020-12-15 10:57:58 +01:00
Olivier Goffart a384a2d1cb
New Discovery algorithm: Handle of move within a moved directory 2020-12-15 10:57:58 +01:00
Olivier Goffart bdd1e72dda
New discovery algoritmh: more on Renames 2020-12-15 10:57:58 +01:00
Olivier Goffart f43d07dc05
New Discovery algorithm: Check that the original file is still on the server while renaming 2020-12-15 10:57:58 +01:00
Olivier Goffart 7e36cc3fcb
New disco algorithm: Fix some moving
Fix TestSyncMove::testSelectiveSyncMovedFolder
2020-12-15 10:57:58 +01:00
Olivier Goffart 5a57a36729
New discovery algorithm: Local rename 2020-12-15 10:57:58 +01:00
Olivier Goffart f9a9be59e6
New discovery algo: Remote move
TestSyncMove::testRemoteChangeInMovedFolder
2020-12-15 10:57:57 +01:00
Olivier Goffart 92ddc60900
Handle Encoding Problems
TestSyncEngine now passes
2020-12-15 10:57:57 +01:00
Olivier Goffart 501da58b10
Ignore Hidden Files 2020-12-15 10:57:57 +01:00
Olivier Goffart 8bf69cf0cd
Port the invalid napme regexp
TestSyncEngine::testInvalidFilenameRegex
2020-12-15 10:57:57 +01:00
Olivier Goffart 9efd21d70b
More progress
TestSyncEngine::testFakeConflict / TestSyncEngine::testSyncFileItemProperties
2020-12-15 10:57:57 +01:00
Olivier Goffart e934f6b27b
New discovery algo
Make TestSyncEngine::testSelectiveSyncBug pass
2020-12-15 10:57:57 +01:00
Olivier Goffart 4066c1a004
New discovery: TestSyncEngine::testEmlLocalChecksum 2020-12-15 10:57:57 +01:00
Olivier Goffart 9bf417d930
New discovery algorithm
Some progress:
TestSyncEngine::testDirUpload
2020-12-15 10:57:56 +01:00
Olivier Goffart ec681ab2a5
New discovery algorithm: Initial work.
SyncEngineTest testFileDownload is passing
2020-12-15 10:57:56 +01:00
Kevin Ottens ba0d465e47
Revert "Merge pull request #1454 from nextcloud/syncjournal-del-prio"
This reverts commit d9fd9cfef2, reversing
changes made to 2dcf594fc6.
2020-12-15 10:57:56 +01:00
Dominik Schmidt 07f331717f
Rename ocsync library to ${APPLICATION_EXECUTABLE}_csync 2020-12-15 10:57:56 +01:00
Dominik Schmidt aad928a6be
Install libocsync to lib/ without subfolder.
Installing to lib/${APPLICATION_EXECUTABLE} has caused a bunch of
irritations in the past and subtle annoying to fix bugs. To avoid name
clashes with branded clients ${APPLICATION_EXECUTABLE} becomes now
part of the filename instead of the subfolder.

The concrete motivation to change this now is that on Windows there
is no RPATH and it's not possible to run owncloud directly from the
Craft Root folder, which is nice when you're developing on Windows.

It would have been possible to change this just for Windows but as
written earlier this has caused lots of issues and thus I think it's
a good idea to just stay consistent accross platforms when touching it.
2020-12-15 10:57:56 +01:00
Olivier Goffart 0155a4fa73
Wizard + OAuth: Make opening a new browser after clicking back works again
Issue #6574

When there is an error in the advanced page, OwncloudAdvancedSetupPage::updateStatus
(and others) call completeChanged(), which is connected to
QWizardPrivate::_q_updateButtonStates which will re-enable the back button from the
last page.

When the user click "back" and re-open the browser, the account's credentials
already have a oauth token set. So the call to the API to get a new token fails
because we use the previous token instead of using the client's secret_id.
Fix this with the HttpCredentials::DontAddCredentialsAttribute.

Now, this is still not working because the session cookies are confusing the
server.  So we'll clear the cookies when re-opening the browser
2020-12-15 10:57:55 +01:00
Olivier Goffart 0d21936e95
FolderStatusModel: Fix crash when there is an error while expanding folders
In FolderStatusModel::slotLscolFinishedWithError, the call to parentInfo->resetSubs
deleted the 'job' and the reply 'r' which we accessed later to get the error code.

Fix this problem twice by
 1) Get the error code before caling resetSubs
 2) in FolderStatusModel::SubFolderInfo::resetSubs, call deleteLater instead of delete

Regression introduced in commit d69936e0

Issue #6562
2020-12-15 10:57:55 +01:00
Olivier Goffart cf3846c565
csync: refactor csync_s::error_string to avoid valgrind error
The problem here is that we were sometimes allocating the error_string with
qstrdup, which need to be released with delete[] and not free().

Simplify the code by using QString instead.

```
==7230== Mismatched free() / delete / delete []
==7230==    at 0x4C2E10B: free (vg_replace_malloc.c:530)
==7230==    by 0x57C2321: csync_s::reinitialize() (csync.cpp:247)
==7230==    by 0x548130F: OCC::SyncEngine::finalize(bool) (syncengine.cpp:1212)
==7230==    by 0x5481223: OCC::SyncEngine::handleSyncError(csync_s*, char const*) (syncengine.cpp:746)
==7230==    by 0x5483E78: OCC::SyncEngine::slotDiscoveryJobFinished(int) (syncengine.cpp:965)
==7230==    by 0x5495E34: QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<int>, void, void (OCC::SyncEngine::*)(int)>::call(void (OCC::SyncEngine::*)(int), OCC::SyncEngine*, void**) (qobjectdefs_impl.h:134)
==7230==    by 0x5495D92: void QtPrivate::FunctionPointer<void (OCC::SyncEngine::*)(int)>::call<QtPrivate::List<int>, void>(void (OCC::SyncEngine::*)(int), OCC::SyncEngine*, void**) (qobjectdefs_impl.h:167)
==7230==    by 0x5495CB5: QtPrivate::QSlotObject<void (OCC::SyncEngine::*)(int), QtPrivate::List<int>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (qobjectdefs_impl.h:396)
==7230==    by 0xA9BF2E1: QObject::event(QEvent*) (in /usr/lib/libQt5Core.so.5.11.0)
==7230==    by 0x64BE983: QApplicationPrivate::notify_helper(QObject*, QEvent*) (in /usr/lib/libQt5Widgets.so.5.11.0)
==7230==    by 0x64C625A: QApplication::notify(QObject*, QEvent*) (in /usr/lib/libQt5Widgets.so.5.11.0)
==7230==    by 0xA994BC8: QCoreApplication::notifyInternal2(QObject*, QEvent*) (in /usr/lib/libQt5Core.so.5.11.0)
==7230==  Address 0x225b2640 is 0 bytes inside a block of size 50 alloc'd
==7230==    at 0x4C2DC6F: operator new[](unsigned long) (vg_replace_malloc.c:423)
==7230==    by 0xA7E8FC8: qstrdup(char const*) (in /usr/lib/libQt5Core.so.5.11.0)
==7230==    by 0x53F5750: OCC::DiscoveryJob::remote_vio_opendir_hook(char const*, void*) (discoveryphase.cpp:666)
==7230==    by 0x57E1278: csync_vio_opendir(csync_s*, char const*) (csync_vio.cpp:39)
==7230==    by 0x57D718F: csync_ftw(csync_s*, char const*, int (*)(csync_s*, std::unique_ptr<csync_file_stat_s, std::default_delete<csync_file_stat_s> >), unsigned int) (csync_update.cpp:674)
==7230==    by 0x57C1B05: csync_update(csync_s*) (csync.cpp:109)
==7230==    by 0x53F5BCC: OCC::DiscoveryJob::start() (discoveryphase.cpp:718)
==7230==    by 0x54B8F74: OCC::DiscoveryJob::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (moc_discoveryphase.cpp:494)
==7230==    by 0xA9BF2E1: QObject::event(QEvent*) (in /usr/lib/libQt5Core.so.5.11.0)
==7230==    by 0x64BE983: QApplicationPrivate::notify_helper(QObject*, QEvent*) (in /usr/lib/libQt5Widgets.so.5.11.0)
==7230==    by 0x64C625A: QApplication::notify(QObject*, QEvent*) (in /usr/lib/libQt5Widgets.so.5.11.0)
==7230==    by 0xA994BC8: QCoreApplication::notifyInternal2(QObject*, QEvent*) (in /usr/lib/libQt5Core.so.5.11.0)
==7230==
```
2020-12-15 10:57:55 +01:00
Olivier Goffart 857afd32df
PropagateDownload: Don't discard the body of error message
We want to keep the body so we can get the message from it
(Issue #6459)

TestDownload::testErrorMessage did not fail because the FakeErrorReply
did not emit readyRead and did not implement bytesAvailable.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:57:55 +01:00
Olivier Goffart 4ee244190b
Virtual Files: Allow to download a folder recursively from the socket API
Issue: #6466
2020-12-15 10:57:54 +01:00
Christian Kamm 6dba2e8b06
Virtual files: Wipe virtual after download completes, not before
Otherwise a interrupted or unsuccessful download would mean that the
download-intend was forgotten. The next sync would reestablish the
virtual file instead.
2020-12-15 10:57:54 +01:00
Olivier Goffart 530614bf78
Rename SocketApi::FileData::accountRelativePath to serverRelativePath
As discussed in issue #6552
2020-12-15 10:57:54 +01:00
Olivier Goffart ced5dfb8ee
Share dialog: use the original name and not the virtual file name
When sharing a virtual file, we should actually use the original file name
not the virtual file name

Issue: #6461
2020-12-15 10:57:54 +01:00
Christian Kamm a6c19572a2
Virtual files: Only remove virtual file once on download
With thanks to @ogoffart for spotting the problem.
2020-12-15 10:57:54 +01:00
Christian Kamm 97f7b5abeb
Settings migration: Preserve future settings where possible
See discussion in #6506
2020-12-15 10:57:54 +01:00
Christian Kamm 87ba4e6b9c
Config: Add version flags to accounts and folders
Also, if there is too-new configuration, backup the file, show a
warning message asking the user whether it's ok to discard the
configuration from the future.

See #6504
2020-12-15 10:57:53 +01:00
Christian Kamm aa6f5f59c4
Rename Placeholders to Virtual Files in code #6531 2020-12-15 10:57:53 +01:00
Olivier Goffart a877a9d472
SyncRunFileLog: Add the requestid
https://github.com/owncloud/client/pull/6427#issuecomment-383879509
2020-12-15 10:57:53 +01:00
Olivier Goffart 09cacc4cd4
Blacklist: remember the X-Request-ID
Issue #6420
Store the X-Request-ID in the SyncFileItem and also in the blacklist.
Note that for consistency reason, the X-Request-ID is also in the
SyncFileItem if the request succeeds.

Currently there is no UI to access it, but it can be queried with sql
commands
2020-12-15 10:57:53 +01:00
Christian Kamm 7da4bb4c20
Wizard: Add a "(recommended)" to the main option #6470 2020-12-15 10:57:53 +01:00
Christian Kamm ddeeecd061
Rename "placeholder" feature 2020-12-15 10:57:53 +01:00
Christian Kamm 4e3f2f755a
Placeholder: Stop adding ignore pattern
Because we can't make older clients preserve the version directive that
was attached to it.

See #6504 and #6498
2020-12-15 10:57:52 +01:00
Christian Kamm 8b6ac63ddb
Placeholder: Don't contain "stub" 2020-12-15 10:57:52 +01:00
Christian Kamm 27b65cbc69
Placeholders: Save to key that's invisible to <2.5 clients #6504 2020-12-15 10:57:52 +01:00
Olivier Goffart 3272f3b72b
FolderWizard: fix crash when experimental feature are disabled
The _placeholderCheckBox only exists if the experimental features are enabled

Found via the crash reporter
https://sentry.io/owncloud/desktop-win-and-mac/issues/556407777/
2020-12-15 10:57:52 +01:00
Markus Goetz 215afba89e
Share Dialog: Disable workaround for macOS too #6185 2020-12-15 10:57:52 +01:00
Markus Goetz 8dcfd50a7d
Placeholders: Support for macOS #6290 2020-12-15 10:57:51 +01:00
Christian Kamm 765c12dae1
LocalDiscoveryTracker: Separate from Folder and move to libsync
To allow relevant code to be closer together and for testing in
unittests without having to get a gui Folder.

See #6120
2020-12-15 10:57:51 +01:00
Olivier Goffart 7969067f80
Logger: Guard zlib usage by ZLIB_FOUND
Similar to the use for the checksum.
I know that zlib is required in principle, but i don't have it
in one of my test building environment, and it is easier to just
disable it.
2020-12-15 10:57:51 +01:00
Kevin Ottens b1dc14977f
Get TestDownload to pass
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:57:51 +01:00
Olivier Goffart 4eb8997519
Download: Remove useless code and add a test
From issue #7015, the code is wrong because the path is the file system path and
not the path on the DB.
But since this is a conflict, this means the reconcile will still want to download
the file from the server next sync, so we need not to worry about this case
2020-12-15 10:57:50 +01:00
Olivier Goffart 718843ffce
Download: Use the <s:message> from the reply in the error message if any
Issue: #6459
2020-12-15 10:57:50 +01:00
Christian Kamm 27c8bce0b9
Wizards: Show placeholder option only if showExperimentalOptions is set
This config file option will also control other features in the future.
2020-12-15 10:57:50 +01:00
Christian Kamm aee8b9f3c5
Wizards: Add placeholder option and warning to account wizard
Also add the warning dialog to the option in the folder wizard.
2020-12-15 10:57:50 +01:00
Christian Kamm 7dc65b060d
NSIS: Register placeholder extension
Also change the placeholder suffix config option to not include the dot,
the dotless form is needed in the nsis script.
2020-12-15 10:57:50 +01:00
Christian Kamm 6a37a7a42c
Placeholders: Fix migration issues
Some edgecases weren't covered and didn't have tests yet.
2020-12-15 10:57:49 +01:00
Christian Kamm 40f2303166
SyncOptions: Add default placeholder suffix
Otherwise each test has to set this up anew.
2020-12-15 10:57:49 +01:00
Christian Kamm 12d6f680f2
Placeholders: Ignore placeholder files in older clients
To do this, we add the placeholder extension to the user exclude file
automatically. However, newer clients shouldn't use that exclude
pattern: so we also add version directives that allow making exclude
patterns dependent on the client version.
2020-12-15 10:57:49 +01:00
Christian Kamm d6078f958b
Placeholders: Download from shell integration 2020-12-15 10:57:49 +01:00
Olivier Goffart 91f53521ae
Placeholder: The extension is now a branding option 2020-12-15 10:57:49 +01:00
Olivier Goffart a2bdd5b9a5
Placeholders: Fixup clicking on placeholder after previous change
Now that the name in the db is the name of the placeholder file,
we need to adjust the call to downloadPlaceholder
2020-12-15 10:57:49 +01:00
Christian Kamm b1de184bc8
Placeholders: Safe migration to older client versions
Now the db entries for placeholders will have the full placeholder
paths. That way older clients will, on remote discovery, delete the
placeholders and download the real files.
2020-12-15 10:57:48 +01:00
Christian Kamm 0cd83a2c09
Placeholders: Deal with conflicts when a placeholder exists
So "foo.owncloud" exists but the user adds a new "foo".
2020-12-15 10:57:48 +01:00
Olivier Goffart d233e5f8d7
Placeholders: install mimetype on linux 2020-12-15 10:57:48 +01:00
Olivier Goffart 7eeb99ba24
Placeholders: Add an checkbox in the FolderWizard to enable the placeholder feature 2020-12-15 10:57:48 +01:00
Olivier Goffart 1049fb74d9
Placeholders: Move the placeholder option from the account to the folder 2020-12-15 10:57:48 +01:00
Olivier Goffart 6ce7c7a56b
PlaceHolders: Trigger a download of the placeholder and open it 2020-12-15 10:57:48 +01:00
Christian Kamm f5cf03b6a6
On-demand downloading: Placeholder-file based prototype
- Controled by an option.
- New remote files start out as ItemTypePlaceholder, are created with a
  .owncloud extension.
- When their db entry is set to ItemTypePlaceholderDownload the next
  sync run will download them.
- Files that aren't in the placeholder state sync as usual.
- See test cases in testsyncplaceholders.

Missing:
- User ui for triggering placeholder file download
- Maybe: Going back from file to placeholder?
2020-12-15 10:57:43 +01:00
Kevin Ottens 8c4bd2bb52 Ensure a sync happens after a conflict resolution
You'd expect that after a conflict resolution the file watcher would
pick up the change and trigger a sync. For some reason it doesn't seem
to happen on at least some Ubuntu systems. In such cases the user would
then still have a stale conflict entry in the activity list and wouldn't
be able to do anything with it.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 09:40:57 +00:00
Kevin Ottens d640076454 UserModel: check indices are inside the user list
The model was just checking for the user list being empty or not which
is overly optimistic. Indeed there might be cases where the id is
actually outside the boundaries so properly check for this.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 08:43:32 +00:00
Kevin Ottens 5ed397a430
Have the new account wizard open again
UserModel can't be connected to AccountSettings if the settings dialog
doesn't exist. This is the case now since we delay the creation of that
dialog and free it after use.

Instead it should be properly channeled through the Systray object all
the way up to OwncloudGui which knows how to handle this properly.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-14 15:58:52 +01:00
Camila b4dc682690
Handle the warning message when unchecking folders for syncing.
Split widgets and slot to handle the refreshing of the view:
- refreshSelectiveSyncStatus is connected to signal dirtyChanged
and will handle big folder warning.
- slotSelectiveSyncChanged  which is connected to dataChanged signal
and will handle the selective sync warning. It fixes #1029 because
it looks for the checkbox state before showing the warning.

Signed-off-by: Camila <hello@camila.codes>
2020-12-14 12:36:51 +01:00
Camila cfbd22b5e7
Use the icon color property to color the icons in the tray window header.
The icon color is set with APPLICATION_WIZARD_HEADER_TITLE_COLOR in the
theme.

Signed-off-by: Camila <hello@camila.codes>
2020-12-10 17:43:45 +01:00
allexzander 9266ecc2e8 Fixed slow sharee search in the share dialog
Signed-off-by: allexzander <blackslayer4@gmail.com>
2020-12-08 13:48:43 +00:00
allexzander 6e8658dc2c Added sharing via email.
Signed-off-by: allexzander <blackslayer4@gmail.com>
2020-12-08 11:08:45 +02:00
Camila 5517ff2c02
Add debug log to check which folders are being skipped during syncing.
Signed-off-by: Camila <hello@camila.codes>
2020-12-03 12:24:25 +01:00
allexzander f04281cb69 Implemented notification action buttons and context menu for confirm/dismiss and other actions.
Signed-off-by: allexzander <blackslayer4@gmail.com>
2020-12-02 08:08:37 +00:00
Brian Kendall f9991e180c Fix macOS bug where tray window causes spaces to switch
Signed-off-by: Brian Kendall <brian@briankendall.net>
2020-12-02 06:54:16 +00:00
Camila bdd3465e7b
Check if there are patterns associated with a sync exclude file.
The previous check didn't take into the account that .sync-exclude.lst
might be empty which would crash at Q_ASSERT(_allExcludes.contains(basePath))
in the prepare function. It also takes into account that
_allExcludes[basePath] was creating new items in the list.

Signed-off-by: Camila <hello@camila.codes>
2020-11-26 12:12:04 +01:00
Camila 998e93ac13
Add last / to exclude list file path.
This Q_ASSERT(this->endsWith('/')) in BasePathByteArray was the reason
for bug report #1458.

Signed-off-by: Camila <hello@camila.codes>
2020-11-26 12:11:57 +01:00
Dominik Schmidt a50c665051
Simplify Sparkle handling in CMake 2020-11-25 09:43:59 +01:00
Chih-Hsuan Yen 6962cbf582
Fix build without Sparkle.framework
(PR #6567)
2020-11-25 09:40:20 +01:00
Christian Kamm 60d3696ccd
Settings: Add warning when switching update channel 2020-11-25 09:39:16 +01:00
Kevin Ottens 4906353f2e Please the clang-tidy overlord
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-11-24 18:22:33 +00:00
Hannah von Reth 038644f378 Don't scare users with critical parser log messages 2020-11-24 18:22:33 +00:00
Hannah von Reth d30cd0f0fd Include architecture in updater query
Fixes: #8074
2020-11-24 18:22:33 +00:00
Hannah von Reth c76095859a Cleanup stirngs 2020-11-24 18:22:33 +00:00
Olivier Goffart a7f010c370 Updater: Fix crash when there is an XML error
The problem was accessing the lines with an off by one error, while printing
the log.

Other problem included the fact that QDebug added spaces, quotes, and other
things which made the error lot look right in the console.

Issue #7545
2020-11-24 18:22:33 +00:00
Olivier Goffart 1bf895cadc Updater: Fix Version numer not shown in the user visible string
There was one argument too many in the string.
Bug was introduced in commit 21ac396b

Issue: #7288
2020-11-24 18:22:33 +00:00
Christian Kamm c58f00abc7 Updater: Improved logging output #7388 2020-11-24 18:22:33 +00:00
Hannah von Reth 1df3f5b6df NSISUpdater: Improve logging for version comparison 2020-11-24 18:22:33 +00:00
Hannah von Reth 1aca005267 Updater: Log parsing issues in autoupdatLog parsing issues in autoupdatee 2020-11-24 18:22:33 +00:00
Markus Goetz 9a375211d7 Autoupdater: Log the URL #3475 2020-11-24 18:22:33 +00:00
Christian Kamm d2991210c5 Updater: Preserve target version string
For #7217
2020-11-24 18:22:33 +00:00
Christian Kamm aa7409f401 Updater: Make "Update manually" not also "skip this version"
See #7217
2020-11-24 18:22:33 +00:00
Christian Kamm 0b3512f49c WinUpdater: More useful options on update failure #7217
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-11-24 18:22:33 +00:00
Olivier Goffart 9596eb7f20 Updater: show the human readable version in the settings
The xml looks like this:

   <version>2.5.0.328</version>
   <versionstring>ownCloud Client 2.5.0 alpha1 (build 238)</versionstring>

And we should show the version string

Issue #6602
2020-11-24 18:22:33 +00:00
Olivier Goffart f2c3ef741b Updater: remove unused function 2020-11-24 18:22:33 +00:00
Dominik Schmidt ae38b88d1c Remove unused installers before copying new ones into the appdata dir 2020-11-24 18:22:33 +00:00
Olivier Goffart e93972824d MSI: Fix crash in the auto updater
'auto' here is a QStringBuilder referencing a temporary

Ammend commit 150d4f5935
(MSI: Always with logfile #6609)

Found in the crash reporter:
https://sentry.io/owncloud/desktop-win-and-mac/issues/623245771/
2020-11-24 18:22:33 +00:00
Markus Goetz 5e518419de MSI: Always with logfile #6609 2020-11-24 18:22:33 +00:00
Dominik Schmidt d069fda9ab Extract filename of updateFile without leading slash 2020-11-24 18:22:33 +00:00
Dominik Schmidt dfac8c0e59 Escape msi and owncloud.exe path (who knows...) 2020-11-24 18:22:33 +00:00
Dominik Schmidt ed0dc68db2 Run msi properly and restart client after update 2020-11-24 18:22:33 +00:00
Dominik Schmidt 08b5981fb6 Implement basic .msi support in updater 2020-11-24 18:22:33 +00:00
Markus Goetz 412e43b696 Updater: Comments 2020-11-24 18:22:33 +00:00
Christian Kamm 4b39731c27 Updater: Make sparkle updater respect release channel 2020-11-24 18:22:33 +00:00
Markus Goetz 311e3a3bd8 Auto Updater: Show UI element also on macOS
(cherry picked from commit dfdc2e1e87f99d387a042f4983c999fbb7fcf3d9)
2020-11-24 18:22:33 +00:00
Christian Kamm a8ad946758 Settings: Add update channel combobox #6259 2020-11-24 18:22:33 +00:00
Markus Goetz 65035d1990 Sparkle: Delegate calls work now with 1.18.1 (maybe even before)
We can extend on this to give UI feedback.
2020-11-24 18:22:33 +00:00
Christian Kamm 08014b6dc3 FolderWatcher: Disable test on OSX #7305 2020-11-24 16:56:49 +00:00
Olivier Goffart 5a432a193f FolderWatcher: Usage of QTime for elapsed time is deprecated 2020-11-24 16:56:49 +00:00
Christian Kamm 28e4fc54a1 FolderWatcher: Wait for ready before testing #7305 2020-11-24 16:56:49 +00:00
Christian Kamm e97fc430bf FolderWatcher: Become unreliable if test notification fails #7241
Necessary for some filesystems on windows that don't have full file
watching capabilities.
2020-11-24 16:56:49 +00:00
Christian Kamm 74382ddcc0 FolderWatcher linux: Make automatically recursive #7068
Previously it depended on addFolder() / removeFolder() calls to adjust
watchers when new folders were added or removed. There also needed to be
complex move handling.

Now, any folder creation/move-in notifications automatically trigger
watcher additions and folder deletion/move-out triggers removal.
2020-11-24 16:56:49 +00:00
Christian Kamm 21b931dc6b FolderWatcher: Always notify about conflict files #7073
This makes sure that the conflict list can be updated if a user resolves
a conflict by deleting the local conflict file. Previously one had to
wait for the next sync run.
2020-11-24 16:56:49 +00:00
Christian Kamm 351bada552 Folderwatcher: On linux, fix paths after dir renames #6808
If a folder was renamed A -> B, the folder watcher for the inode
would be unaware and still report changes for A/foo. Now directory
renames in the watched folders are tracked and paths are updated
accordingly.
2020-11-24 16:56:49 +00:00
allexzander 29ca1404cc Fix Windows compilation broken after QML debugging fix.
Signed-off-by: allexzander <blackslayer4@gmail.com>
2020-11-24 16:50:16 +02:00
allexzander 92733e9069 Fix QML debugging by removing incorrect dependency
Signed-off-by: allexzander <blackslayer4@gmail.com>
2020-11-24 15:19:17 +02:00
Kevin Ottens 922b322337 Enable the QML debugger on debug builds
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-11-23 17:39:50 +00:00
allexzander 665a8c4217 Use dynamic path for account online/offline state icon. Refresh GUI on connection state change.
Signed-off-by: Alex Zolotov <alex.zolotov.nextcloud.com>
Signed-off-by: allexzander <blackslayer4@gmail.com>
2020-11-23 17:49:25 +02:00
Kevin Ottens 4f7876f520 Migrate journal dbs files back to the sync folder
In case of past collisions during the 3.0 times... well one will resync
from scratch unfortunately. But if that happened there are likely other
problems which occurred.

Also this might fix some of the bugs with people loosing settings from
the database. Indeed the -wal and -shm concatenations were wrong. Using
append was in fact changing the folderDefinition member which (I guess)
would potentially lead to funny ".db-wal-shm-wal-shm" names.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-11-10 17:46:43 +00:00
Kevin Ottens 0b731eb516 Revert "moved default db sync file to Qt standard path AppDataLocation"
This reverts commit fc6b895f52.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-11-10 17:46:43 +00:00
Kevin Ottens 1b553b93b9 Partial Revert "Adapted for cmd version and added migration step for config file"
This partially reverts commit 67ed54671b.

The migration code was left untouched.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-11-10 17:46:43 +00:00
Kevin Ottens cebd39aa85 Revert "Adjust to makeDbName returning an absolute path"
This reverts commit 2492e241ac.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-11-10 17:46:43 +00:00
Kevin Ottens 6c463442ef Bring back the pause/resume action in the systray menu
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-11-10 17:29:51 +00:00
Kevin Ottens 1288ee0437 Move pause/unpause helpers to Systray
We had signals just to call those backs in ownCloudGui, they were
otherwise unused. So let's move them inside of Systray since it's
specific to it anyway.

Also fix the dangerous call to sender(). We can call this function
without going through a signal/slot connection and also it's never
connected to an AccountState.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-11-10 17:29:51 +00:00
Kevin Ottens 95487d8bfc Make sure the settings dialog exist before hiding it
Because of PR #2580 the settings dialog doesn't always exist. We need to
check for it first before placing calls to it.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-11-10 16:57:56 +00:00
Kevin Ottens 86d240f7b4
Fetch apps when we get connected only
This was right now on the check connectivity beat which is too much when
you got many users. Be more conservative there and only update the list
of apps when the account gets connected.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-11-05 13:37:25 +01:00
Kevin Ottens 3427dadaeb
Get rid of FindQt5Keychain.cmake
QtKeychain provides Qt5KeychainConfig.cmake and friends nowadays, so no
need to have a less reliable and outdated find module on our end.

Also this shows that we were including keychain.h in the wrong way and
were not using the link target, so both got fixed as well.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-11-02 13:19:48 +01:00
Sergey Zolotarev 18c1bc0bd6 Misc fixes for Windows 7
Signed-off-by: Sergey Zolotarev <sryze@protonmail.com>
2020-10-28 06:24:53 +00:00
Kevin Ottens 3e6b257ccd Remove last left over of the "remote" wording
I switched from "remote" to "server" but apparently left one behind by
mistake...

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-26 14:45:46 +00:00
Valdnet 204cced445 l10n: Change the ellipsis 2020-10-26 13:22:55 +00:00
Valdnet f116c39b0a l10n: Add a space in generalsettings.ui 2020-10-26 13:22:55 +00:00
Kevin Ottens 8fad88055e Also output the event flags in the debug logs
When we skip a watcher event on mac, we log the file path but not the
event flags which came with it. Let's add it, it should help figure out
what's going on with #2578.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-26 12:37:00 +00:00
rakekniven 62fa8028a6 Triple dot to ellipsis
Reported at Transifex.

Signed-off-by: rakekniven <mark.ziegler@rakekniven.de>
2020-10-26 12:22:23 +00:00
Kevin Ottens 24964e2b9b Ensure we quickly show/hide the systray window on startup
This is quick enough that no flickering should appear in practice.

We end up doing this because for some reason on Windows (I dug up deep
into the Windows QPA without nailing it down) not showing that systray
window at least once prevents the app object to return from exec() when
the session ends.

It's as if that window would be in some limbo state (neither opened nor
closed) which would prevent quitting. Clearly what we're doing here is a
workaround...

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-22 17:31:05 +00:00
Kevin Ottens b835092ae9
Use the ConflictDialog directly from the activity list
No need to go to the file manager first to then have the user go through
the context menu, just popup the dialog directly.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-22 16:40:47 +02:00
Kevin Ottens 4116c90c9c
Move the activity action behavior on the C++ side
We better do this before this business logic grows in the QML side and
gets out of control. We'll need finer grained information due to the
conflict handling anyway.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-22 16:40:46 +02:00
Kevin Ottens 910f0c9339
Repair SettingsDialog::showIssuesList
This was completely disabled code and the connect was gone... So let's
introduce the connect back and have it trigger the main window while
selecting the right user. This way the new activity list is displayed
and since the conflicts are shown at the top this is hopefully obvious
again.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-22 16:40:46 +02:00
Kevin Ottens c42f4abd25
Add a function to know the user id matching a given account
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-22 16:40:46 +02:00
Kevin Ottens e3b97b0a04
In the case of conflicts, have the socket api propose the config dialog
This should be safe in the case of conflicts in folders on which the
user can write. For other cases we still use the older actions.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-22 16:40:46 +02:00
Kevin Ottens 49c478cd2a
Add a conflict dialog to help the user solve them
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-22 16:40:46 +02:00
Kevin Ottens 67e81fcd0f
Add KeepBothVersions as a possible solution to ConflictSolver
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-22 16:40:46 +02:00
Kevin Ottens 4fdb203cdb
Move some of the SocketApi conflict handling in a ConflictSolver class
The socket api move and delete commands are not strictly about conflicts
since they also deal with files which couldn't be uploaded for some
other reason. Still the new ConflictSolver could be used in those cases.

This opens the door at reusing that logic in other places.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-22 16:40:46 +02:00
Kevin Ottens 26d62a9712
Repair the canAddToDir logic
This could only work at the root of the sync folder where the record for
the parent folder would be invalid. Otherwise the negation would be
wrong... assuming you can add a file only if the permission is not
there.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-22 16:40:44 +02:00
Christian Kamm 00e901f5a7
SocketAPI: Introduce conflict resolution actions #6252
For conflicts generally as well as new files in read-only directories
the context menu will now present delete and move options.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-22 16:40:10 +02:00
Christian Kamm f62be57ef2
FileSystem: make removeRecursively() reusable
We want to use it for deleting directory conflicts.
2020-10-22 16:39:17 +02:00
Christian Kamm e70371f408
FileSystem: Fix bad indentation 2020-10-22 16:39:17 +02:00
Michael Schuster 7699004a11 Fix crash in SettingsDialog with delayed initialization
setWindowFlags triggered changeEvent, thus causing a crash in customizeStyle.

This fix should be kept even if we decide against delayed init in the future.

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-10-22 11:29:38 +00:00
Michael Schuster 0fb10163a3 Delay initialization of SettingsDialog
ownCloudGui::slotShowSettings already got what it takes to create it only when we try to show it for the first time.

This however has some implications:

Pros:
- Only created when needed, while testing saved ca. 20 MB of RAM and got freed again after closing the dialog.
- Since we defaulted to the new Tray UI from 3.0, this is an added bonus for users don't opening the settings.

Cons:
- Resources like the avatar image have to be refetched everytime the dialog is recreated.
  This may be desired as well, because it ensures displaying no outdated info (e.g. on connection issues).

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-10-22 11:29:38 +00:00
Kevin Ottens a2e3f9d63a
Expose Theme on the QML side
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-21 13:46:38 +02:00
Kevin Ottens 7536e4c00b
Expose the branding related members of Theme as properties
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-21 13:46:04 +02:00
Kevin Ottens de63e5e221
Don't hardcode the color of text in the header
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-21 13:40:42 +02:00
Kevin Ottens 0e9efe728a
Get rid of ncBlueHover
Use a similar trick of a semi-transparent rectangle on top when the
mouse area is hovered. This way it will always work whatever is the
background color.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-21 11:24:06 +02:00
Kevin Ottens 10cb4170c7
Don't use depth infinity anymore to get the folders e2ee status
This way we avoid the expensive SQL query on the server at the price of
more round-trips since we're doing the recursive traversal by hand now.

Also it turns out this depth was used for all the other propfind calls
during sync when we want fresher information regarding a folder. This
was very inefficient in all cases and won't happen anymore.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-21 10:00:59 +02:00
Kevin Ottens b5fdbefb0e
Make sure jobs don't outlive ClientSideEncryption
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-21 10:00:58 +02:00
Kevin Ottens 399b97442e
Factor out the logic to start a new e2ee status job
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-21 10:00:58 +02:00
Kevin Ottens cbc40b5a15
Mention the folder we listed in the debug logs
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-21 10:00:58 +02:00
Kevin Ottens 8e3ca71763
Change the way we store the job result
If there's more than one job we need to unite the maps not simply overwrite
them.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-21 10:00:58 +02:00
Kevin Ottens 9aeb7046d2
Start managing a list of GetFolderEncryptStatusJob
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-21 10:00:58 +02:00
Kevin Ottens cfb66ddadd
Add a way to know which folder was listed for encrypted status
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-21 10:00:58 +02:00
Camila San 03b1c0b84a
Fix crash when clicking on folder with status 403 in the main dialog.
LsColJob was still being used after delete was called.

Signed-off-by: Camila San <hello@camila.codes>
2020-10-20 16:19:27 +02:00
Kevin Ottens b7ea6530c5 Stop the animation if we got an error message
Otherwise it would spin forever while we know we're not doing any work
anymore since we got a message from the server.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-19 14:33:19 +00:00
Kevin Ottens ecc170decc Inform _emptyShareLinkWidget of linkShareRequiresPassword signals
All the other ShareLinkWidgets process that signal (which allows to
display error messages for instance) but not that one for some reason.
That being said it might need to deal with an enforced password
situation.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-19 14:33:19 +00:00
Kevin Ottens e502e71926 Emit last to avoid use after delete crash
It turns out the shareDeleted() signal is connected to a function
cleaning up the ShareLinkWidget holding the last shared pointer to the
Share object. Since we use member variables for calling updateFolder()
this would lead to using deleted objects.

Just swap the call and the signal to have everything back in order.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-19 14:33:19 +00:00
Michael Schuster 61dc4b9137
Update comments
Everyone uses their private mail, so ensure people can get in touch.

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-10-15 02:18:52 +02:00
Kevin Ottens ca57221b74
Ensure we use the app name in the GUI
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-13 07:28:43 +02:00
Kevin Ottens 7efaa2ed68
Fix the secure lock label aspect
Make sure we got a fixed size for that label. Also ensure that the
pixmap we display there is properly scaled to fit while maintaining the
aspect ratio.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-13 07:28:32 +02:00
Kevin Ottens ec945b8ac7
Hide the slideshow when going to the login page
This is indeed very distracting otherwise.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-13 07:28:32 +02:00
Kevin Ottens 9ec4b5ef8e
Add a label explaining the server address field
This is as discussed in #1160

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-13 07:28:31 +02:00
Kevin Ottens 5e472e629f
Improve wording on the wizard buttons
This is as discussed on #1158

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-13 07:28:31 +02:00
renyhp e5b307c81f Update bookmarks location
Signed-off-by: renyhp <renyhp@disroot.org>
2020-10-12 15:02:00 +00:00
Nicolas Fella 206c98688e Avoid string translation puzzle
Combining translated strings like this makes them hard to translate since the order of words is different between languages.
Use proper placeholder strings instead.

Signed-off-by: Nicolas Fella <nicolas.fella@gmx.de>
2020-10-12 13:34:50 +00:00
Nicolas Fella 6f17bbe6d5 Don't use nullptr for QFlags
This fixes some deprecation warnings

Signed-off-by: Nicolas Fella <nicolas.fella@gmx.de>
2020-10-12 11:52:53 +00:00
Nicolas Fella f5860928d9 Make QML code more declarative by using properties
By using properties and property bindings the QML code gets more declarative rather than imperative, which is considered better.

This patch:
- Introduces a currentUserId property in UserModel that replaces the equivalent Q_INVOKABLE call
- Introduces an avatar property in User that contains the avatar's image provider url without any fallback
- Introduces new image provider urls for fallback images
- Moves the fallback image selection to QML since we want different fallbacks according to where it is used
- Wires up the necessary signals to propagate a changing avatar

Signed-off-by: Nicolas Fella <nicolas.fella@gmx.de>
2020-10-12 11:00:20 +00:00
Kevin Ottens a53a87a3eb
Export the WordList functions
Now that they are used from gui/ they need to be properly exported so
that linking doesn't fail when visibility is activated (only on our
Windows build it seems).

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-08 15:58:29 +02:00
Kevin Ottens ab67741d87 Use setHeader instead of setRawHeader for the user agent
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-08 05:55:47 +00:00
Kevin Ottens 3d8af05037 Use friendly user agent during webflow2 auth
This way the server displays a less scary string while granting access
from the browser. Also this same string will be used in the "Devices and
sessions" section of the server settings.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-08 05:55:47 +00:00
Kevin Ottens 836de0358d Add a function for a more friendly user agent string
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-08 05:55:47 +00:00
Kevin Ottens 50dd715f4d Don't force user agent if one is already set on the request
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-08 05:55:47 +00:00
Kevin Ottens 3fca307fbb Also add build infos in the archive
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-07 13:33:20 +00:00
Kevin Ottens 8ce137cc53 Also add the command line arguments in the archive
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-07 13:33:20 +00:00
Kevin Ottens 8fb673457b Add a button to create a debug archive
This will harvest everything we might need for debugging purposes:
 * config file
 * sync journal dbs
 * log files

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-07 13:33:20 +00:00
Kevin Ottens 15d294e7fb Add dependency on QtGuiPrivate
I'm not a huge fan of using private APIs but QZip is really the API with
the least hassles for our debug archive need. No external dependency and
we know it is generally available and stable despite the lack of
stability promise.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-07 13:33:20 +00:00
Kevin Ottens 607347289e Expose more of the logger state
It is better to rely on the Logger state to know exactly where we're
logging. Indeed due to the the various ways to impact its state the
config alone might not now where we're logging.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-07 13:33:20 +00:00
Kevin Ottens 167800320f Make sure --logfile has precedence on config
Since we changed the default in the config file and since log dir had
precedence on log file, the --logfile command line option wasn't doing
anything anymore.

We make sure it has an effect again overriding --logdir or the logDir
config entry.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-07 13:33:20 +00:00
Kevin Ottens b0a38816fc Change the defaults for logging
Turn on the logging by default for everyone. Let's use a log dir within
the config directory of the application and have debug logs expiring
after a day.

This obviously means we'll generate quite some logs but with the
automated compression it shouldn't be too horrible. Obviously that
scales with the amount of files and syncs occurring. In our tests with a
large setup we're around 100 MB for a day worth of logs, this shouldn't
be too much of an issue on today's average desktop/laptop.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-07 13:33:20 +00:00
Kevin Ottens e78312f094 If askForOptionalPassword is enabled preset a random password
This is the same approach used on the server side. Turns out I quite
like it, this avoids popping up a dialog to the user and since she won't
know the password she'll have to set a new one anyway or disable it.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-07 09:43:47 +00:00
Kevin Ottens 099d25a56c Since we must ask for a password this can't be a default public link
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-07 09:43:47 +00:00
Kevin Ottens e356acbcee Add sharePublicLinkAskOptionalPassword to Capabilities
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-07 09:43:47 +00:00
Kevin Ottens f39542688a
Handle redirects when downloading updates
This is necessary for downloads coming from Github for instance. They
are systematically redirected and we'd just fail the download.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-05 15:48:39 +02:00
Michael Schuster bb30633d31 Fix source file access modes
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-10-02 16:56:29 +00:00
Michael Schuster 5979ae30e1 macOS: Fix memory leak in FolderWatcherPrivate::startWatching
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-10-02 16:56:29 +00:00
Aldaris1985 ef6773bd60 Update propagateupload.cpp
Typo corrected.
2020-10-01 21:26:17 +00:00
Camila 954544830d Add a clickable icon for Talk notifications.
Signed-off-by: Camila <hello@camila.codes>
2020-09-30 08:46:01 +00:00
Harald Eilertsen 7721da25e5 Replace find_if with none_of where appropriate.
We're not interested in any found element in these cases, just to check
that none of the elements matches.

Signed-off-by: Harald Eilertsen <haraldei@anduin.net>
2020-09-29 19:32:39 +02:00
Harald Eilertsen 061ef027ff Don't hold ref to value returned from function.
Signed-off-by: Harald Eilertsen <haraldei@anduin.net>
2020-09-29 19:32:24 +02:00
Harald Eilertsen 074a94ceb9 gui/accountmanager: Make isAccountIdAvailable a bit clearer.
Signed-off-by: Harald Eilertsen <haraldei@anduin.net>
2020-09-29 19:31:24 +02:00
Harald Eilertsen 62bf4c5fda gui/folderman: Replace foreach (#2219)
Signed-off-by: Harald Eilertsen <haraldei@anduin.net>
2020-09-29 19:31:24 +02:00
Harald Eilertsen 677997b2b3 gui/folder: Replace foreach (#2219)
Signed-off-by: Harald Eilertsen <haraldei@anduin.net>
2020-09-29 19:31:23 +02:00
Harald Eilertsen 5bd2529ca6 gui/application: replace foreach (#2219)
Signed-off-by: Harald Eilertsen <haraldei@anduin.net>
2020-09-29 19:31:23 +02:00
Harald Eilertsen e343b4b947 gui/accountstate: Replace foreach (#2219)
Signed-off-by: Harald Eilertsen <haraldei@anduin.net>
2020-09-29 19:31:23 +02:00
Harald Eilertsen 225fdabf6a gui/accountstate: Replace foreach (#2219)
Most instances have been converted to range based for, but std::find_if
has been used where it made sense.

Signed-off-by: Harald Eilertsen <haraldei@anduin.net>
2020-09-29 19:31:23 +02:00
Harald Eilertsen 1898782781 gui/accountmanager: Replace foreach/Q_FOREACH (#2219)
Signed-off-by: Harald Eilertsen <haraldei@anduin.net>
2020-09-29 19:31:23 +02:00
Harald Eilertsen 5f4cec870b cmd: Replace foreach with range base for (#2219)
Signed-off-by: Harald Eilertsen <haraldei@anduin.net>
2020-09-29 19:31:23 +02:00
Camila dc12cdf196
Correct the object name returned by the api.
The id was always 0 so no new systray messages were displayed.

Signed-off-by: Camila <hello@camila.codes>
2020-09-29 18:53:28 +02:00
Camila d2eb24a9a8
Connect signal guiLog to slot to display systray message.
Signed-off-by: Camila <hello@camila.codes>
2020-09-29 18:53:28 +02:00
Valdnet d50ad548d2
l10n: Remove space from string text 2020-09-29 14:39:34 +02:00
Dominique Fuchs b96b7e20c7 emitting signals from Qts Accessibility interaction invocations instead of duplicating actions
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-09-28 12:38:21 +00:00
Dominique Fuchs 1053c58b0f KISS. Removed description for now, instead clarified some Accessible.name
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-09-28 12:38:21 +00:00
Dominique Fuchs 8abe4219a5 Added missing qsTr() calls - again
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-09-28 12:38:21 +00:00
Dominique Fuchs a69898371f Added missing qsTr() calls
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-09-28 12:38:21 +00:00
Dominique Fuchs a4151d71bc Fix typo
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-09-28 12:38:21 +00:00
Dominique Fuchs 3287ec2387 Typo fixes, minor additions
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-09-28 12:38:21 +00:00
Dominique Fuchs c6047e4d63 Re-add wrongly delete action
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-09-28 12:38:21 +00:00
Dominique Fuchs 43bf703806 Initial accessibility declarations for tray window qml src
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-09-28 12:38:21 +00:00
Dan Griffin 5763e1e9d8
Free IconJob after use
Signed-off-by: Dan Griffin <github.mk@xiragon.com>
2020-09-28 12:30:53 +02:00
Kevin Ottens 78b03739a7
Force tooltip wrap mode because it's not enabled in Qt 5.12...
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-09-24 14:47:56 +02:00
Jeremy Plsek 5fa2a13f8d Use native text rendering for qml windows
Signed-off-by: Jeremy Plsek <jeremyplsek@gmail.com>
2020-09-23 08:00:46 +00:00
Michael Schuster ce71ffe9f9 Allow server URL to be pre-defined without enforcing it to be used unmodified
APPLICATION_SERVER_URL can be either empty or be specified. This commit adds the new CMake option APPLICATION_SERVER_URL_ENFORCE to decide whether to enforce the
URL's unmodified use (like before, default: ON) or to allow modification by the user (new).

By default APPLICATION_SERVER_URL_ENFORCE is set to ON, to no break with the previous implementation's expectations.

If APPLICATION_SERVER_URL is empty, APPLICATION_SERVER_URL_ENFORCE will be ignored by the Account Wizard.

The previous behaviour confused me a bit with branded builds. When the URL was (usually) specified but not forced, it was simply discarded, forcing the user to
manually supply it.

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-09-23 07:21:35 +00:00
Jeremy Plsek 3a53afd704 Remove "This includes" due to tooltip order
Signed-off-by: Jeremy Plsek <jeremyplsek@gmail.com>
2020-09-21 09:46:25 +00:00
Kevin Ottens 3171cb2720 If there's no description just say nothing
Otherwise we get lots of "No description available" lines in the
activity list which is basically noise. Also trains the user to ignore
the secondary line.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-09-18 17:46:38 +00:00
Dominique Fuchs f8f3190cb4 Fix missing subdirectory discovery on move operations in macOS.
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>

Add qAsConst to avoid detaching

Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>

Changed callchain to find and return possibly coalesced paths

Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>

Removed another qAsConst remnant, more func const-correctness.

Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-09-17 15:44:32 +02:00
Dominique Fuchs d09b0284dd
Do not break out of outer loop when upgrading folders, continue instead
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>

Remove awkward debug line a.k.a. whoops

Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-09-16 10:57:43 +02:00
Jeremy Plsek 797df2b5d5 Include list info in tooltip
Also extend the tooltip timeout

Signed-off-by: Jeremy Plsek <jeremyplsek@gmail.com>
2020-09-15 10:04:06 +00:00
Kevin Ottens 6ee37b5975 Make sure menu are closed when button is clicked again
This way we also made sure all the Menu are currently on the same close
policy.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-09-15 08:46:10 +00:00
Kevin Ottens f7efe6a902 Delay binding on the menu width
Indee the MenuItem might not be linked to its Menu at creation time
which will make the binding fail and give a warning. Delay for the menu
availability.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-09-15 08:46:10 +00:00
Kevin Ottens eb0cedebfa Remove pre-QQC2.3 workaround
Now that we depend on Qt 5.12 anyway, the count property is available
just fine on the Menu item.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-09-15 08:46:09 +00:00
Kevin Ottens 7ccb016397 Use QGuiApplication::primaryScreen() as fallback for Systray::currentScreen()
Under Wayland QCursor::pos() is unlikely to give us anything meaningful,
so fallback to the primary screen information.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-09-15 07:17:03 +00:00
Kevin Ottens 01986df8ca Don't use a confusing "royal you" in the sync messages
Users get rightfully confused with the "You changed ..." messages in the
activity list for syncs. Indeed, some of those changes might be coming
from the server in which case we don't really know who did the change.

So now we use the old "Synced ..." messages for changes pulled from the
server and we have a more precise "You changed ..." (renamed, deleted,
created) when the changes were initiated locally (since there we know
the user reading the message did it).

Also changed how the messages are constructed so that they can be
properly translated.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-09-10 15:40:05 +02:00
Camila 95f634ce28 Click on activity list in systray open file in the file manager.
Clean up code, add more const and auto.

Signed-off-by: Camila <hello@camila.codes>
2020-09-09 20:06:46 +02:00
Camila c1086c9886 Fix tooltip for activity info.
Also improves readability of the items in the list.

Signed-off-by: Camila <hello@camila.codes>
2020-09-09 20:06:46 +02:00
Kevin Ottens fdb35e5f9f Leave the implicit uint to int cast
I wrongly (and stupidly) assumed the int in QBitArray was treated as a
hash as well but it is an index so it must be positive. Also to make
things even worse I misread on which expression clang-tidy was
complaining regarding the implementation specific narrowing
conversion... This is happening after the modulo operator and not
before. We're in a safe range of values at that point, so it's fine to
let the narrowing happen.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-09-08 16:44:31 +02:00
Jan Schmidt 3077a1378b syncjournaldb: index e2eMangledName column in metadata
Add an index on the e2eMangledName column in the metadata table
to speed up file sync by orders of magnitude on directories with
a large number of files.

Signed-off-by: Jan Schmidt <jan@centricular.com>
2020-09-03 22:56:14 +10:00
Kevin Ottens aa63889e5b Enable bugprone-terminating-continue clang-tidy check
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-09-01 06:37:03 +00:00
Kevin Ottens 80cc196f6f Enable bugprone-narrowing-conversions clang-tidy check
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-09-01 06:37:03 +00:00
Kevin Ottens 5cec1373ad Enable bugprone-macro-parentheses clang-tidy check
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-09-01 06:37:03 +00:00
Kevin Ottens 608bf025e6 Enable bugprone-forward-declaration-namespace clang-tidy check
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-09-01 06:37:03 +00:00
Kevin Ottens c8ea848596 Enable the bugprone-branch-clone clang-tidy check
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-09-01 06:37:03 +00:00
Kevin Ottens eb76682b1e Use httpd/unix-directory mimetype for E2EE folders
We don't do much with that mimetype on our end, but other clients
somehow don't expect inode/directory to let's lie. ;-)

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-31 10:08:48 +00:00
Kevin Ottens 1a0945a973 Enable all the misc clang-tidy check except one
This flagged mostly unused parameters. Didn't enable the
misc-non-private-member-variables-in-classes check as we got a lot of
those. Hopefully we'll get to fix them at some point but that feels too
early and too much work for now.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-31 09:14:09 +02:00
Michael Schuster 5945f18d5a
Remove remaining QLinkedList includes in addition to #2300
Now the only remaining reference is in:

src/3rdparty/libcrashreporter-qt/3rdparty/drkonqi-parser/backtraceparser.cpp:269:        || line.functionName().startsWith(QLatin1String("QLinkedList")

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-08-27 03:12:09 +02:00
Michael Schuster bd519ffe7a
Adapt code style in addition to #2300
- Use "!empty()" instead of "size() > 0" in std::list
- Add comments for namespace brackets

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-08-27 01:31:06 +02:00
V.C b20ea25201 Code review changes implemented
Code review changes implemented for bandwidthmanager.cpp
1. Use auto instead of size_t
2. Check for empty instead of size comparisions

Signed-off-by: V.C <c******@rediffmail.com>
2020-08-26 02:45:20 +00:00
V.C af1bb7e98c Support client builds on VS2019
Scenario: Build fails on Qt 5.15.0 + VS2019 16.7.2
Root cause: QLinkedList seems to be depreciated. Advise to use std::list instead.
Fix: Used std::list insead of QLinkedList.

Signed-off-by: V.C <c******@rediffmail.com>
2020-08-26 02:45:20 +00:00
Michael Schuster 11632da7ea
Windows shell extensions: Change NCUtil Pipe name from ownCloud to APPLICATION_EXECUTABLE
Avoid interference with foreign pipes as this is always a bad idea ;p

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-08-20 18:50:05 +02:00
Kevin Ottens ed5e9de9f6
Present sharing of E2EE files from the main dialog too
The visibility of the share button for the activity list is tied to the
path role in the ActivityListModel, so make sure we don't return a path
for E2EE files and folders.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-20 14:53:14 +02:00
Kevin Ottens 07388e0f22
Disable context menu actions for E2EE files and folders
Those files and folders are not shareable and the "Edit" or "Open in
browser" actions will lead to showing an error in the web GUI. No need
to lead users there so just disable them.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-20 14:13:56 +02:00
Kevin Ottens 3540f1e460 Show the "Display mnemonic" button only when we know e2e is supported
Turns out that showing the button straight from the page ctor is a bit
too early. At that point the account might not be connected yet and thus
we wouldn't have proper information. Currently we were displaying that
button all the time, now we wait for the account to be connected to
decide to show it or not.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-18 17:41:38 +02:00
Camila 71fbc65eb0 Minor fix in text of warning and debug message.
Signed-off-by: Camila <hello@camila.codes>
2020-08-18 14:00:21 +02:00
Kevin Ottens f6e36523d2 Make sure we don't assert when calling fileStatus
It happens that sometimes we leak a directory path ending with a slash,
but that violates fileStatus' precondition so let's catch it early and
skip such path.

Of course the right fix would be a larger swipe in the sync engine and
around it to not use naked strings anymore but rely on the typesystem.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-18 13:52:28 +02:00
István Váradi 89d4b6e12a Include cstdint only when compiling C++ code
Signed-off-by: István Váradi <ivaradi@varadiistvan.hu>
2020-08-14 06:15:42 +02:00
Olivier Goffart a7847a4e82
Upload: Store the size in the UploadInfo, and compare it when resolving potential conflict
This is about the conflicts that happens when the file has been uploaded
correctly to the server, but the etag was not recieved because the connection
was closed before we got the reply.

We used to compare only the mtime when comparing the uploaded file and the
existing file.  However, to be perfectly correct, we also should check the
size.

This was found because TestChunkingNG::connectionDroppedBeforeEtagRecieved is
flaky. Example of faillure found in https://drone.owncloud.com/owncloud/client/481/5
while testing PR #6626

(very trimmed log:)

06-29 07:58:02:015 [ info sync.csync.csync ]:	## Starting local discovery ##
06-29 07:58:02:016 [ info sync.csync.updater ]:	Database entry found, compare: 1530259082 <-> 1530259051, etag:  <-> 1644a8c8750, inode: 1935629 <-> 1935629, size: 301 <-> 300, perms: 0 <-> ff, type: 0 <-> 0, checksum:  <-> SHA1:cc9adedebe27a6259efb8d6ed09f4f2eff559ad1, ignore: 0
06-29 07:58:02:016 [ info sync.csync.updater ]:	file: A/a0, instruction: INSTRUCTION_EVAL <<=
06-29 07:58:02:972 [ warning sync.networkjob ]:	QNetworkReply::NetworkError(OperationCanceledError) "Connection timed out" QVariant(Invalid)
.. next sync...
06-29 07:58:02:980 [ info sync.engine ]:	#### Discovery start ####################################################
06-29 07:58:02:981 [ info sync.csync.csync ]:	## Starting local discovery ##
06-29 07:58:02:983 [ info sync.csync.updater ]:	Database entry found, compare: 1530259082 <-> 1530259051, etag:  <-> 1644a8c8750, inode: 1935629 <-> 1935629, size: 302 <-> 300, perms: 0 <-> ff, type: 0 <-> 0, checksum:  <-> SHA1:cc9adedebe27a6259efb8d6ed09f4f2eff559ad1, ignore: 0
06-29 07:58:02:983 [ info sync.csync.updater ]:	file: A/a0, instruction: INSTRUCTION_EVAL <<=
06-29 07:58:02:985 [ info sync.csync.csync ]:	## Starting remote discovery ##
06-29 07:58:02:985 [ info sync.networkjob ]:	OCC::LsColJob created for "http://localhost/owncloud" + "" "OCC::DiscoverySingleDirectoryJob"
06-29 07:58:02:987 [ info sync.csync.updater ]:	Database entry found, compare: 1530259082 <-> 1530259051, etag: 1644a8c8b26 <-> 1644a8c8750, inode: 0 <-> 1935629, size: 301 <-> 300, perms: ff <-> ff, type: 0 <-> 0, checksum: SHA1:5adcdac9608ae0811247f07f4cf1ab0a2ef99154 <-> SHA1:cc9adedebe27a6259efb8d6ed09f4f2eff559ad1, ignore: 0
06-29 07:58:02:987 [ info sync.csync.updater ]:	file: A/a0, instruction: INSTRUCTION_EVAL <<=
06-29 07:58:02:989 [ info sync.csync.csync ]:	Update detection for remote replica took 0.004 seconds walking 13 files
06-29 07:58:02:990 [ info sync.engine ]:	#### Discovery end ####################################################  9 ms
06-29 07:58:02:990 [ info sync.database ]:	Updating file record for path: "A/a0" inode: 1935629 modtime: 1530259082 type: 0 etag: "1644a8c8b26" fileId: "16383ea4" remotePerm: "WDNVCKR" fileSize: 301 checksum: "SHA1:cc9adedebe27a6259efb8d6ed09f4f2eff559ad1"
06-29 07:58:02:990 [ info sync.csync.reconciler ]:	INSTRUCTION_UPDATE_METADATA    client file: A/a0
06-29 07:58:02:990 [ info sync.csync.csync ]:	Reconciliation for local replica took  0 seconds visiting  13  files.
06-29 07:58:02:990 [ info sync.csync.reconciler ]:	INSTRUCTION_UPDATE_METADATA    server dir:  A
06-29 07:58:02:990 [ info sync.csync.csync ]:	Reconciliation for remote replica took  0 seconds visiting  13  files.
06-29 07:58:02:990 [ info sync.engine ]:	#### Reconcile end ####################################################  9 ms
06-29 07:58:02:990 [ info sync.database ]:	Updating local metadata for: "A/a0" 1530259082 302 1935629
FAIL!  : TestChunkingNG::connectionDroppedBeforeEtagRecieved(small file) '!fakeFolder.syncOnce()' returned FALSE. ()
2020-08-13 16:46:08 +02:00
Christian Kamm c74c0d8e6e
Upload: Add more chunk resuming unit tests #6405 2020-08-13 16:45:55 +02:00
Kevin Ottens 866ffc2a6b Enable the modernize-loop-convert check on clang-tidy
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-13 12:55:14 +00:00
Kevin Ottens a5b4922a0e Remove unused method
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-13 12:55:14 +00:00
Kevin Ottens 0e2af4b502 Enable the modernize-deprecated-headers check on clang-tidy
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-13 14:53:52 +02:00
Kevin Ottens 2f8c29082a Enable the modernize-use-equals-default check on clang-tidy
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-13 14:19:42 +02:00
Kevin Ottens cdf6e7d72b Enable the modernize-user-nullptr check on clang-tidy
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-12 19:45:25 +02:00
Kevin Ottens 6ae1d0ddf6
Get rid of useless using constructs
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-12 18:18:57 +02:00
Kevin Ottens 97af14a4f0
Make QTokenizer use simpler by having optional second parameter
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-12 18:18:57 +02:00