Commit graph

815 commits

Author SHA1 Message Date
Daniel Molkentin
a2b238e2e5 Undo regression caused by 727e73d
normalization to NFC is still required. Mac OS API will not take
care of that by default.

Resolves #4884
2016-05-27 16:03:59 +02:00
ckamm
0e2c16e827 Certs: Re-ask for different cert after rejection #4898 (#4911)
Previously rejecting any kind of certificate meant that the user
was never asked again, even if the certificate changed.

Now we keep track of which certificates were rejected and ask again
if the ones mentioned in the ssl errors change.

mitmproxy is excellent for testing this.
2016-05-27 12:08:42 +02:00
ckamm
b9fdae6d67 Progress: Don't count items without propagation jobs #4856 (#4910)
* Progress: Don't count dirs without propagation jobs #4856

These directory SyncFileItems are necessary for bookkeeping
but should not influence the progress display at all.

* Progress: Skip ignored files #4856
2016-05-27 10:52:00 +02:00
Olivier Goffart
275ad1e157 Utility: Better fix for the translation of minutes, seconds, ...
The plural was not translated because of QTBUG-3945. Work around it.
Issue #4855
2016-05-26 12:17:16 +02:00
Olivier Goffart
fff5c280b3 SyncEngine: cleanup setting isDirectory 2016-05-25 16:27:40 +02:00
Olivier Goffart
e960b265a8 Merge remote-tracking branch '2.1' into 2.2 2016-05-25 16:23:58 +02:00
Olivier Goffart
f6b35e5d58 SyncEngine: invalid the blacklist entry when the rename destination change
The problem in this case is if we rename the file "xxx" to "invalid\file".
The rename will fail because the new filename constains a slash, and it
will be blacklisted.
But then if the user re-rename the file to "valid_name", then we should
invalidate the blacklist entry and retry to upload. But we did not do
that because renaming don't change the mtime and we did not store the
rename target in the database

IL issue 558
2016-05-25 15:32:45 +02:00
ckamm
bf02ccc1e8 Remember to upload files that are locked during a sync run (#4865)
See owncloud/enterprise#1342
2016-05-23 09:03:03 +02:00
Markus Goetz
552ba94c41 SyncEngine: Set isDirectory before syncItemDiscovered
(cherry picked from commit fc1933803e)
2016-05-20 17:00:22 +02:00
Markus Goetz
fc1933803e SyncEngine: Set isDirectory before syncItemDiscovered 2016-05-20 16:58:44 +02:00
Markus Goetz
46e4ec3183 Checksums: Use SHA1 like in >=2.2 2016-05-20 16:31:47 +02:00
Olivier Goffart
03e3b3bf50 Upload: put the job in the active list while doing the checksum computation.
This fixes an issue in which too many jobs are started un parallel
while uploading many files, which could cause too much memory usage as the
chunks are stored in memory.

Probably the fix for #4611
2016-05-20 16:28:27 +02:00
Christian Kamm
9aed8dbce8 Checksums: Compute content checksum on download #4375
Cherry-picked from d6d35029
2016-05-20 16:06:30 +02:00
ckamm
c6794cd338 Progress info: Reset between syncs #4856 (PR #4872) 2016-05-20 15:07:54 +02:00
Markus Goetz
a038c99232 Upload: Remove bandwidth quota debug message #4837 2016-05-18 16:18:13 +02:00
Olivier Goffart
30c8fa1c93 Utility: Fix translation of second, minute, hour
Issue #4855

A typo in the context string made the translation lookup fail.
But also the %Ln was not recognized as a plural form by transifex, so only
the singular was translated
2016-05-18 10:52:22 +02:00
Olivier Goffart
5676685f58 SyncEngine: Add a compile option so we rename to restoring a move we don't have the permission to do
IL issue 550
2016-05-12 13:15:30 +02:00
Jocelyn Turcotte
edc58c045f Fix assert on restore after propagation (#4823)
The assert was there to make sure that this case wasn't happening
to eventually be properly tested. Remove the assert for now but this
codepath should eventually be unit tested using this specific situation.
2016-05-11 18:16:46 +02:00
Jocelyn Turcotte
727e73d640 [shell/windows] Fix the windows status push not working (#4784)
Since the windows implementation first does cache lookups using the
path string, directories need to be passed identically as through
RETRIEVE_FILE_STATUS.

Change the convention to never have a trailing slash for directories
in the protocol. This allows the convention to be applied without
having to access the disk (since we'd need to know if the path is
represented by a directory) and also matches the convention of the
rest of the sync engine. Individual file manager plugins are then
responsible of handling pushed paths as not ending with a trailing
slash.

This also:
- Moves the trailing slash removal logic from the SyncFileStatusTracker
  to the SocketApi class
- Remove the unneeded QString::normalized call in fileStatus, since
  this should already be done by the FolderWatcher and plugins
2016-05-06 12:32:01 +02:00
Jocelyn Turcotte
7c2fdee78b Avoid a SyncFileStatusTracker private overload with the same name
Having an overload as a private function in the same class makes the
code harder to follow. Rename the private fileStatus to syncFileItemStatus.
2016-05-03 13:01:51 +02:00
Jocelyn Turcotte
7bfe46962f Simplify the root status logic
Go through fileStatus like other cases to make sure that all use
cases go through the same code path. This also makes sure to use
lookupProblem which will use lower_bound which is more efficient
for larger sets of sync problems.

This also fixes the issue with lookupProblem that prevented it to
properly match an empty pathToMatch, caused by the fact that the
problem map contains relative paths not starting with a slash.
2016-05-03 13:01:51 +02:00
Jocelyn Turcotte
32b3023a8e Fix the root item sync status #4682
Make sure that we push the new status when the status of the SyncEngine
changed. SyncEngine::started comes a bit late, only when the propagation
starts, although it's better in this case since child folders will
only switch to Sync in aboutToPropagate.

Also fix an issue with SyncEngine::findSyncItem when using an empty
fileName; this would match and return the wrong item, even though
not currently happening with the code since fileStatus won't call
it with an empty fileName anymore.
2016-05-03 13:01:51 +02:00
Jocelyn Turcotte
a5df44c757 Fix the sync status push for parent directories #4682
As before, we rely on metadata-update SyncFileItem entries for parent
directories to notify us that a directory contains files to propagate,
and to know when all children were propagated through its itemCompleted
signal.

Those metadata SyncFileItems however have a None direction and we need
to add a explicit directory check to show them as Sync.
This fix also handles new files as well as existing ones, so no need
to keep a separate logic for new files.
2016-05-03 13:01:51 +02:00
Olivier Goffart
a67173610d Propagator: fix qt4 build
propagatedownload.cpp:712:35: error: 'seenLockedFile' is a protected member of 'OCC::OwncloudPropagator'

Signals are protected in Qt4 but public in Qt5, mark the class accessing it
as friend when compiling with Qt4
2016-05-02 17:34:21 +02:00
ckamm
e6b937f508 LockWatcher: Keep an eye on Windows file locks (#4758)
When a conflict-rename or a temporary-rename fails, notify the
LockWatcher. It'll regularly check whether the file has become
accesible again. When it has, another sync is triggered.

owncloud/enterprise#1288
2016-04-29 16:14:18 +02:00
Olivier Goffart
be466b47b7 Merge remote-tracking branch 'origin/2.1' into 2.2 2016-04-29 08:52:17 +02:00
Olivier Goffart
11b144957b PropagateDownload: Throw an error if the file is empty while it should not have been (#4753)
If the downloaded file is empty but the PROPFIND previously announced it
should not have been empty, this might mean the file was somehow corrupted
because of a bug on the server and that we should therefore not accept
the file.

Normaly we accept a change between the actual size of the file and what we
got during discovery because the file might have been updated to a new version
inbetween. But after this patch we won't accept the file if it was replaced
by an empty file.

Will help for issue #4583
Also requested by IL for issue 548
2016-04-29 08:49:27 +02:00
ckamm
38bad564a0 Merge pull request #4739 from ckamm/trackdirty
Overlay icons: Track touched files #4730
2016-04-28 07:17:17 +02:00
Christian Kamm
c2fa3fb4c8 Overlay icons: Track touched files #4730
This uses the file watcher to keep track of files that were modified
in order to assign them the blue icon.

This is transient state that's not persisted across restarts.
2016-04-28 07:16:49 +02:00
Markus Goetz
f7c6efb391 ConnectionValidator: Also set short timeout for capabilities job
Default timeout was 5 min.
2016-04-27 12:19:49 +02:00
Christian Kamm
09eea7f5f2 Checksums: Use the first supported type if nothing is preferred 2016-04-26 13:10:53 +02:00
Olivier Goffart
0711abbf56 Theme: missing virtual keyword 2016-04-22 10:09:07 +02:00
Olivier Goffart
84ac2e64e0 Quota: Add branding option for the base folder (#4714)
As discussed on issue ##4460
Having the quote to be queried on subfolder is wrong in the generic case,
so add a branding option to configure it.

This partially reverts commit ff4cdc3161
2016-04-22 10:05:50 +02:00
Klaas Freitag
e5a5b95b9a Merge pull request #4689 from owncloud/overlays_handle_root
SyncFileStatusTracker: Add a method to handle the root folder of the sync.

Also, handle new files put in the sync in the statustracker logic.
2016-04-21 15:01:11 +02:00
Klaas Freitag
7acdf50a2c SocketAPI: Code simplifications as asked for in the review. 2016-04-21 14:54:13 +02:00
Klaas Freitag
361ebf5464 SyncFileStatusTracker: Remember the state of new files.
In the before-propagate slot, new files that wait to be
pushed to the server are remembered in the _syncProblems
map. That way, the parents show a sync icon properly as
asked for in #4682.

After the item has been transfered properly, the item is
removed from the map again because success is the default.
2016-04-21 13:56:08 +02:00
Olivier Goffart
522f7afa9e Merge pull request #4663 from 'ckamm/disabletransmissionchecksum'
Disable validation of transmission checksums by default
2016-04-21 11:46:01 +02:00
Olivier Goffart
fa69d089cf Checksums: remove the downloadChecksumValidationEnabled option
Added in previous commit from pull request #4663

As discussed, we do not need this option so no need to introduce
a new dependency on the config file in the sync engine
2016-04-21 11:43:44 +02:00
Klaas Freitag
bd37eab3ad SocketAPI: Display a warning on the directory if there are errors
Errors with individual files within a directory now result in
a warning label on the parent directories.
2016-04-19 18:18:00 +02:00
Markus Goetz
a17f37d8ae Discovery: Be more explicit about files with unknown size #4573
Also related https://github.com/owncloud/core/issues/23468
2016-04-19 15:31:16 +02:00
Daniel Molkentin
c0ec481436 No need for WebKitWidgets in libsync anymore 2016-04-16 10:58:12 +02:00
Klaas Freitag
0f3d6d4160 SyncFileStatusTracker: Add a method to handle the root item. 2016-04-15 15:02:02 +02:00
Olivier Goffart
fafca26144 AccountManager: take theURL from the Theme rather than from the config if the theme specify it (#4591)
That way an upgrade of the client can actually change the URL
Issue https://github.com/owncloud/enterprise/issues/1113
https://github.com/owncloud/enterprise/issues/1126

In addition to restoring commit 7e5d89293d, this
add a way to override the auth type
2016-04-15 13:16:49 +02:00
Christian Kamm
ea40e314d4 Add server capabilities for checksums #4638
* Add checksums/supportedTypes and checksums/preferredUploadType
  capabilities. The default is that no checksum types are supported.

* Remove the transmissionChecksum config option. Servers must now
  use the capabilities to indicate that they are fine with the
  client sending checksums.

Note: This intentionally breaks brandings that overrode
Theme::transmissionChecksum. The override must be removed and the
server's capabilities must be adjusted to include the new values.
2016-04-15 10:58:14 +02:00
Klaas Freitag
e2622310df Merge pull request #4670 from owncloud/implement_ep_1136_2nd_attempt
Make postfixlineedit more userfriendly, rename email id string to "Email"
2016-04-15 10:17:03 +02:00
Daniel Molkentin
97a6d3df82 document Theme::wizardUrlHint() 2016-04-13 15:59:25 +02:00
Daniel Molkentin
9cc981c8c7 Make postfixlineedit more userfriendly, rename email id string to "Email". 2016-04-13 14:56:49 +02:00
Klaas Freitag
15988c6fda SocketAPI: Use NOP only, not NONE in the share api protocol.
Otherwise, plugins might brake, as the linux one did.
2016-04-12 18:28:27 +02:00
Klaas Freitag
bf99306a53 Merge branch 'do_not_close_db_on_done' 2016-04-12 14:36:46 +02:00
Christian Kamm
41b950b7e6 Don't call reset() on a query after close() #4662 2016-04-12 10:30:46 +02:00