Commit Graph

172 Commits

Author SHA1 Message Date
Christian Kamm
1269843c3c Vfs: Retain existing data when enabling vfs #7302
Previously all local data was deleted because the root folder was marked
as OnlineOnly.
2019-07-10 14:15:45 +02:00
Christian Kamm
2c0a379f3a Minimal libcloudproviders support #7209
- Add it as an optional dependency for linux builds,
  controlled by WITH_LIBCLOUDPROVIDERS, which is enabled automatically
  if the dependencies are available. Note that >=0.3.0 is required.

- Add code to export sync folders through the library and to add a
  minimal "Settings..." menu action.

- Set up cloud provider registration by installing a file into a
  path like /usr/share/cloud-providers/.

- DBus name and path are derived from APPLICATION_REV_DOMAIN by default
  and may be overridden with APPLICATION_CLOUDPROVIDERS_DBUS_NAME and
  APPLICATION_CLOUDPROVIDERS_DBUS_PATH if necessary.
2019-06-07 09:26:33 +02:00
Christian Kamm
03b65e210b Vfs: Mark sqlite temporaries excluded on db-open #7141
The previous patch ensured that the sqlite temporaries weren't deleted
and recreated for every sync run, but there was still time between
client startup and the first sync run where they would have the
"needs-sync" icon.
2019-04-26 13:51:18 +02:00
Christian Kamm
1e1340b457 Merge remote-tracking branch 'origin/2.5' into 2.6 2019-04-17 13:43:53 +02:00
Christian Kamm
f1c7a9511f FolderWizard: Don't crash when typing invalid drive #7041
When the user typed "x:" where the drive x didn't exist, the validation
function would loop forever. Now it shows a "path doesn't exist" error.
2019-03-18 10:10:01 +01:00
Christian Kamm
221b8680e4 Merge remote-tracking branch 'origin/2.5' 2019-03-04 09:36:29 +01:00
Christian Kamm
0682a8d4e7 Folder wizard: Fix infinite loop for bad paths #7041 2019-02-18 19:32:50 +01:00
Christian Kamm
c500866a78 Folder: Add remoteFolderTrailingSlash()
There were cases where the "/" exception wasn't handled correctly
and there'd be extra slashes in generated paths.
2019-02-11 13:35:14 +01:00
Christian Kamm
63e11dc8da Vfs: Call unregisterFolder() when folder is removed 2019-02-11 13:35:14 +01:00
Christian Kamm
df1723c9b2 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.
2019-01-07 10:09:03 +01:00
Christian Kamm
5211d9a8b1 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.
2018-12-19 10:14:25 +01:00
Christian Kamm
4f56366fd5 vfs: Ensure SyncOptions::_vfs is never null
- Create a VfsOff derived class
- Make it a shared pointer shared with Folder::_vfs
2018-11-26 13:02:48 +01:00
Christian Kamm
6d0f9a50ad vfs: Be more careful about Vfs instance ownership 2018-11-26 13:02:48 +01:00
Christian Kamm
59a114cd4d vfs: Fix plugin decision in wizards, sanitize loading 2018-11-26 13:02:48 +01:00
Christian Kamm
06928a4037 winvfs: initial work
Done by ckamm and dschmidt
2018-11-26 12:53:30 +01:00
Christian Kamm
96df14f897 FolderMan: Remove assumption of unique running sync 2018-11-26 12:47:31 +01:00
Christian Kamm
a9599b4ccc Folder: Treat file unlock similar to external change #6822
For consistent handling of incoming notifications.
2018-11-06 10:03:25 +01:00
Christian Kamm
3e7f1a3094 Doc: improve backwardMigrationSettingsKeys 2018-10-31 10:09:25 +01:00
Christian Kamm
7519c64e86 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.
2018-10-29 19:54:21 +01:00
Olivier Goffart
d7e77b7473 FolderMan::checkPathValidityForNewFolder: make sure to work when folder points to deleted folders
Note that we also needed to adjust the server url to contains the user name
in the folder wizard. (As checkPathValidityForNewFolder expect the user name)

Issue #6654
2018-07-17 09:02:37 +02:00
Christian Kamm
5811c74f9c Settings migration: Preserve future settings where possible
See discussion in #6506
2018-05-24 12:18:44 +02:00
Christian Kamm
57a2881906 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
2018-05-24 12:18:44 +02:00
Christian Kamm
c80ee0ea48 Placeholders: Save to key that's invisible to <2.5 clients #6504 2018-05-15 14:26:35 +02:00
Christian Kamm
8358dabbfd Folder: Simplify relative path computation
It was done manually in several places after folderForPath() calls.
2018-04-18 10:27:51 +02:00
Olivier Goffart
18afe6a395 Folder: remove unused member 2018-02-26 16:11:46 +01:00
Christian Kamm
d1aacac294 Tray: Change icon for unresolved conflicts #6277 2018-01-26 13:33:33 +01:00
Olivier Goffart
eae00f9969 Use std::chrono::milliseconds to represent milliseconds 2018-01-25 14:07:08 +01:00
Christian Kamm
86377aa37a Folder: Remove unused 'dirty proxy' setting 2018-01-05 09:44:20 +01:00
Olivier Goffart
3df65460f5 Remove usage of QString::null
Replaces by "QString()"
2017-12-08 16:15:22 +01:00
Jocelyn Turcotte
56e38e6f80 Windows: Add sync folders to Explorer's navigation pane
This is only the navigation pane, the SyncRootManager entries aren't handled yet.

This follows the instructions from:
https://msdn.microsoft.com/en-us/library/windows/desktop/dn889934%28v=vs.85%29.aspx

Issue #5295
2017-10-24 16:10:53 +02:00
Christian Kamm
fb2d31c9ce Folder: Move FolderWatcher to Folder
This makes it unnecessary for FolderMan to manage the list and removes
the need for some forwarders.

This is done in preparation for follow-up commits that want to add
diagnostics to FolderWatcher that shall be available from within Folder.
2017-10-24 10:00:20 +02:00
Olivier Goffart
35e4fe061d Port to new signal-slot syntax what cannot be done automatically
Some slot were protected or private but needed to be public.
Some needed a static_cast (can't use qOverload because it is in Qt 5.7)

This is not only a partial change.
2017-09-21 14:05:39 +02:00
Olivier Goffart
ff4213b59f Use the Qt5 connection syntax (automated with clazy)
This is motivated by the fact that QMetaObject::noralizeSignature takes 7.35%
CPU of the LargeSyncBench. (Mostly from ABstractNetworkJob::setupConnections and
PropagateUploadFileV1::startNextChunk). It could be fixed by using normalized
signature in the connection statement, but i tought it was a good oportunity
to modernize the code.

This commit only contains calls that were automatically converted with clazy.
2017-09-21 14:05:39 +02:00
Jocelyn Turcotte
a1f1775d15 Move SyncJournalDB to src/common 2017-09-18 14:00:52 +02:00
Jocelyn Turcotte
cf15cbf0b3 Move Utility to a new common static library
Now that csync builds as C++, this will avoid having to implement
functionalities needed by csync mandatorily in csync itself.

This library is built as part of libocsync and symbols exported
through it.
This requires a relicense of Utility as LGPL. All classes moved into
this library from src/libsync will need to be relicensed as well.
2017-09-05 17:25:19 +02:00
Christian Kamm
122854af77 FolderMan: Add missing folderListChanged emits
She signal of a folder list change was not emitted when folders were
deleted from the list.
2017-07-10 11:13:48 +02:00
Christian Kamm
15ee7b39ac Merge remote-tracking branch 'origin/2.3' 2017-06-22 14:06:31 +02:00
Christian Kamm
4291ea47f7 Journal: Don't use a ._ path if it won't work #5633
When synchronizing a folder on a samba share, creating files that begin
with ._ is often forbidden. This prevented the client from creating
its ._sync_abcdef.db file.

Now, it'll check whether the preferred filename is creatable, and if
it isn't it'll use .sync_abcdef.db instead.

The disadvantage is that this alternative path won't be ignored by
older clients - that was the reason for the ._ prefix.
2017-06-20 13:35:34 +02:00
Jocelyn Turcotte
c50136d675 Add the account name and folder when starting the sync
This should help clearly delimiting them in the log for multi-account setups.
This information is already available elsewhere in the log in any case.

Issue #5672
2017-05-17 12:39:59 +02:00
Christian Kamm
c8d0f788e0 Apply clang-format 2017-05-17 12:26:27 +02:00
Jocelyn Turcotte
b7553d5bdf Upgrade some qCDebug to qCInfo or qCWarning
Use qCInfo for anything that has general value for support and
development. Use qCWarning for any recoverable error and qCCritical
for anything that could result in data loss or would identify a serious
issue with the code.

Issue #5647
2017-05-11 17:22:59 +02:00
Jocelyn Turcotte
4ad190a558 Use Qt logging categories for logging
This gives more insight about the logs and allow setting fine-tuned
logging rules. The categories are set to only output Info by default
so this allows us to provide more concise logging while keeping the
ability to extract more information for a specific category when
developping or debugging customer issues.

Issue #5647
2017-05-11 17:22:59 +02:00
Christian Kamm
f67989afea Wizards: Never propose an existing folder for syncing #5597 2017-03-21 17:07:35 +01:00
Christian Kamm
4c1fdf1dee Double check usage of asserts #5429
A few are supposed to be fatal.
2017-02-08 15:15:19 +01:00
Markus Goetz
2bda55be81 Don't create legacy 'folders/' subdirectory 2017-01-26 12:29:58 +01:00
Jocelyn Turcotte
ee211d7609 Release SyncFileItem objects with their job
We now delete subjobs as their propagation is complete. This allows us
to also release the item by making sure that nothing else is holding a
reference to it.

Remove the stored SyncFileItemVector from SyncEngine and SyncResult
and instead gather the needed info progressively as each itemCompleted
signal is emitted.

This frees some holes on the heap as propagation goes, allowing many
memory allocations without the need of requesting more virtual memory
from the OS, preventing the memory usage from increasingly growing.
2017-01-25 23:26:23 +01:00
Jocelyn Turcotte
d3a0608bd5 SocketAPI: Only push status for files requested by the shell #5361
We currently push the SYNC status for all files that will be propagated,
and then the OK status when those files are propagated.
On top of this, we send those statuses to all clients connected, even
if the socket is kept open by an application that only needed to show
a file open dialog. On macOS we're also using an NSConnection which
means that we have to wait for the RPC call to return from the
extension, which makes bulk status changes possibly heavy.

Reduce the time spent needlessly sending status pushes by limiting
them to files requested through that socket since it connected.
To limit the data to store, only remember the parent directory of
files requested, and store those in a bloom filter.

Note that this adds a requirement to shell extensions: they should
make sure that the status cache only contains entries that have been
requested through the socket API. In other words, the status cache
must be empty when each socket client connects to the socket API.
Otherwise the cached icon type will be shown to the user, and the
SocketAPI won't push new status for that file if it didn't receive
a RETRIEVE_FILE_STATUS.
2017-01-18 12:15:52 +01:00
Christian Kamm
473dcb0947 Only create a FolderWatcher if the path exists
Also retry creating it before each sync.

See #5317
2017-01-02 08:52:26 +01:00
Christian Kamm
e306f4611c Reschedule a folder regularly with some delay for some errors
Like "folder doesn't exist" - such that we will detect when the folder
becomes available and start syncing.

See #5317
2017-01-02 08:52:26 +01:00
ckamm
5bef1aa402 Merge pull request #5045 from owncloud/dbjournal_per_account
Allow a folder to be synced to several accounts. This changes the path of the sync journal file!
2016-12-06 10:55:58 +01:00