Commit graph

1024 commits

Author SHA1 Message Date
Christian Kamm
87b4693a9d Add error message for trailing spaces on Windows #4878 2016-06-09 12:41:02 +02:00
ckamm
28c12a3ca0 Move touched-files tracking to SyncEngine #4927 (#4946) 2016-06-09 12:07:18 +02:00
Christian Kamm
66f041f74c Fix Qt4 build 2016-06-07 10:05:57 +02:00
Christian Kamm
48efbcb8ca Merge remote-tracking branch 'origin/2.2' 2016-06-07 09:39:44 +02:00
Olivier Goffart
d072e4a678 Fix compilation on windows 2016-06-03 13:28:53 +02:00
Markus Goetz
d88ab4653b Connectivity: Delete job on timeout #4275
This was not done if there was no reply
2016-05-30 18:15:41 +02:00
Robin Geuze
d45d6ca9da Fix Qt4 build 2016-05-30 09:55:45 +02:00
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
159535fe90 Merge branch '2.2' 2016-05-25 16:30:17 +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
ckamm
567fe87e98 Use natural sorting for filenames if available #4859 (#4864) 2016-05-19 15:36:46 +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
Klaas Freitag
868edb1f0d SyncJournalDb: Only close the db if the return code is not SQLITE_DONE
SQLITE_DONE is the indicator for not more query results, which is a legal
thing and not an error condition.

Also, check _getFileRecordQuery for null pointer, as close() wipes it.
2016-04-11 17:38:16 +02:00
Klaas Freitag
aaf43bd0d3 SyncJournalDb: Handle empty filename and avoid a bogus db query. 2016-04-11 17:36:15 +02:00
Klaas Freitag
d5f1d1c6b2 SqlQuery: Add method errorId() to get the numeric error code. 2016-04-11 17:34:59 +02:00
Klaas Freitag
6cb94e8849 Merge pull request #4656 from owncloud/close_journal_fix
Close journal fix - do not keep the journal open or reopen on error.
2016-04-11 16:14:17 +02:00
Klaas Freitag
d433c24186 Check if the record returned from getFileRecord is valid.
Handle database fails properly.
2016-04-11 16:04:20 +02:00
Olivier Goffart
6ee7e82913 Handle setFileRecord errors #4632 2016-04-11 14:11:11 +02:00
Klaas Freitag
648328fbe2 SyncJournalDb: Close the db on error in getFileRecord()
The idea is that the next call to any database operation will try to
reopen the database through the checkConnect() method. So even if there
was a disconnect trom the db file, this will reestablish the connection.
2016-04-11 12:40:19 +02:00
Klaas Freitag
ee58cc3b66 SyncEngine: Close the sync journal after the sync run has finished. 2016-04-11 11:31:54 +02:00
Klaas Freitag
42439490cc Merge pull request #4645 from owncloud/fix_4633
SelectiveSync: Verify if the list could be read from journal.

If not handle the error rather than assuming the selective sync list is empty.
2016-04-07 09:14:33 +02:00
Klaas Freitag
e4604b406f SyncEngine: finalize properly on error with syncjournal 2016-04-06 17:20:48 +02:00
Klaas Freitag
7b1f02fcda SelectiveSync: Verify if the list could be read from journal.
If there is a read error from the database while trying to get
the list from database, make sure to not behave badly because
the list is empty.
2016-04-06 15:01:28 +02:00
Klaas Freitag
52a5234122 Merge pull request #4641 from owncloud/bubbleUpConflicts
Bubble up conflicts: Show a tray notification on conflicts and show the conflicts in the not-synced list.
2016-04-06 13:45:47 +02:00
Klaas Freitag
252aea25da ProgressDispatcher: Improve wording about conflicts. 2016-04-05 16:38:18 +02:00
Klaas Freitag
7994b3d91a ProtocolWidget: handle Conflicts as not-synced items 2016-04-05 11:13:12 +02:00
Olivier Goffart
3334067d9f Merge branch '2.1'
Conflicts:
	src/gui/socketapi.cpp
2016-04-04 16:58:49 +02:00
Olivier Goffart
434d16941b SyncEngine: fixed restoring files when they are moved in a new directory
Imagine tgus scenario on a read only share that you move file from
one location to a new directory in the read only share.
Creating the read only directory fails for permission error.
But we should also restore the files that have been moved.

IL issue 542
2016-04-04 10:41:12 +02:00
Klaas Freitag
6b0d535120 Merge branch 'notifications' 2016-04-04 10:40:33 +02:00
Christian Kamm
c150350096 SyncFileStatusTracker: Fix compilation with older Qt 2016-03-30 13:42:08 +02:00
Christian Kamm
c35e74d264 Theme: Enable link sharing by default
Was disabled by accident.
2016-03-30 13:33:12 +02:00
Olivier Goffart
cdbc25ede8 Merge pull request #4615 from owncloud/socketApiRefactor
Socket API refactor
2016-03-30 13:24:10 +02:00
Jocelyn Turcotte
2c0caf8b75 Fix the SocketApi status of CSYNC_FILE_SILENTLY_EXCLUDED files
Bring back the hardcoded status logic for excluded files.
Since the activity log doesn't even mention those files on purpose,
we can't rely on the SyncEngine to notify us about the status of those files.
2016-03-30 12:10:51 +02:00
Jocelyn Turcotte
56064c9366 Fix sibbling directories showing up as warning
Looking up a/aa while an error is present in a/aab/aaba would return
a warning status since a/aa is a substring of a/aab.
Fix the issue by checking if the following character is a slash.
2016-03-30 11:22:01 +02:00
ckamm
98995f45e6 Merge pull request #4618 from ckamm/progressui
Progress layout adjustments
2016-03-30 09:22:27 +02:00
Jocelyn Turcotte
ef57d4ae11 Move the SyncFileStatusTracker directory slash suffix logic in a method 2016-03-29 17:55:02 +02:00
Jocelyn Turcotte
fbf23b6abb Cleanup after the SyncFileStatusTracker change
- Add missing explicit keywords
- Add doc
- Comment out verbose and partly redundant qDebug statements
2016-03-29 17:39:30 +02:00
Jocelyn Turcotte
47a552f8c2 Use a std::map for SyncFileStatusTracker problems
This prevents having to define a Problem structure with dubious
operator overloads to accomplish the same.
Also use std::map::lower_bound to quickly iterate over the
list of problems.
2016-03-29 17:29:36 +02:00
Klaas Freitag
69e8e15884 Remove explicit time spec specification as it is not needed. 2016-03-29 13:59:08 +02:00
Olivier Goffart
98091aeab7 Theme: document forceSystemNetworkProxy (#4458) 2016-03-29 13:08:33 +02:00
Christian Kamm
41f43feecf Add utility function for shorter time duration strings #3403 2016-03-29 12:26:09 +02:00
Christian Kamm
4915bbf8f3 Adjust size description strings #3403
@jancorchardt suggested to not have decimal places on file
sizes, except for GB.
2016-03-29 12:26:09 +02:00
Jocelyn Turcotte
82190eaa81 Refactor the overlay icon logic to show errors as a warning for parent folders #3634
This also remove all smartness from the SocketApi about the status
of a file and solely use info from the current and last sync.
This simplifies the logic a lot and prevents any discrepancy between
the status shown in the activity log and the one displayed on the
overlay icon of a file.

The main benefit of the additional simplicity is that we are able
to push all new status of a file reliably (including warnings for
parent folders) to properly update the icon on overlay implementations
that don't allow us invalidating the status cache, like on OS X.

Both errors and warning from the last sync are now kept in a set,
which is used to also affect parent folders of an error.

To make sure that errors don't become warning icons on a second
sync, SyncFileItem::_hasBlacklistEntry is also interpreted as an error.
This also renames StatusIgnore to StatusWarning to match this semantic.

SyncEngine::aboutToPropagate is used in favor of SyncEngine::syncItemDiscovered
since the latter is emitted before file permission warnings are set on the
SyncFileItem. SyncEngine::finished is not used since we have all the
needed information in SyncEngine::itemCompleted.
2016-03-28 14:29:48 +02:00
Jocelyn Turcotte
69aa39f1f6 Don's use SyncFileStatus for Folder::createGuiLog
SyncFileStatus' purpose is to track overlay icon status.
Instead of putting comments and default: clauses in switch
on both sides about unused enums, use different enums.

This also remove STATUS_NEW which is the equivalent of
STATUS_SYNC in all shell extension implementations, and
remove STATUS_UPDATED and STATUS_STAT_ERROR which have
the same semantic as STATUS_UPTODATE and STATUS__ERROR.
2016-03-28 14:29:47 +02:00
Jocelyn Turcotte
ea5e6d367b Connect the SocketApi directly to the SyncFileStatusTracker
Don't go through the Folder->ProgressDispatcher->SocketApi route and
keep the path logic in SyncFileStatusTracker.
2016-03-28 14:29:47 +02:00
Jocelyn Turcotte
da7b9916e5 Move the SocketApi business logic to a libsync SyncFileStatusTracker class
This will allow testing this code and avoid going through too many
layers to get notified and a file status changed.
2016-03-28 14:29:47 +02:00
Jocelyn Turcotte
a4e0899af4 Remove the mutex from ExcludedFiles
It's always accessed from the main thread.
2016-03-28 14:29:47 +02:00
Jocelyn Turcotte
2d2c7bc9b8 Move the SyncEngine construction to the Folder constructor
The SyncEngine is now created only once, at construction of the
Folder, instead of being reconstructed on each sync.
2016-03-28 13:26:38 +02:00
Jocelyn Turcotte
df386b64ba Make the AccountState a construction argument of the Folder
This will help moving the SyncEngine construction in the constructor
and allow moving functionalities from Folder to SyncEngine or its
delegated objects.
2016-03-28 13:07:28 +02:00
Daniel Molkentin
7730e826b0 Merge pull request #4580 from owncloud/implement_ep_1136
Implement EP 1136
2016-03-24 14:58:09 +01:00
Daniel Molkentin
2d24585a8f Implement enforcing a static URL postfix.
Second part of EP 1136
2016-03-24 14:18:52 +01:00
Daniel Molkentin
fb75adcd57 Wizard: Implement alternative forms of inquiring about the userID
Settable in the theme.
2016-03-21 23:50:48 +01:00
Klaas Freitag
f587f35ef0 Fix plural translation handling, remove the superflous arg() 2016-03-21 15:03:28 +01:00
Jocelyn Turcotte
c55ac504a3 Merge pull request #4584 from lultimouomo/fix-destruction-order
Fix crash due to destruction order
2016-03-18 18:58:23 +01:00
Luca Niccoli
6735126c09 Fix crash due to destruction order 2016-03-18 16:41:48 +01:00
Klaas Freitag
b9663456d8 Notifications: Refresh the notifications based on a config value.
Pulls a timer that polls for new notifications regularly. Add
Config file method for the interval value.
2016-03-18 16:28:20 +01:00
Klaas Freitag
0e1b9a346d Fix plural translation handling, remove the superflous arg() 2016-03-18 15:28:00 +01:00
Christian Kamm
0febe9b0df Revert "Utility: Make sure to use UTC timestamp to compare in timeAgoInWords"
This reverts commit 41b43bf961.

Using now in UTC should make no difference, but that assert might
trigger...
2016-03-18 13:15:35 +01:00
Klaas Freitag
f04895a407 Utility: Fix plural translation. 2016-03-18 08:31:13 +01:00
Klaas Freitag
41b43bf961 Utility: Make sure to use UTC timestamp to compare in timeAgoInWords
This should help to fix the problems we see in #4521
2016-03-18 08:31:03 +01:00
Klaas Freitag
f71fdab997 Fix timeAgoInWords 2016-03-18 08:20:23 +01:00
Christian Kamm
4b19cdeca0 Propfind: Treat broken XML response as failure #4575
Soldiering on with a broken or incomplete response could lead to
incorrect sync behavior.

Since discovery uses LsCol jobs which already handle errors
correctly, this should not have a significant impact.
2016-03-17 11:32:19 +01:00
Olivier Goffart
3d157cbb02 User-Agent: put the actual version string in there
It contains the build id in addition

(cherry picked from commit e0e793fb14a5c32b21db95a63ebf48084621ff4d)
2016-03-17 10:52:55 +01:00
Olivier Goffart
80b5f3f43d Never overwrite the size from the db when updating the metadata
the size on the server might be different from the size on the client
with certain backend so it should be ignored.

(cherry picked from commit 9222db6df9b19a21e1bea5a238d745d96a6385e3)
2016-03-17 10:48:49 +01:00
Christian Kamm
4900703970 SqlQuery: Write NULL when intended #4548
In SQLite bindings are not cleared by sqlite3_reset() calls, so
skipping a sqlite3_bind call to create a NULL value doesn't work,
instead the previous value will be written.

To fix this, I clear all bindings in SqlQuery::reset and make sure
to explicitly bind NULL when desired in SqlQuery::bind.

To make sure there's no confusion about SqlQuery::reset and
sqlite3_reset, I rename our method to reset_and_clear_bindings().

(cherry picked from commit 7bd4f95b8c)
2016-03-15 15:17:35 +01:00
Christian Kamm
7bd4f95b8c SqlQuery: Write NULL when intended #4548
In SQLite bindings are not cleared by sqlite3_reset() calls, so
skipping a sqlite3_bind call to create a NULL value doesn't work,
instead the previous value will be written.

To fix this, I clear all bindings in SqlQuery::reset and make sure
to explicitly bind NULL when desired in SqlQuery::bind.

To make sure there's no confusion about SqlQuery::reset and
sqlite3_reset, I rename our method to reset_and_clear_bindings().
2016-03-15 14:38:31 +01:00
Markus Goetz
9d5307d04c Propagator: On remove move, take size from DB
Some servers can claim different sizes for on-the-fly protected/encrypted
MS Office files during discovery.
2016-03-15 10:28:47 +01:00
Markus Goetz
9460aa7f21 SyncEngine: Also emit item in other code path
Else a user of this library cannot build a complete list of items.
2016-03-14 18:12:07 +01:00
ckamm
25baa995ec Merge pull request #4532 from ckamm/content-checksum
Enable content checksums #4375
2016-03-14 09:49:31 +01:00
Markus Goetz
6c07f08175 Proxies: Enable ownBrander to force system proxy usage #4458 2016-03-11 16:21:40 +01:00
Klaas Freitag
b97c832306 Capabilities: Add isValid check and check for notifications
The isValid check should be used everywhere the capabilities
are used as the loading of the capabilities is happening
in parallel of the startup, so it is not guaranteed to be
available always.
2016-03-10 17:46:00 +01:00
Klaas Freitag
0eb1041290 AbstractNetworkJob: Add a delete job.
It is needed to easily send delete requests which happen
through the notify API.
2016-03-10 17:22:36 +01:00
Markus Goetz
a14b495864 Old servers: Don't nag if version still undetected #4523 2016-03-09 15:57:45 +01:00
Markus Goetz
2843214d09 Merge pull request #4531 from ckamm/old-server
Add warnings for old server versions #4523
2016-03-09 15:16:48 +01:00
Olivier Goffart
54612455e6 Merge pull request #4513 from owncloud/csyncContextToSyncEngine
Move the csync_context creation in SyncEngine
2016-03-08 18:12:31 +01:00
Jocelyn Turcotte
e91a5c85ff Move the Logger reference back into src/gui 2016-03-03 20:26:48 +01:00
Jocelyn Turcotte
7561f5c717 Add comment and cleanup the csync exclude list code
Removed the csync_add_exclude_list function that isn't use anywhere
anymore.
2016-03-03 20:26:48 +01:00
Christian Kamm
c554f5383c Downloads: Preserve group ownership #4330 2016-03-03 12:02:06 +01:00
Christian Kamm
4f48c888ef Don't use QVector::removeOne, added in Qt 5.4
A QList makes sense there and makes the rest of the code
work with earlier Qt versions.
2016-03-03 10:03:41 +01:00
Markus Goetz
266508b691 Merge pull request #4529 from owncloud/dynamic_parallelism_scaling
Propagator: Pump in more requests if we think current ones are quick
2016-03-02 15:23:58 +01:00
Markus Goetz
d78c3679e7 Propagator: Pump in more requests if we think current ones are quick
Helps with small file sync #331
When I benchmarked this, it went up to 6 parallelism and
was about 1/3 faster than the previous fixed 3 parallelism.
Doing more than 6 is dangerous because QNAM limits to 6 TCP
connections and also the server might become a bottleneck.

Should also help for #4081
2016-03-02 15:22:21 +01:00
Christian Kamm
d6d3502960 Checksums: Compute content checksum on download #4375 2016-03-02 14:28:41 +01:00
Christian Kamm
7ed7512f27 Checksums: Content checksums for all uploads #4375 2016-03-02 14:28:20 +01:00
ckamm
ffa78b99d9 Merge pull request #4512 from owncloud/add-checksum-to-database
Checksums: keep the transfer checksum in the database as the content …
2016-03-02 14:04:37 +01:00
Christian Kamm
f66c28900a Add warnings for old server versions #4523
* A tray message on every start up
* Red message in account settings
* Folders are paused when the server version switches to
  an unsupported one
2016-03-02 12:54:22 +01:00
ckamm
6e9019120f Merge pull request #4527 from ckamm/account-pause
Account pausing #3829
2016-03-02 10:35:40 +01:00
Christian Kamm
d521232587 AccountState: Allow storing state in settings
This will be useful if we ever want to store account-level gui state.
I built this originally because I thought a paused account would be
this kind of state.
2016-03-01 16:08:23 +01:00
Roeland Douma
f24fa46789 Merge pull request #4496 from owncloud/fix_4325
Add theming options control sharing operations
2016-03-01 15:33:04 +01:00
Christian Kamm
a9b00a7489 Don't make files read-only when server is too old #4450 2016-03-01 10:11:20 +01:00
Jocelyn Turcotte
b8227afcaa Move the csync_context creation in SyncEngine
The creation doesn't need to be separated from the SyncEngine anymore.
This allows the SyncEngine to be created in fewer steps if we want to
use it in tests.

This moves most of the direct csync code from Folder into the SyncEngine.
The exclude file logic for the context has been wrapped using the
existing ExcludedFiles class as well.
2016-02-25 20:53:13 +01:00
Olivier Goffart
e6f81d3965 Checksums: keep the transfer checksum in the database as the content checksum
Currently, we only use this for .eml files. But we can just store this checksum
in the database if it was computed anyway.

Issue #4487
2016-02-25 17:17:14 +01:00
Olivier Goffart
60c101d90b PropagatorDownload: fix possible crash
Backtrace seen from the crash reporter where reply() is null.
2016-02-24 19:52:14 +01:00
Olivier Goffart
b685f6b6b6 Chunking: change the default chunk size to 10MB
As discussed with Klaas, this seems to be a better compromise.
10MB * 3 prarralel jobs = 30MB in memory, and to retry in case of
disconnection. Which is still reasonable.  And might make the upload
almost twice as fast on fast network where the amount of chunk is the
bottleneck (because of more server processing)

Relates to issue #4354
2016-02-24 16:25:45 +01:00
Markus Goetz
fe7630954e Propagator: Remove 100msec delay between jobs 2016-02-23 14:27:35 +01:00
Olivier Goffart
b3d57f3c7c Cleanup syncengine after the new option not to ask confirmation when everything is removed
Cleanup after pull reuqest  #4389

Do not make the SyncEngine depends on the ConfigFile
2016-02-22 16:14:22 +01:00
Markus Goetz
a76ba06817 Merge pull request #4389 from Bottswana/deleteprompt
Add option to disable the delete all files prompt
2016-02-22 15:44:50 +01:00
Roeland Jago Douma
99b3b752e3 Add theming options control sharing operations
Fixes #4325
2016-02-22 13:53:45 +01:00
Markus Goetz
5d7aa792e7 SyncEngine: Improve error message for ignored files/folders #4143 2016-02-22 11:13:29 +01:00
Hefee
28b694b170 Merge branch '2.1' 2016-02-20 10:34:34 +01:00
Klaas Freitag
7f18d087e6 Utility: Make the timeAgoInWords method a bit more verbose 2016-02-15 17:59:24 +01:00
Olivier Goffart
dd89ab59e4 Use oc:size instead of quota-used-bytes to get the sizes of folder (#4459) 2016-02-11 15:09:47 +01:00
Olivier Goffart
cd83772112 SyncJounral: add an index on the error blacklist table
https://github.com/owncloud/enterprise/issues/1035
2016-02-11 14:38:38 +01:00
Olivier Goffart
c93ecfbfb5 Merge branch restore_backup 2016-02-10 17:47:06 +01:00
Olivier Goffart
893e22691d ConnectionValidator: Make sure we intercept propfind error
If the PROPFIND return an invalid code (like 200) then we would
not recieve the error signal and we would never sync again.

Found while investigating https://github.com/owncloud/enterprise/issues/1068
2016-02-10 15:38:21 +01:00
Olivier Goffart
e9307bb797 Use a constant for ConnectionValidator::DefaultCallingIntervalMsec
So there is no runtime initialization
2016-02-10 12:36:09 +01:00
Olivier Goffart
6b643c7501 Discovery: don't ignore recall file #4420
The ".sys.admin#recall#" is the recall file and should not be ignored
even if hidden.

The remote discovery do not need to detect hidden files because it
is already detected by csync in all cases. So this avoid code duplication
2016-02-08 12:07:34 +01:00
Olivier Goffart
54a278edb9 fix compilation with TOKEN_AUTH_ONLY 2016-02-05 15:30:29 +01:00
James Botting
d8af949a6a Alter sync engine to check new setting before displaying prompt 2016-01-24 18:45:29 +00:00
James Botting
74a8c4aae8 Add additional configuration option to toggle display of delete prompt 2016-01-24 18:45:12 +00:00
Jocelyn Turcotte
8486a2fd2b Bring back the automatic authentication popups
Users have complained that they don't see the notification when it is
shown and are not aware that their files aren't syncing.

Remove the non-interactive credentials fetch logic and add make sure
that the shibboleth popup will flash in the taskbar instead.
This will still not allow the popup to show in front in all cases,
but this is a compromise that we have to chose.

This reverts commit dcb687929f.
Issue https://github.com/owncloud/enterprise/issues/990
2016-01-22 14:25:36 +01:00
Olivier Goffart
47710d167a SyncEngine: fix inode after move if the file has moved on the file system
This is the fix for issue #4370

Step to reproduce the bug:
 1) have lots of files in directory "dir1"
 2) do mkdir dir2 && mv dir1/* dir2
 3) DURING the sync (which takes time because of the many moves) do mkdir dir3 && mv dir2/* dir3/
 4) observe that files are PUT in the next sync

The problem is that SyncJournalFileRecord::SyncJournalFileRecord will fail to
get the inode after the forst move because the files are already moved on the
filesystem.  Normaly it should use the inode from the discovery phase in that
case but that is not working because it comes from the remote node in case of
moves, so the code in SyncEngine::treewalkFile would not set the inode.

Test in https://github.com/owncloud/smashbox/pull/143
2016-01-20 13:49:12 +01:00
Christian Kamm
17895f3a30 Win: Fix filesystem detection for exFAT workaround #2701 2016-01-19 10:00:12 +01:00
Olivier Goffart
d12c0939b9 Upload: Chunk size can be changed in the config file
Added a new "chunkSize" entry in the General group of the owncloud.cfg
which can be set to the size, in bytes, of the chunks.

This allow user with hude bandwidth to select more optimal chunk size

Issue #4354
2016-01-15 13:16:52 +01:00
Olivier Goffart
bbedeed1c5 SyncEngine: For server older than 8.1, ignore invalid char in new directories
Server older than 8.1 cannot cope with invalid char in the filename
so we must not send them from the client. We were already checking
for new files, but not for renames or new directories.

https://github.com/owncloud/enterprise/issues/1009
2016-01-13 17:53:12 +01:00
Olivier Goffart
272755e1ec ConfigFile: Create the directory when using --confdir and it does not exist
Previously we would fail to start if the directory was not existing.
This was working for relative directory, but it should also work for
absolute ones

https://github.com/owncloud/enterprise/issues/970
2016-01-13 10:31:02 +01:00
Christian Kamm
abf5a5ad1e Propagation: Fix dir <-> file changes propagating to server #4302
* Ensure every time a file becomes a directory or the other way around
  the item is flagged as INSTRUCTION_TYPE_CHANGE.
* Delete the badly-typed entity if necessary in the propagation jobs.
2016-01-08 05:38:08 +01:00
Christian Kamm
d4b6b5cb1d Propagator: Remove warning when moving out of deleted folder 2016-01-08 05:38:08 +01:00
Olivier Goffart
81b7798ac2 HttpCredentials::slotAuthentication: fix comment
The recent revert did no fix the comment
2016-01-07 14:58:02 +01:00
Olivier Goffart
868d4c781a HTTP creds: Fix GUI blocking for 5 seconds when entering wrong password
The Qt HTTP thread calls authenticationRequired (indirectly) using a
BlockingQueuedConnection. So when we call invalidateToken from slot
connected to this signal and end up calling QNAM::clearAccessCache which
waits on the thread for 5 seconds

Backtraces:

Qt HTTP thread:
 #0  0x00007ffff20c707f in pthread_cond_wait@@GLIBC_2.3.2 ()
 #1  0x00007ffff43f0c0b in QWaitConditionPrivate::wait
 #2  QWaitCondition::wait
 #3  0x00007ffff43ea06b in QSemaphore::acquire
 #4  0x00007ffff45dcf6f in QMetaObject::activate
[...]
 #9  0x00007ffff45dd607 in QMetaObject::activate
 #10 0x00007ffff4edbaf7 in QHttpNetworkReply::authenticationRequired
 #11 0x00007ffff4e0b2b4 in QHttpNetworkConnectionPrivate::handleAuthenticateChallenge
 #12 0x00007ffff4e10753 in QHttpNetworkConnectionChannel::handleStatus
 #13 0x00007ffff4e11cc9 in QHttpNetworkConnectionChannel::allDone
 #14 0x00007ffff4e14605 in QHttpProtocolHandler::_q_receiveReply

Main Thread:
 #0  0x00007ffff20c7428 in pthread_cond_timedwait@@GLIBC_2.3.2 ()
 #1  0x00007ffff43f0b56 in QWaitConditionPrivate::wait_relative (time=5000, this=0x136c580)
 #2  QWaitConditionPrivate::wait (time=5000, this=0x136c580)
 #3  QWaitCondition::wait (this=this@entry=0x136c788, mutex=mutex@entry=0x136c760, time=time@entry=5000)
 #4  0x00007ffff43efa6e in QThread::wait (this=<optimized out>, time=time@entry=5000)
 #5  0x00007ffff4e1edd3 in QNetworkAccessManagerPrivate::clearCache
 #6  0x00007ffff7b6fb03 in OCC::HttpCredentials::invalidateToken()
 #7  0x000000000057adb4 in OCC::AccountState::slotInvalidCredentials()
 #8  0x000000000057ac76 in OCC::AccountState::slotConnectionValidatorResult(OCC::ConnectionValidator::Status, QStringList const&) ()
 #9  0x00000000005ab45c in OCC::AccountState::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)
 #10 0x00007ffff45dcd30 in QMetaObject::activate
 #11 0x00007ffff7b78671 in OCC::ConnectionValidator::connectionResult(OCC::ConnectionValidator::Status, QStringList) ()
 #12 0x00007ffff7ae2514 in OCC::ConnectionValidator::reportResult(OCC::ConnectionValidator::Status) ()
 #13 0x00007ffff7ae39b7 in OCC::ConnectionValidator::slotAuthFailed(QNetworkReply*) ()
 #14 0x00007ffff7b784a9 in OCC::ConnectionValidator::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) ()
 #15 0x00007ffff45dcd30 in QMetaObject::activate
 #16 0x00007ffff7b766dc in OCC::AbstractNetworkJob::networkError(QNetworkReply*)
 #17 0x00007ffff7af9f6e in OCC::AbstractNetworkJob::slotFinished()
 #18 0x00007ffff7b7654d in OCC::AbstractNetworkJob::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) ()
 #20 0x00007ffff45dd607 in QMetaObject::activate
 #21 0x00007ffff4edd143 in QNetworkReply::finished
 #22 0x00007ffff4e3fec7 in QNetworkReplyHttpImplPrivate::finished
 #23 0x00007ffff4e41818 in QNetworkReplyHttpImpl::close
 #24 0x00007ffff7b7047b in OCC::HttpCredentials::slotAuthentication(QNetworkReply*, QAuthenticator*) ()
 #25 0x00007ffff7b79092 in OCC::HttpCredentials::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) ()
 #27 0x00007ffff45dd607 in QMetaObject::activate
 #28 0x00007ffff4e1d6fb in QNetworkAccessManager::authenticationRequired
 #29 0x00007ffff4e1ea07 in QNetworkAccessManagerPrivate::authenticationRequired
 #30 0x00007ffff4e3c784 in QNetworkReplyHttpImplPrivate::httpAuthenticationRequired

Another case of Main Thread:
 #5  0x00007ffff4e1edd3 in QNetworkAccessManagerPrivate::clearCache
 #6  0x00007ffff7b6fb03 in OCC::HttpCredentials::invalidateToken()
 #7  0x000000000057b1e4 in OCC::AccountState::slotInvalidCredentials() ()
 #8  0x00000000005abb8a in OCC::AccountState::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) ()
 #9  0x00007ffff45dcd30 in QMetaObject::activate
 #10 0x00007ffff7b76ed5 in OCC::Account::invalidCredentials() ()
 #11 0x00007ffff7ad55f5 in OCC::Account::handleInvalidCredentials()
 #12 0x00007ffff7afa69a in OCC::AbstractNetworkJob::slotFinished()
 #13 0x00007ffff7b7654d in OCC::AbstractNetworkJob::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) ()
 #15 0x00007ffff45dd607 in QMetaObject::activate
 #16 0x00007ffff4edd143 in QNetworkReply::finished
 #17 0x00007ffff4e3fec7 in QNetworkReplyHttpImplPrivate::finished
 #18 0x00007ffff4e41818 in QNetworkReplyHttpImpl::close
 #19 0x00007ffff7b7047b in OCC::HttpCredentials::slotAuthentication(QNetworkReply*, QAuthenticator*) ()
 #20 0x00007ffff7b79092 in OCC::HttpCredentials::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) ()
 #22 0x00007ffff45dd607 in QMetaObject::activate
 #23 0x00007ffff4e1d6fb in QNetworkAccessManager::authenticationRequired
2016-01-07 14:46:49 +01:00
Daniel Molkentin
9c7066ac47 Translation cleanups
- Disambiguation
- Remove potentially illigitmate concatenations
2016-01-06 16:50:59 +01:00
Jocelyn Turcotte
2f355c473a Don't show parent folders in the error list #3796
The error status of children should only be used for the etag logic.
The SocketApi uses a path matching system to do this and the UI should
report errors only for individual involved files/directories.
2016-01-06 12:37:35 +01:00
Markus Goetz
ef9483c82d Revert "HTTP Creds: Do not send the password at every request"
We need this for #4326

This reverts commit ae17f58b80.
2016-01-06 11:50:52 +01:00
Jocelyn Turcotte
62df938465 Rename SyncFileStatus::STATUS_SYNC to STATUS_UPTODATE
Also use STATUS_UPDATED instead to match SyncFileItem::Success in the SocketAPI.
2016-01-05 15:41:15 +01:00
Markus Goetz
634dad033f Debug: Attempt to make log more useful 2016-01-05 15:12:00 +01:00
Jocelyn Turcotte
6e3809528e Fix OK statuses not being broadcasted during a sync #3944
Since the presence of any path in SyncEngine::_syncedItems
would translate in a SYNC status, platforms that don't refresh
all their status cache after an UPDATE_VIEW message like OS X
or Windows would keep displaying that status even after all
files are successfully synchronized.

- Read SyncFileItem::_status to determine the status to display mid-sync
- Match moved paths also to _renameTarget since this might be the
  path to match
- Make sure that PropagateDirectory jobs also set SyncFileItem::_status
  properly
2016-01-05 15:08:26 +01:00
Christian Kamm
2662203fb7 Windows: Fix deleting and replacing of read-only files #4308 2016-01-05 13:15:59 +01:00
Olivier Goffart
1bb76f5343 Attempt to recover from backup restoration on the server
If all the files bring us to past timestamp, it is possibly a backup
restoration in the server. In which case we want don't want to just
overwrite newer files with the older ones.

Issue #2325
2016-01-05 12:14:18 +01:00
Christian Kamm
d4edab02b0 Propagator: Deal with directories becoming files #4302
Note, in particular the revised order of directory deletion jobs.
2016-01-05 10:26:41 +01:00
Christian Kamm
5cc4c03b6a Propagator: Deal with files becoming directories #4302
This needed adjustments in reconcile, to mark the item as SYNC
as well as additions to the LocalMkdir job.
2016-01-05 10:26:41 +01:00
Olivier Goffart
cf5b1e401c csync_vio_local_stat: Win: fetch mtime and size if not previously fetched
Since owncloud 2.1, csync_vio_local_stat was optimized because readdir
would already fetch most of the info.  This works for the discovery,
but not later.  And we used this function later for symliks and co.

So this fixes the .lnk on windows

Issue #4300
2015-12-21 14:25:30 +01:00
Olivier Goffart
11174ddf4c PropagateLocalRemove: Make it possible to remove read only files (#4277) 2015-12-21 13:25:10 +01:00
Christian Kamm
e3b53b7e74 Log: Remove scary messages :) 2015-12-10 11:50:19 +01:00
Christian Kamm
8b5474ff67 SocketAPI: Don't use ERROR for SoftErrors #3944 2015-12-10 11:02:38 +01:00
Christian Kamm
4dfce57a58 Creds: Forget password on explicit sign-out #4241 2015-12-09 11:31:37 +01:00
Christian Kamm
a2eee7e349 Share UI: Hide 'allow editing' for files #4211 2015-12-08 15:37:17 +01:00
Christian Kamm
eb28d171f3 Doc: Add checksum overview 2015-12-08 10:59:42 +01:00
Klaas Freitag
cf06083d1b Utilities: Include math.h because of floor() 2015-12-02 17:56:37 +01:00
Roeland Jago Douma
c79879aa07 [Sharing] Default capabilitie for link sharing
Required to fix sharing for pre 8.1 servers
2015-11-30 16:55:06 +01:00
Klaas Freitag
1ad8e539aa SyncJournalFileRecord: Fix comparison operator
Compare only full seconds, as milliseconds can disappear during storage
of the database.

This is needed to fix the syncjournaldb test reliably. And maybe
elsewhere.

Also see
http://www.qtcentre.org/threads/13618-Problem-with-comparing-two-QDateTime-objects
2015-11-25 21:11:58 +01:00
Christian Kamm
698f47d5ad Blacklist: Treat all 403s the same #4071
We can't detect firewall errors due to error message localization.
2015-11-25 12:49:57 +01:00
Christian Kamm
df63579071 Blacklist: Firewall errors are silenced for up to 1h only #4071 2015-11-25 10:39:43 +01:00
Christian Kamm
f96d94f143 ShareDialog: Only link share if capabilities allow #4179 2015-11-24 11:58:10 +01:00
Christian Kamm
adea301e5b Blacklist: Clear on successful chunk upload #3934 2015-11-24 10:09:55 +01:00
Markus Goetz
b52a3a415c Connectivity: Improve reconnecting after network change/disconnect #4167 2015-11-23 21:48:26 +01:00
Markus Goetz
33dcb0c8d9 PropagateLocalRemove: Add debug
Was not in log so far
2015-11-23 21:48:25 +01:00
Christian Kamm
2458f07ca1 Checksums: Reuse the discovery checksum where possible 2015-11-23 14:13:10 +01:00
Christian Kamm
6cf5fc7f7d Permissions: Keep more user permissions
t4.pl discovered that it'd needlessly override permissions sometimes
2015-11-23 13:24:05 +01:00
Christian Kamm
10db6cee6c Rename files 2015-11-23 12:09:25 +01:00
Christian Kamm
a25f094c4c Checksums: Don't reupload if size and checksum are unchanged #3235
* Compute the content checksum (in addition to the optional
  transmission checksum) during upload (.eml files only)

* Add hook to compute and compare the checksum in csync_update

* Add content checksum to database, remove transmission checksum
2015-11-23 11:59:56 +01:00
Christian Kamm
bdf830f691 Add an experimental ProppatchJob #3235 2015-11-23 11:59:56 +01:00
Olivier Goffart
0020211857 owncloudcmd: Don't do a check that file are older than 2s (#4160)
This is required for the smashbox test to pass
2015-11-20 15:16:09 +01:00
Klaas Freitag
421c6a92f3 NetworkJobs: JSON network job now reports OCS reply code.
The signal jsonReceived() now not only delivers the raw json string, but
also the status code that came as OCS reply.

Also, fixed a typo in the signals name (recieved => received).
2015-11-19 16:01:51 +01:00
Klaas Freitag
8abaf92083 Merge git://github.com/NvanAdrichem/client into 2.1, pull #4060 2015-11-18 17:00:19 +01:00
Klaas Freitag
62d26814b2 SyncEngine: Handle 403 Forbidden properly.
A 403 is a reply code sent from the file firewall to indicate that
this directory is forbidden to use for the user.

The patch handles it by setting the state to IGNORED.

This addresses #3490
2015-11-18 15:31:55 +01:00
Markus Goetz
ef17dc6482 Connectivity: Improve log output 2015-11-17 11:02:53 +01:00
Markus Goetz
9978dc3f6c QNAM: Use invalid configuration instead of default configuration
For #3969 and others.
2015-11-17 11:02:53 +01:00
Klaas Freitag
e38bc6eab8 AcitivityWidget: Moved timespan-in-words method to utility.
Also added a second parameter, fixed plural translation and added
a less-than-a-minute-ago term.
2015-11-16 18:08:25 +01:00
Klaas Freitag
87aa1de67a Merge branch 'newactivity' 2015-11-16 17:02:05 +01:00
Christian Kamm
25c177ca3b SyncJournalFileRecord: Remove unused mode field 2015-11-11 09:42:31 +01:00
Daniel Molkentin
1d9c591c08 Fix OS X compilation: use mode_t instead of __mode_t 2015-11-11 09:36:17 +01:00
Christian Kamm
17dd199cba Checksums: Treat more carefully in db #4034
In particular, preserve them on local rename or remote move.
2015-11-10 15:05:00 +01:00
Christian Kamm
8f7dbe71a1 CleanupPollsJobs: Preserve more journal data 2015-11-10 14:26:25 +01:00
Christian Kamm
76d9b9c0e2 Rename env variables to include unit #2939 2015-11-10 12:07:10 +01:00
Christian Kamm
175ad6fb77 Reflect read-only permissions in filesystem #3244 2015-11-10 10:14:25 +01:00
Olivier Goffart
aa27b5db14 Discovery: silent static analysis warning
We do a check one line earlier that the size is smaller than the buffer
Then we don't need to call strncpy,  strcpy is enough
2015-11-09 17:22:17 +01:00
Niels van Adrichem
1ab44655e0 Merge remote-tracking branch 'upstream/master'
Conflicts:
	src/cmd/cmd.cpp
2015-11-03 11:58:45 +01:00
Niels van Adrichem
8f5658bc01 Added Non Shibboleth WebDAV authentication and Dav Path customization to owncloudcmd 2015-11-02 22:57:17 +01:00
Klaas Freitag
9545af0d43 JSONApiJob: Add method to add additional query parameter. 2015-11-02 17:37:23 +01:00
Olivier Goffart
3993a7f636 OwnSQL: add asserts in case of error that should not happen 2015-10-30 14:05:58 +01:00
Olivier Goffart
aaf16ff0e8 SyncJournalDB, clear all the queries before closing the database 2015-10-30 14:03:08 +01:00
Olivier Goffart
0c467ef5b4 Sync engine: fix signal/slot connection 2015-10-30 13:21:34 +01:00
Olivier Goffart
0e6a463564 Discovery: Don't leak DiscoveryDirectoryResult in case of error
Also remove redundent Q_FUNC_INFO
2015-10-30 12:43:33 +01:00
Olivier Goffart
c3cf6aef7d SyncEngine: Don't whipe the white list if the sync was aborted
Issue #4018
2015-10-29 16:47:39 +01:00
Olivier Goffart
38a8e5ee03 Discovery: conding style: use const references for function parameters 2015-10-29 16:47:36 +01:00
Klaas Freitag
46269dac4e Merge branch '2.0'
Conflicts:
	ChangeLog
2015-10-29 16:34:15 +01:00
Klaas Freitag
726be08917 Revert "Config: Use monochrome icons per default on MacOSX."
This reverts commit 546cab3f62.
For OEMs this patch causes an empty tray icon set.
2015-10-29 15:37:31 +01:00
Olivier Goffart
0fde7f0e6b Propagator: Keep a meaningfull error with old server and invalid file names
We changed the discovery code not to ignore files whose filename contains
charachter invalid on windows. (Because newer versions of the server
supports them)
Servers older than 8.1 will just say "Bad Request" as an error and it's a
regression against previous client version. So keep nice error even with
older server.

Relates to #3736
2015-10-29 12:44:08 +01:00
ckamm
251679253a Merge pull request #3951 from ckamm/checksum
Checksums stored in database #3735
2015-10-29 10:40:24 +01:00
Christian Kamm
9788055147 Propagator: Add blacklisting of disk space errors #2939 2015-10-29 09:36:59 +01:00
Christian Kamm
496b1e907d Checksum: Don't lose it on metadata update #3735
Also improve tests.
2015-10-28 14:49:55 +01:00
Christian Kamm
566131209d Checksum: Fixes after review 2015-10-28 14:46:20 +01:00
Christian Kamm
b7823dc648 Checksum: Put checksum type into separate column #3735 2015-10-28 14:46:20 +01:00
Olivier Goffart
6d28a1b645 Fix Qt4 compilation 2015-10-28 13:26:35 +01:00
Markus Goetz
a6c9e8c5b4 Merge branch 'kill_legacy_propagator' 2015-10-28 11:06:50 +01:00
Markus Goetz
9337927722 legacy propagator: Remove more code 2015-10-28 10:59:02 +01:00
Christian Kamm
5ea09d2668 Checksum: Disallow ADLER32, use Adler32 #3735 2015-10-28 09:59:33 +01:00
Christian Kamm
b9fc4c5994 Checksum: Fix recomputation when forced in cfg file #3735
Don't recompute the checksum on each upload when the server does not
advertise supporting checksums.
2015-10-28 09:56:39 +01:00
Christian Kamm
f1b500d3e0 Checksum: Add env variables to disable #3735 2015-10-28 09:56:39 +01:00
Christian Kamm
dff37e11eb Propagate: Store computed checksums in db during upload #3735 2015-10-28 09:56:39 +01:00
Christian Kamm
b1387f801b Propagate: On download store checksum header in db #3735 2015-10-28 09:56:39 +01:00
Christian Kamm
60b2312ab6 SyncJournal: Add checksumHeader column to metadata table #3735 2015-10-28 09:56:39 +01:00
Christian Kamm
0354289795 Checksums: Improvement in async computation and validation #3735 2015-10-28 09:56:39 +01:00
Christian Kamm
c11c35c459 Revert "In case of empty checksum type, emit validated."
This reverts commit b05ca526a4.

The checksum type setting should not matter for downloads.
2015-10-28 09:56:39 +01:00
Christian Kamm
7c5e70ac3c PropagateUpload: Fix double-emission of finished #3844 2015-10-28 09:53:54 +01:00
Klaas Freitag
0c9568f6dc Merge pull request #4004 from owncloud/fix_hidden_detection
Fix hidden detection
2015-10-28 09:28:35 +01:00
Klaas Freitag
6b71273380 Discovery: Fix detection of hidden files.
In the discovery phase we want to detect that dot-files are hidden
on Linux and Mac.

This fixes strange behaviour seen in issue #3980
2015-10-26 14:24:05 +01:00
Olivier Goffart
dccf4e9c34 Download: Soft errors for error while resuming (#4000) 2015-10-26 12:31:07 +01:00
Olivier Goffart
c93defc82d SyncEngine: remove unused functions 2015-10-23 17:11:19 +02:00
Olivier Goffart
f6a543ada3 Logger: speedup the sync discovery when the log is innactive
The sync throw a lot of log message, and QDateTime::fromCurrentTime is
quite expensive. So don't call it if it's not needed.
2015-10-22 00:22:25 +02:00
Daniel Molkentin
c7bf09c3d4 Merge remote-tracking branch 'origin/2.0' 2015-10-21 18:49:58 +02:00
Olivier Goffart
cf242871ea SyncEngine: keep a static pointer to the codec
The QTextCodec for UTF-8 is not going to change during the application life time.
So no need to look it up for every file
2015-10-21 16:38:26 +02:00
Olivier Goffart
597d36dcf2 csync_statedb: Use the index in csync_statedb_get_below_path
Make an index from the path, and make a query that uses the index
2015-10-21 16:38:26 +02:00
Olivier Goffart
9c388787bb csync_update: Don't fetch the etag in the local discovery from the DB
We don't need it, and it's slow.
This saves a lot of DB queries

(Also replaced a strlen>0 with a faster check)
2015-10-21 16:38:26 +02:00