1
0
mirror of https://github.com/chylex/Nextcloud-Desktop.git synced 2024-09-28 15:42:46 +02:00
Commit Graph

6222 Commits

Author SHA1 Message Date
Roeland Jago Douma
817baf292d
Use EVP_aes_128_gcm
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2017-10-24 15:51:53 +02:00
Roeland Jago Douma
ca6fa7b341
Update decryp function
* Do not use AAD
* Do not try to decrypt the last 16 bytes as Android adds the tag there
by default

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2017-10-24 15:51:53 +02:00
Roeland Jago Douma
bacbf337d2
Update encryption function
* Do not use padding
* Do not use the ADD data
* Append the tag to the ciphertext to be compatible with Android

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2017-10-24 15:51:53 +02:00
Olivier Goffart
c36043a175 ShareDialog: trigger a sync for folder affected by a change of sharing
This allow the sync engine to query the new metadata and update the
overlay icons.

Note: we also need to invalidate the etags because the server does not
change the etag of parent directories that see their share-types changed.

Issue #6098
2017-10-24 15:50:14 +02:00
Olivier Goffart
ee63b36ed3 SyncFileStatusTracker: Detect changed in the shared flag
... even if the file is not changed.

We get an UPDATE_METADATA in that case, so make sure we let the
SyncFileStatusTracker know about it.
That means we need to filter out UPDATE_METADATA in the other listeners
of this signal.

Issue #6098
2017-10-24 15:50:14 +02:00
Olivier Goffart
35d28294cd SyncEngine: remove SyncEngine::syncItemDiscovered
It is unused.
2017-10-24 15:50:14 +02:00
Olivier Goffart
c6bd3ab31a Sharing: remove the ShareManager::_jobContinuation
It is growing indefinitively in case of error, causing a leak.
Use a labda instead to pass the capture
2017-10-24 15:50:14 +02:00
Christian Kamm
9c7ee6ef85 Reconcile: Rename handling fixes: duplicate file ids
When users share the same tree several times (say A/ and A/B/ are both
shared) the remote tree can have several entries that have the same
file id. This needs to be respected in rename detection.

Also adds several tests and fixes for issues noticed during testing.

See #6096
2017-10-24 10:54:23 +02:00
Christian Kamm
e85a339d94 Local discovery: Use db instead of filesystem
We mostly trust the file watchers meaning that we don't re-scan the
local tree if we have done that recently and no file watcher events
have arrived. If the file watchers invalidate a subtree, we rescan
only that subtree.

Since we're not entirely sure the file watchers are reliable, we still
do full local discoveries regularly (1h by default). There is a config
file setting as well as an environment variable to control the interval.
2017-10-24 10:00:20 +02:00
Christian Kamm
66f0ce6616 FolderWatcher: reliability and data-loss signal
Add state and signal to catch the following two known problems:
* Linux: inotify user watch pool is exhausted. Folder watcher becomes
unreliable.
* Windows: buffer is too small, some notifications are lost but watching
stays reliable.
2017-10-24 10:00:20 +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
Christian Kamm
f3ea375083 Wizard: Resolve url/ redirects only if url/status.php not found
Unfortunately checking the base-url for redirects in all cases lead
to incorrect behavior in some SAML/OAuth2 edge cases.

This new iteration checks the base url for redirects only if the
standard CheckServerJob can't reach the server. That way the 2.3
behavior is only changed in cases that would have lead to errors.

See #5954
2017-10-24 09:42:08 +02:00
Tomaz Canabrava
476fe66043 [CSE] Add beginnign of the code to deal with the metadata 2017-10-23 21:06:26 +02:00
Tomaz Canabrava
bb53c2586f [CSE] Add Nlohmann's json library
Because nobody deservers to deal with Qt's JSON API
2017-10-23 21:06:26 +02:00
Tomaz Canabrava
23f5bb7ed9 [CSE] Move network jobs out of networkjobs.h
Since those networkjobs are all about client side
encryption, mvoe them to clientsideencryption.h
This will help with fewer conflicts with the origin.
2017-10-23 21:06:26 +02:00
Olivier Goffart
f41c9fbb7f owncloudsetupwizard: Fix "add new account" if the wizard is already visible
Clicking on the "Add new Account" from the systray menu should raise
the wizard, even if it is already running.

Relates to issue #6105
2017-10-20 12:41:48 +02:00
Olivier Goffart
a0e50670de Shibolleth: raise the browser when clicking on the tray
Issue #6105

Dynamically find the browser trough topLevelWidgets instead of
forwarding the call to the relevant page as it would require to break
many abstration layers (OwncloudSetupWizard -> OwncloudWizard ->
AbstractCredentialsWizardPage -> OwncloudShibbolethCredsPage)
And considering that we want to phase shibboleth down, I tought is
was not worth adding an interface for this.

The OAuth page don't have this problem because it shows a label and
allow the user to re-open the browser.
2017-10-20 10:51:35 +02:00
Olivier Goffart
a9761a8976 Use qEnvironmentVariable* instead of qgetenv when appropriate
Now that we use Qt5, we should do that. It is slightly more efficient
and declares the intent.
(Modified using clazy)
2017-10-19 13:57:49 +02:00
Tomaz Canabrava
1a47052aa3
[CSE] Remove unused function
This is already being called from somwhere else.
2017-10-18 21:51:39 +02:00
Tomaz Canabrava
e0988f482c
[CSE] Build fix
- change the name of one Qt Message Handler
- changed parameter from int to QString
2017-10-18 21:51:39 +02:00
Tomaz Canabrava
d83e8819ce
[CSE] SetEncryptionFlagApiJob
This new job sets the Encryption Flag in a folder.
2017-10-18 21:51:39 +02:00
Tomaz Canabrava
623eb29845
[CSE] Helper functions for the URL's 2017-10-18 21:51:39 +02:00
Tomaz Canabrava
1436d5bac1
[CSE] Better debug output 2017-10-18 21:51:39 +02:00
Tomaz Canabrava
0b50afe915
[CSE] Correctly Set's the client as connected
If we manage to encrypt and upload the private key
to the server, the client is in it's connected state.
2017-10-18 21:51:39 +02:00
Tomaz Canabrava
cfb6e3be8c
[CSE] Send the Private Key to the server 2017-10-18 21:51:38 +02:00
Tomaz Canabrava
78136a10b0
[CSE] Debug statements to help find the encrypt error 2017-10-18 21:51:38 +02:00
Tomaz Canabrava
08dfe86f37
[CSE] Adjust the calls to ent-to-end encryption
We changed the name.
2017-10-18 21:51:38 +02:00
Tomaz Canabrava
0f1480728e
[cse] Use fake data to verify the encryption
beware, this is broken.
2017-10-18 21:51:38 +02:00
Tomaz Canabrava
ba3d2a61d5
[cse] Call the encrypt and decrypt functions on fake data 2017-10-18 21:51:38 +02:00
Tomaz Canabrava
e0d368cbb3
[cse] Update the encrypt and decrypt algorithm to GCM 2017-10-18 21:51:38 +02:00
Tomaz Canabrava
4f7265c04f
[aes] Create the Decrypt function. 2017-10-18 21:51:38 +02:00
Tomaz Canabrava
6b53b4f257
[cse] Add the crypt method, based on OpenSSL Wiki 2017-10-18 21:51:38 +02:00
Tomaz Canabrava
77c0309e02
[cse] use PKCS5_PBKDF2_HMAC_SHA1 on the random-word passphrase 2017-10-18 21:51:38 +02:00
Tomaz Canabrava
5395fc56b1
[cse] Start the encryption algorithm for the Private Key 2017-10-18 21:51:38 +02:00
Tomaz Canabrava
fd00e180f5
[aes] fix out of bounds access. 2017-10-18 21:51:38 +02:00
Tomaz Canabrava
60729f1fc4
[cse] Enable OpenSSL for encryption 2017-10-18 21:51:38 +02:00
Tomaz Canabrava
418401a33c
[cse] new method, getUnifiedString
Enter a string list, return a string.
2017-10-18 21:51:38 +02:00
Tomaz Canabrava
2111aeaac1
[cse] Add wordlist & related methods. 2017-10-18 21:51:37 +02:00
Tomaz Canabrava
69c709714d
[cse] Save signed key on disk 2017-10-18 21:51:37 +02:00
Tomaz Canabrava
090336c928
[cse] Correctly send the CSR
finally.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2017-10-18 21:51:37 +02:00
Tomaz Canabrava
307dfd195c
[cse] Call the CSR job.
There's something wrong on the CSR job that I need to discover.
2017-10-18 21:51:37 +02:00
Tomaz Canabrava
304231811d
[cse] Start the job to sign the public key. 2017-10-18 21:51:37 +02:00
Tomaz Canabrava
ecb05020a9
[cse] Do not save the certificate on disk
Store it on memory, and discard it as soon as no longer
needed.
2017-10-18 21:51:37 +02:00
Tomaz Canabrava
d2992d92ba
[cse] Generate the CSE
I still need to send it to the server. It's been a long
learning with the OpenSSL library.
2017-10-18 21:51:37 +02:00
Tomaz Canabrava
c358980448
[cse] Link Against OpenSSL
For some reason, this was working untill I added a call
to X509_REQ_get_subject_name, then the linking suddenly
stopped working (even tougth I'm using a ton of other
OpenSSL calls)

Force to link against 1.0
2017-10-18 21:51:37 +02:00
Tomaz Canabrava
42a3098595
[cse] s/scr/csr 2017-10-18 21:51:37 +02:00
Tomaz Canabrava
58e2e6b30b
[cse] Generate the public / private keys and store locally
Now I need to understand what the hell I need to do
to send this to the server.
2017-10-18 21:51:37 +02:00
Tomaz Canabrava
8c342cb1dd
[cse] Generate the KeyPair
Not stored anywhere yet, but it's correctly running.
2017-10-18 21:51:37 +02:00
Tomaz Canabrava
17693a75e5
[cse] Request public key from server
This is the first step needed to properly communicate.
Next, get private key.
2017-10-18 21:51:37 +02:00
Tomaz Canabrava
f4bbec1019
[bugfix] Return the error code, don't discard it. 2017-10-18 21:51:37 +02:00
Tomaz Canabrava
29b64640fa
[cse] Start to fetch the basics to fetch the key from the server 2017-10-18 21:51:37 +02:00
Tomaz Canabrava
3f4d915a17
[cse] Add files to handle client side encryption
This will be the responsible for encryption,
decryption and talking with the server.
2017-10-18 21:51:36 +02:00
Tomaz Canabrava
7e2085375f
[cse] Invalid read of 1 2017-10-18 21:51:36 +02:00
Tomaz Canabrava
1c85f94b00
[cse] Use server capabilities to query for cse 2017-10-18 21:51:36 +02:00
Tomaz Canabrava
920047fa70
[CSE] Remove uneeded includes 2017-10-18 21:51:36 +02:00
Tomaz Canabrava
f7e74f520b
[CSE] Call encrypt and unencrypt from the GUI
If the server allows client side encryption, show
the user the menu with the encrypt and unencrupt options
2017-10-18 21:51:36 +02:00
Tomaz Canabrava
5b51346e83
[CSE] New Network Job: DeleteApiJob
This network job does a DELETE http request on a URL. It's the
second class that does basically the same, but this one returns
the http return code, and it's set to do a api call.
2017-10-18 21:51:36 +02:00
Tomaz Canabrava
e2091bb0a3
[CSE] Add FileIdRole for the FolderStatusModel
This way we can actually request the id from outside of the model.
2017-10-18 21:51:36 +02:00
Tomaz Canabrava
9870f39dcb
[CSE] Fetch file-id for subfolders
File id is a must if we want to call any API.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2017-10-18 21:51:36 +02:00
Tomaz Canabrava
9318c487b9
[CSE] Display menu for encrytp / decryot folders
If the server supports client syde encryption, display
a menu on right click that should display encrypt and decrypt.
ideally it would show the encrypt if the folder is decrypted, and
decrypt if the folder is encrypted but currently there's no way
for the client to know that.
2017-10-18 21:51:36 +02:00
Tomaz Canabrava
1c32f6bb2e
[CSE] Check the server for client side encryption
Call the apps api and check if the response has
the client_side_encryption key.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2017-10-18 21:51:36 +02:00
Roeland Jago Douma
bc7e65b395
Merge branch 'master' of https://github.com/owncloud/client 2017-10-18 21:03:15 +02:00
Markus Goetz
9866010b4c SettingsDialogMac: Fix account display name #6078 2017-10-18 10:41:01 +02:00
Markus Goetz
a3c1052cae owncloudcmd: Fix timestamps, Fix --logdebug
We did not set a log handler so there were no timestamps.
The --debug didn't have an effect, let's use --logdebug like in GUI version.
(Command line always outputs some log)

Found in owncloud/documentation#3436
2017-10-18 09:16:05 +02:00
Christian Kamm
bf39343920 Sync: Add capability for invalid filename regexes #6092 2017-10-17 17:15:49 +02:00
Markus Goetz
d339b68715 Checksums: Use addData function
Our implementation had bad error handling.
This one now uses a new Qt5 addData function.

owncloud/enterprise#2252
2017-10-17 13:26:54 +02:00
Christian Kamm
17b1c83ae5 Activity: Allow sorting of issues and protocol #6086
The issues tab uses custom ordering where overall and summary sync
issues are displayed first. This ordering is preserved by creating
special sorting logic for the "time" column.

It needed special handling anyway, since sorting by time-string would
have yielded incorrect results.
2017-10-17 09:47:57 +02:00
Christian Kamm
b2a8ffc577 Abort: Fix crash with early aborts
_chunkCount could be 0, leading to a floating point exception

I also added initializers for several uninitialized integers in the
upload jobs.
2017-10-17 09:44:52 +02:00
Christian Kamm
e2711224ed Propagator: Avoid duplicate async abort 2017-10-17 09:44:52 +02:00
Christian Kamm
111bb485ec UploadNG: Avoid div-by-zero for super fast uploads 2017-10-17 09:44:52 +02:00
Piotr Mrowczynski
e10775d34f Fix paused sync file move issue #5949
Dont abort final chunk immedietally

Use sync and async aborts
2017-10-17 09:44:52 +02:00
Christian Kamm
f598ac89ac HttpCreds: Fix retry after wrong password #5989
This is an ugly solution.
2017-10-13 14:24:37 +02:00
Christian Kamm
3f7b3ca962 Checksums: Improve logging and add global disable #5017 2017-10-13 13:08:20 +02:00
Christian Kamm
01c2ffe2ae PropagateDownload: Read Content-md5 header #6088 2017-10-11 09:06:23 +02:00
Christian Kamm
92e90f9c55 Context menu: More detailed status messages
Previously it could only display synchronization progress or "up to
date". Now it also communicates the same overall state that the icon
shows.

See owncloud/enterprise#2134
2017-10-09 14:14:31 +02:00
Olivier Goffart
b8f7c6daae CMakeLists.txt: Put -pie as a linker flag were it belongs
Fixes warning introduced by PR #6040
2017-10-06 14:35:56 +02:00
Markus Goetz
cd07865da6 Settings Dialog: Fix display name compilation for macOS #6078 2017-10-06 13:34:40 +02:00
Thomas Müller
315e38e814 Use display-name from the ocs call in the settings dialog 2017-10-06 10:59:20 +02:00
Christian Kamm
19c6757a0f
Rename detection: File size must be equal
Comparison of file sizes for potential conflicts was added in
0eb9401c62, but did not extend to checking
the file size in case of potential local moves.

This commit adds this check and adds tests for various move+change
scenarios.
2017-10-05 22:01:42 +02:00
Christian Kamm
01bbbb7d08
Excludes: Fix bug with escapes in the regex, add tests 2017-10-05 22:01:42 +02:00
Christian Kamm
f609ea3bef
Excludes: optimize csync_is_windows_reserved_word 2017-10-05 22:01:42 +02:00
Markus Goetz
91223b1a3d
Excludes: During directory traversal, use QRegularExpression
On Mac, this halves the time spent in csync_excluded_traversal
when using check_csync_excluded_performance. A similar performance
increase is seen on linux.
2017-10-05 22:01:42 +02:00
Markus Goetz
f202593ce4
sqlite: Update bundled version to 3.20.1
For OS X and Windows.
2017-10-05 22:01:42 +02:00
rockihack
2bfd85e3c7
Linux Hardening
see: https://wiki.debian.org/Hardening#User_Space
2017-10-05 22:01:38 +02:00
Jürgen Weigert
09c3043c85
support old sqlite before 3.7.7
quickfix: define the symbol for backwards compat
or FIXME: better solution #ifdef SQLITE_IOERR_SHMMAP where needed...
2017-10-05 22:01:38 +02:00
Olivier Goffart
cd44d8ed77
Test OAuth2
Include a test for PR #6057
2017-10-05 22:01:38 +02:00
Olivier Goffart
cfc38753b4
SyncEngine: _hasNoneFiles should be set when there are INSTRUCTION_UPDATE_METADATA 2017-10-05 22:01:38 +02:00
Olivier Goffart
c424dec7d4
OAuth: fix compilation with old gcc
We need to used QPointer::data in the signal slot connection

Relates to pr #6065
2017-10-05 22:01:38 +02:00
Markus Goetz
36117336e7
Updater: Rudimentary support for beta channel
So we can get people update from our alpha to the beta and rc
2017-10-05 22:01:38 +02:00
Olivier Goffart
d59c146488
Fix encoding of version string 2017-10-05 22:01:38 +02:00
Olivier Goffart
6583ebdcd9
csync_rename: optimize lookup
Avoid many memory allocations in reconcile
2017-10-05 22:01:38 +02:00
Olivier Goffart
917e2e43c6
csync_reconcile: Optimize reconcile by avoiding alocations
Fix performence regression from commit d66c2b5fae
For every new file we would look up every parent directories. Allocating
a new QByteArreay for every parent riectory just to know if it is in the other
tree is wasting lots of CPU.
Use a ByteArrayRef trick, similar to QStringRef
2017-10-05 22:01:37 +02:00
Dominik Schmidt
bdd3dc743b
Set CMAKE_INSTALL_RPATH as RPATH for installed executables 2017-10-05 22:01:37 +02:00
Christian Kamm
96a6d64500
Packaging: Make check for theme.qrc more specific #5957
Extracted and adjusted from packaging.diff by @jnweiger and @dschmidt
2017-10-05 22:01:37 +02:00
Christian Kamm
f64519bfbd
Move the --version output text to Theme #5957
Extracted and adjusted from packaging.diff by @jnweiger and @dschmidt
2017-10-05 22:01:37 +02:00
Olivier Goffart
bbbd2319ed
Use QDateTime::currentDateTimeUtc instead of the non utc version
QDateTime::currentDateTime is terribly slow.
2017-10-05 22:01:37 +02:00
Olivier Goffart
79c775bcd8
OAuth: Fix crash when closing the browser while identifying
To reproduce, log in and click "authorize" on the browser, then close
the browser before the client has replied, (but after redirected to localhost,
i.e. when the client is asking the server for the token)

The problem is that socket can be destroyed so we don't need to answer on a
destroyed socket.
2017-10-05 22:01:37 +02:00
Olivier Goffart
a3b1597d17
OwnSQL: don't parse the error message when we are done 2017-10-05 22:01:37 +02:00
Jocelyn Turcotte
ecb4e96794
SyncJournalDb: Reimplement the db_is_empty logic from csync
This reduces the initial sync local discovery time from
2.0 to 0.6 seconds in LargeSyncBench on my machine.
2017-10-05 22:01:37 +02:00
Jocelyn Turcotte
185cb2e39a
Use SyncJournalDb in csync
This gets rid of the csync_statedb sqlite layer and use
the same code and same connection as the rest of the SyncEngine.

Missing functions are added to SyncJournalDb and change a few minor
things (like changing SyncJournalFileRecord::_modtime to be an int64
instead of a QDateTime, like it was in csync).
2017-10-05 22:01:37 +02:00
Jocelyn Turcotte
c6610f6fbf
SyncJournalDB: Allow callers of getFileRecord if the query failed
The current implementation would return the same value whether the query failed
or if no row would be found. This is something that is currently checked by csync
and needs to be provided if we want to use SyncJournalDB there.

Adjusted all call sites to also check the return value even though they
could still just rely on rec.isValid(), but makes it more explicit as to what
happens for database errors in those cases, if we ever want to gracefully handle
them.
2017-10-05 22:01:37 +02:00
Jocelyn Turcotte
d76ecf015c
SyncJournalDB: Bind phash as a qlonglong instead of a QString
This is what csync does and we don't need to pass it as a string
to let sqlite convert it back to a uint64 later.
2017-10-05 22:01:36 +02:00
Olivier Goffart
fd9662b803
bandwidthmanager: Fix unregistering devices on delete
from the destroyed signal, qobject_cast won't work because the object
is already destroyed. One must use reinterpret_cast then
2017-10-05 22:01:36 +02:00
Olivier Goffart
37810c0a19
PropagateUpload: Fix another non-normalized connect that appears while profiling 2017-10-05 22:01:36 +02:00
Olivier Goffart
d100f9ac67
c_utf8_from_locale: optimize the UTF8 case on Linux
Avoid converting to a QString as an intermediate step
2017-10-05 22:01:36 +02:00
Olivier Goffart
5fc864adb6
csync: use a unordered_map for the FileMap
Saves more than 10% of csync_update on LargeSyncBench
2017-10-05 22:01:36 +02:00
Olivier Goffart
38962ca694
csync_update: fix assert
Amend 1dc44c0f62
2017-10-05 22:01:36 +02:00
Markus Goetz
cabf7a79d5
macOS: Fix compile 2017-10-05 22:01:36 +02:00
Olivier Goffart
2b12990f19
Httpcreds: Fix double slash in the Request App Password url
Issue #6044
2017-10-05 22:01:36 +02:00
Olivier Goffart
3184d4bb32
OAuth2: Fix double slash in URL
We need to use concatPath to avoid possible double '/' in the URLs if the
account url() ends with '/'.

This has become even more of a problem since commit
d1b8370a4a which was resolving the url after
a redirect where most server actually add a '/' if the url is a folder
2017-10-05 22:01:36 +02:00
Olivier Goffart
b19677ea97
csync_vio_local: merge readdir and stat in the same call
For the remote this was already done long time ago
For windows, this was already partially done

The goal is to avoid needless conversion of the path to local encoding.
2017-10-05 22:01:35 +02:00
Olivier Goffart
dc0a0841fa
csync_update/reconcile: replace CSYNC_LOG with qDebug/qInfo
CSYNC_LOG has quite an overhead as it uses vsprintf and it might
be run even if the category is disabled
2017-10-05 22:01:35 +02:00
Christian Kamm
351e65309c
SyncEngine: Adjust free space messaging
Before, the way the info message was phrased implied a failure. And
since the large numbers can be hard to compare that can be confusing.
2017-10-05 22:01:35 +02:00
Olivier Goffart
e36c8678d9
csync: remove unused type 2017-10-05 22:01:35 +02:00
Olivier Goffart
f793de4629
RemotePermissions: Store in a class rather than in a QByteArray to save memory
Create a specific type that parses the permissions so we can store
it in a short rather than in a QByteArray

Note: in RemotePermissions::toString, we make sure the string is not
empty by adding a space, this was already existing before commit
e8f7adc7ca where it was removed by mistake.
2017-10-05 22:01:35 +02:00
Olivier Goffart
0ad05aee0d
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-10-05 22:01:35 +02:00
Olivier Goffart
190f821d93
DiscoveryPhase: use the new syntax in disconnect
Since we used the new syntax in connect, we need to use it in disconnect
2017-10-05 22:01:35 +02:00
Olivier Goffart
7aca2352be
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-10-05 22:01:35 +02:00
Olivier Goffart
e8a76859c1
Include <QAuthenticator> from code that connect to signal that uses it
The new connection syntax will need that
2017-10-05 22:01:35 +02:00
Olivier Goffart
c219ceea52
Gui: Use lambda instead of QSignalMapper
It's simpler, and QSignalMapper is deprecated in Qt 5.10
2017-10-05 22:01:34 +02:00
Olivier Goffart
608f5034ef
Remove settingsdialog.cpp.Rbt431 2017-10-05 22:01:34 +02:00
Christian Kamm
6161b5519b
Fix compile with bad strrchr signature 2017-10-05 22:01:34 +02:00
Christian Kamm
2cac928810
Conflicts: Upload them files if env variable says so
Set OWNCLOUD_UPLOAD_CONFLICT_FILES=1 to trigger this behavior.

Note that this is experimental and unsupported. The real feature is
likely to end up in 2.5.

Uploading conflict files is simply done by removing the pattern from
csync_exclude. The rest here deals with making the conflict notification
ui approximately work.

There are still some concerns about where an uploaded conflict file
appears in the sync protocol and issues list (it should be in both, but
is only in one of them currently!).

See #4557.
2017-10-05 22:01:34 +02:00
Christian Kamm
05927b68a8
Private links: Retrieve link through propfind property #6020
* The sharing ui does a propfind anyway: use that to query the new
property as well!
* For the socket api, asynchronously query the server for the right url
when an action that needs it is triggered.

The old, manually generated URL will be used as fallback in case the
server doesn't support the new property or the property can't be
retrieved for some reason.

Depends on owncloud/core#29021
2017-10-05 22:01:34 +02:00
Jocelyn Turcotte
254f6291df
Fix the build (make install) 2017-10-05 22:01:34 +02:00
Olivier Goffart
faa7fd1b32
Gui: Allow to add multiple sync folder connection of the same folder
... or child folders

There is also no real reason to forbid the user from syncing the same
folder to multiple location on its hardrive.
A real use case is when the user uncheck a big directory using "choose
what to sync", but would still like to sync a folder within this disabled
tree. The user can now do this with the "add folder" feature

Since 2.3, we even support syncing the same local folder to multiple
remote folder, so why not allow syncing the same remote folder several
times?

Relates to issue #3645
2017-10-05 22:01:34 +02:00
Jocelyn Turcotte
76d95f8b87
SyncJournalDB: Only reset_and_clear_bindings once
We only need to do it once between each query execution and
that can be right before the first bind.
2017-10-05 22:01:34 +02:00
Jocelyn Turcotte
4e90bd7a5a
csync_update: Remove the check for csync_get_statedb_exists
This always returns true since _csync_statedb_is_empty also always
returns true. This function was initially intended to be a shortcut
in case the database doesn't contain any row, but has been broken since
27fb5d9128 and now won't return false
unless the statement fails.

The _last_db_return_error in _csync_detect_update would take care
of that code path in a more direct and clearer way anyway.
2017-10-05 22:01:33 +02:00
Jocelyn Turcotte
81e32e1a08
Move SyncJournalDB to src/common 2017-10-05 22:01:33 +02:00
Jocelyn Turcotte
98ef3050d8
Reverse the dependency between SyncJournalFileRecord and SyncFileItem
This will allow us to also use the SyncJournalDB in csync.
2017-10-05 22:01:33 +02:00
Jocelyn Turcotte
4c2e078eac
Move non-csync-dependent parts of FileSystem to src/common
This keep the csync-dependent parts in src/libsync, slitting the namespace
over two files.
This will allow moving SyncJournalDB to src/common as well.
2017-10-05 22:01:33 +02:00
Christian Kamm
cda72effe2
Checksums: Clearer behavior and added testing 2017-10-05 22:01:33 +02:00
Jocelyn Turcotte
0f21ed6a5b
Remove SyncFileItem::_isDirectory
It's always equivalent to _type == SyncFileItem::Directory.
2017-10-05 22:01:33 +02:00
Jocelyn Turcotte
85a93efe51
Remove SyncFileItem::log
This remove the remaining "other" fields of the sync log to save a
bit of memory.

other_etag and other_fileId don't give much information to the users
and other_instruction will always be INST_NONE anyway.

other_modtime and other_size are kept since they are sometimes used.
They were renamed to have a bit more meaningful name.

SyncEngine::checkPermissions will now fetch its information from the
csync trees since they are now preserved until right after this point.

Fixes #3213
2017-10-05 22:01:33 +02:00
Jocelyn Turcotte
82dd1775eb
Remove SyncEngine::_remotePerms
Now that csync is using a more convenient data structure for
its file trees, wait a little bit longer before destroying them and
fetch the remote permissions from the remote tree there instead.
2017-10-05 22:01:33 +02:00
Jocelyn Turcotte
3bc1f63b0a
Remove the usage of phash in csync
Only store the path since they represent the same thing, and do the
phash conversion during DB lookup like done in libsync.
We could get rid of everything since we also have an index on the path
column, but since it's the primary key this makes the migration non-trivial.
2017-10-05 22:01:33 +02:00
Jocelyn Turcotte
2276df1eec
Replace the custom rbtree by a std::map 2017-10-05 22:01:33 +02:00
Jocelyn Turcotte
ec52807e29
csync: Keep the csync_file_stat_t instances created during discovery
Now that they use the same structure, avoid _csync_detect_update
having to recreate another instance and transfer everything manually.
Any instance created during discovery should now be used all the way
up to SyncEngine::treewalkFile.

This also makes sure that the path and types are properly set in that
object instead of having to pass everything as separate parameters.

This gets rid of csync_ftw_flags_e which was now converted from,
and to csync_ftw_type_e, already in the csync_file_stat_t.

Issue #1817
2017-10-05 22:01:33 +02:00
Christian Kamm
b92de38c31
AbstractNetworkJob: Allow relative redirect
Previously all redirects were considered absolute.
2017-10-05 22:01:32 +02:00
Christian Kamm
78b082a23c
Reduce timeout for some admin jobs
The oauth token jobs and the wizard redirect check job shouldn't have
5min timeouts.
2017-10-05 22:01:32 +02:00
Christian Kamm
1aa1e7f833
Wizard: Handle url-shortener redirects #5954
Grab any permanent redirects from the base url the user entered
before attempting to connect to a modified url (with status.php
added).
2017-10-05 22:01:32 +02:00
Christian Kamm
4d2261420d
HttpCreds: Remove migration code from 1.7 2017-10-05 22:01:32 +02:00
Christian Kamm
23153a4866
Credentials: Use per-account keychain entries #5830
This requires a lot of migration code: the old entries need to be read,
saved to the new locations and then deleted.
2017-10-05 22:01:32 +02:00
Christian Kamm
7f75a533d1
Journal: Second attempt at journal mode fallback #5723
Some filesystems, vms or other limitations make using the WAL journal
mode impossible. We are notified of this problem through an sqlite
IOERR for SHMMAP. In that case We want to attempt to fall back to the
DELETE journal mode.
2017-10-05 22:01:32 +02:00
Christian Kamm
e47b8ffaca
OAuth: Don't use implicit POST bodies
The query args of POST requests become the request body. If there's a
redirect, the redirected url will therefore not contain the query
arguments. Use an explicit request body to make the redirection work.
2017-10-05 22:01:32 +02:00
Christian Kamm
a79b0a3791
OAuth: Pass client auth in header instead of url
To play more nicely with redirects.
2017-10-05 22:01:32 +02:00
Christian Kamm
ce51ea34b9
OAuth: Use redirectable jobs for oauth token management 2017-10-05 22:01:32 +02:00
Christian Kamm
0e8ce9c3db
PropagateUpload: Model of remote quota, avoid some uploads #5537
When we see a 507 error, assume that quota is < uploaded size.
2017-10-05 22:01:32 +02:00
Christian Kamm
76faf4937b
SyncOptions/Propagator: Parallelism as an option
Very useful for changing it on a per-test basis.
2017-10-05 22:01:32 +02:00
Christian Kamm
df05042e7f
Make DetailError different from BlacklistedError
It's quite different in regard to blacklist handling and overall
sync failure changes.
2017-10-05 22:01:32 +02:00
Helmut K. C. Tessarek
e8f17f5b0b
remove qt4 code 2017-10-05 22:01:32 +02:00
Christian Kamm
72131ff4ce
Excludes: Allow escaping # #6012
Otherwise adding patterns that start with # are impossible to add, since
they get treated as comments. Also add this escaping for patterns added
in the ui.
2017-10-05 22:01:06 +02:00
Christian Kamm
4acb70e79d
Journal: Fall back to DELETE on IO error #5723
Also add logging of extended error codes for this IO error, maybe we can
become more specific about which situations should trigger a journal
mode switch.
2017-10-05 22:01:05 +02:00
Christian Kamm
755b18db61
Folder: Check etag again after active sync #4116
Maybe more things were happening on the server?
2017-10-05 22:01:05 +02:00
Christian Kamm
b810ce7768
Update server url in case of permanent redirection #5972
This is the first time the account url may update outside of
account setup.

Summary of redirection handling:
1. During account setup (wizard)
   - status.php gets permanently redirected -> adjust url
   - authed PROPFIND gets *any* redirection -> adjust url
2. During connectivity ping (ConnectionValidator)
   - status.php gets permanently redirected -> adjust url (new!)

All other redirections should be followed transparently and
don't update the account url in the settings.
2017-10-05 22:01:05 +02:00
Christian Kamm
1c0d80c20d
Use DetermineAuthTypeJob in HttpCredentials
* Move it to networkjobs
* Minor adjustments to its logic
* Fixes redirect handling for oauth/basic http auth check #6003
2017-10-05 22:01:05 +02:00
Jocelyn Turcotte
bdf3f1e271
Windows: Make sure that the folder and Desktop.ini have the right attributes (#6018)
When created from scratch, the owncloud icon won't be picked-up by
explorer unless the right attributes are set on both the sync root and the
Desktop.ini file.

Issue #2446
2017-10-05 22:01:04 +02:00
rockihack
4e90179065
Enable DEP & ASLR on Windows 2017-10-05 22:01:04 +02:00
Markus Goetz
43f85a787b
Remove qtkeychain submodule #6004 2017-10-05 22:01:04 +02:00
Jocelyn Turcotte
a8c33885bb
Fix the macOS Sparkle build 2017-10-05 22:01:04 +02:00
Christian Kamm
3591849279
Http credentials: Fix behavior for bad password #5989
When the GET request from askFromUser is scheduled on the QNAM inside
the slot that handles the QNetworkReply::finished signal, it seems to
not get processed at all.

This workaround moves the sending of the new GET to the event loop,
sidestepping the problem.
2017-10-05 22:01:04 +02:00
Jocelyn Turcotte
deb123b80d
csync_statedb: (really) Make sure children of non-synced items aren't read from the DB
No tests are covering this and I reversed the original logic.
2017-10-05 22:01:04 +02:00
Jocelyn Turcotte
7a97dc1783
csync_statedb: Make sure children of non-synced items aren't read from the DB
Fix a regression during C++ conversion from 704ca366b3
2017-10-05 22:01:04 +02:00
Jocelyn Turcotte
41f215fd8d
Fix build after C++ conversion of csync
Use the same macro as in SyncFileItem for bitfields on enums.

Fixes #5993
2017-10-05 22:01:04 +02:00
Jocelyn Turcotte
e0fa5723eb
Use a C++ contructor and destructor for CSYNC
Merge csync_create and csync_init into the constructor and
replace csync_destroy with the destructor.

Also use a QByteArray for csync_s::root_perms and flatten
csync_rename_s as a rename sub-struct of csync_s since it
can now handle C++ types.
2017-10-05 22:01:04 +02:00
Jocelyn Turcotte
4947dc22ab
Remove csync_s::replica
The only difference with csync_s::current is that it's
assigned the value of csync_s::local::type and
csync_s::remote::type, which never change. So might as
well only use the "current" field with constants.
2017-10-05 22:01:04 +02:00
Jocelyn Turcotte
157e933ae5
Replace TREE_WALK_FILE with csync_file_stat_t
Just expose csync_file_stat_t since we don't need an abstraction layer
anymore. Also pass the nodes of both trees directly to the visitor
function.

Issue #1817
2017-10-05 22:01:04 +02:00
Jocelyn Turcotte
7fad474863
Replace csync_vio_file_stat_t with csync_file_stat_t
Also move csync_normalize_etag to common/utility since we
don't need the char* function anymore.

Remove the single space file_stat->remotePerm codepath since
this won't be used in csync anymore since
8de3bda0b1.

Issue #1817
2017-10-05 22:01:04 +02:00
Jocelyn Turcotte
61d949730b
Make csync_file_stat_t public and partly convert to C++
This is the first commit trying to unify csync_file_stat_s,
csync_vio_file_stat_s and csync_tree_walk_file_s. Use QByteArray
and unique_ptr already since I'm not used to track memory allocations
and this will make the transition easier.

Issue #1817
2017-10-05 22:01:03 +02:00
Jocelyn Turcotte
bfc7ea562d
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-10-05 22:01:03 +02:00
Jocelyn Turcotte
4aca1b9697
StatusTracker: Fix different case paths not matching (#5981)
Use a custom std::map comparator functor to do all comparisons
on contained QStrings using Qt::CaseInsensitive on macOS and Windows.

Issue #5257
2017-10-05 22:01:03 +02:00
Jocelyn Turcotte
ac4be17192
Compile almost all of csync as C++
This will allow us to unify data structures between csync and libsync.

Utility functions like csync_time and c_std are still compiled as C
since we won't need to be coupled with Qt in the short term.
2017-10-05 22:01:03 +02:00
Jocelyn Turcotte
39e9938cad
Use .cpp for existing csync .cc files
Make this consistent with the rest of the client code.
2017-10-05 22:01:03 +02:00
Jocelyn Turcotte
f897a91354
Move csync to src/csync 2017-10-05 22:01:03 +02:00
Jocelyn Turcotte
5948f26884
Move csync/tests to test/csync 2017-10-05 22:01:03 +02:00
Christian Kamm
90befac901 Rename detection: File size must be equal
Comparison of file sizes for potential conflicts was added in
0eb9401c62, but did not extend to checking
the file size in case of potential local moves.

This commit adds this check and adds tests for various move+change
scenarios.
2017-10-05 14:17:07 +02:00
Christian Kamm
43a26eb50a Excludes: Fix bug with escapes in the regex, add tests 2017-10-05 10:40:53 +02:00
Christian Kamm
99d406072f Excludes: optimize csync_is_windows_reserved_word 2017-10-05 10:19:48 +02:00
Markus Goetz
3a1a56c7ad Excludes: During directory traversal, use QRegularExpression
On Mac, this halves the time spent in csync_excluded_traversal
when using check_csync_excluded_performance. A similar performance
increase is seen on linux.
2017-10-05 10:19:48 +02:00
Markus Goetz
e48d55d126 sqlite: Update bundled version to 3.20.1
For OS X and Windows.
2017-10-04 17:12:12 +02:00
rockihack
ecaa37efbe Linux Hardening
see: https://wiki.debian.org/Hardening#User_Space
2017-09-29 14:34:30 +02:00
Jürgen Weigert
28fe903aee support old sqlite before 3.7.7
quickfix: define the symbol for backwards compat
or FIXME: better solution #ifdef SQLITE_IOERR_SHMMAP where needed...
2017-09-28 19:01:55 +02:00
Olivier Goffart
0ceb806f1a Test OAuth2
Include a test for PR #6057
2017-09-28 18:38:33 +02:00
Olivier Goffart
800b9cf167 SyncEngine: _hasNoneFiles should be set when there are INSTRUCTION_UPDATE_METADATA 2017-09-28 11:15:36 +02:00
Olivier Goffart
1da398e6c6 OAuth: fix compilation with old gcc
We need to used QPointer::data in the signal slot connection

Relates to pr #6065
2017-09-28 10:55:28 +02:00
Markus Goetz
2df74fd9d7 Updater: Rudimentary support for beta channel
So we can get people update from our alpha to the beta and rc
2017-09-27 16:23:34 +02:00
Olivier Goffart
d68b07dfc7 Fix encoding of version string 2017-09-27 12:06:49 +02:00
Olivier Goffart
a52dff713b csync_rename: optimize lookup
Avoid many memory allocations in reconcile
2017-09-27 11:41:55 +02:00
Olivier Goffart
041c5e6d44 csync_reconcile: Optimize reconcile by avoiding alocations
Fix performence regression from commit d66c2b5fae
For every new file we would look up every parent directories. Allocating
a new QByteArreay for every parent riectory just to know if it is in the other
tree is wasting lots of CPU.
Use a ByteArrayRef trick, similar to QStringRef
2017-09-27 11:41:55 +02:00
Dominik Schmidt
a2ce739192 Set CMAKE_INSTALL_RPATH as RPATH for installed executables 2017-09-27 09:13:44 +02:00
Christian Kamm
9a021d2279 Packaging: Make check for theme.qrc more specific #5957
Extracted and adjusted from packaging.diff by @jnweiger and @dschmidt
2017-09-27 09:13:44 +02:00
Christian Kamm
844bfc5f25 Move the --version output text to Theme #5957
Extracted and adjusted from packaging.diff by @jnweiger and @dschmidt
2017-09-27 09:13:44 +02:00
Olivier Goffart
13e0cc6b50 Use QDateTime::currentDateTimeUtc instead of the non utc version
QDateTime::currentDateTime is terribly slow.
2017-09-26 16:14:17 +02:00
Olivier Goffart
7af81f7665 OAuth: Fix crash when closing the browser while identifying
To reproduce, log in and click "authorize" on the browser, then close
the browser before the client has replied, (but after redirected to localhost,
i.e. when the client is asking the server for the token)

The problem is that socket can be destroyed so we don't need to answer on a
destroyed socket.
2017-09-26 14:56:57 +02:00
Olivier Goffart
278129b286 OwnSQL: don't parse the error message when we are done 2017-09-26 11:03:23 +02:00
Jocelyn Turcotte
54c522c861 SyncJournalDb: Reimplement the db_is_empty logic from csync
This reduces the initial sync local discovery time from
2.0 to 0.6 seconds in LargeSyncBench on my machine.
2017-09-26 11:03:23 +02:00
Jocelyn Turcotte
a034ee894c Use SyncJournalDb in csync
This gets rid of the csync_statedb sqlite layer and use
the same code and same connection as the rest of the SyncEngine.

Missing functions are added to SyncJournalDb and change a few minor
things (like changing SyncJournalFileRecord::_modtime to be an int64
instead of a QDateTime, like it was in csync).
2017-09-26 11:03:23 +02:00
Jocelyn Turcotte
6f46764daa SyncJournalDB: Allow callers of getFileRecord if the query failed
The current implementation would return the same value whether the query failed
or if no row would be found. This is something that is currently checked by csync
and needs to be provided if we want to use SyncJournalDB there.

Adjusted all call sites to also check the return value even though they
could still just rely on rec.isValid(), but makes it more explicit as to what
happens for database errors in those cases, if we ever want to gracefully handle
them.
2017-09-26 11:03:23 +02:00
Jocelyn Turcotte
e1d482ea7c SyncJournalDB: Bind phash as a qlonglong instead of a QString
This is what csync does and we don't need to pass it as a string
to let sqlite convert it back to a uint64 later.
2017-09-26 11:03:23 +02:00
Olivier Goffart
090abdee87 bandwidthmanager: Fix unregistering devices on delete
from the destroyed signal, qobject_cast won't work because the object
is already destroyed. One must use reinterpret_cast then
2017-09-25 12:56:20 +02:00
Olivier Goffart
ce04a76b17 PropagateUpload: Fix another non-normalized connect that appears while profiling 2017-09-25 12:49:55 +02:00
Olivier Goffart
bf2b089c5c c_utf8_from_locale: optimize the UTF8 case on Linux
Avoid converting to a QString as an intermediate step
2017-09-25 10:35:28 +02:00
Olivier Goffart
3107e63040 csync: use a unordered_map for the FileMap
Saves more than 10% of csync_update on LargeSyncBench
2017-09-25 10:35:28 +02:00
Olivier Goffart
d8206ccbc7 csync_update: fix assert
Amend 1dc44c0f62
2017-09-25 00:17:47 +02:00
Markus Goetz
81d9f94a29 macOS: Fix compile 2017-09-23 13:42:39 +02:00
Olivier Goffart
382cc444f0 Httpcreds: Fix double slash in the Request App Password url
Issue #6044
2017-09-23 10:10:40 +02:00
Olivier Goffart
0cec6f08ca OAuth2: Fix double slash in URL
We need to use concatPath to avoid possible double '/' in the URLs if the
account url() ends with '/'.

This has become even more of a problem since commit
d1b8370a4a which was resolving the url after
a redirect where most server actually add a '/' if the url is a folder
2017-09-23 10:10:40 +02:00
Olivier Goffart
35f80bd439 csync_vio_local: merge readdir and stat in the same call
For the remote this was already done long time ago
For windows, this was already partially done

The goal is to avoid needless conversion of the path to local encoding.
2017-09-22 16:18:18 +02:00
Olivier Goffart
1dc44c0f62 csync_update/reconcile: replace CSYNC_LOG with qDebug/qInfo
CSYNC_LOG has quite an overhead as it uses vsprintf and it might
be run even if the category is disabled
2017-09-22 11:12:19 +02:00
Christian Kamm
eae3f7ce0a SyncEngine: Adjust free space messaging
Before, the way the info message was phrased implied a failure. And
since the large numbers can be hard to compare that can be confusing.
2017-09-22 11:07:27 +02:00
Olivier Goffart
aa322d41aa csync: remove unused type 2017-09-22 09:58:55 +02:00
Olivier Goffart
95d23b1914 RemotePermissions: Store in a class rather than in a QByteArray to save memory
Create a specific type that parses the permissions so we can store
it in a short rather than in a QByteArray

Note: in RemotePermissions::toString, we make sure the string is not
empty by adding a space, this was already existing before commit
e8f7adc7ca where it was removed by mistake.
2017-09-22 09:29:08 +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
02924ad83e DiscoveryPhase: use the new syntax in disconnect
Since we used the new syntax in connect, we need to use it in disconnect
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
Olivier Goffart
1218a38f2c Include <QAuthenticator> from code that connect to signal that uses it
The new connection syntax will need that
2017-09-21 14:05:39 +02:00
Olivier Goffart
797f8087bc Gui: Use lambda instead of QSignalMapper
It's simpler, and QSignalMapper is deprecated in Qt 5.10
2017-09-21 14:05:39 +02:00
Olivier Goffart
bf77ac6ba5 Remove settingsdialog.cpp.Rbt431 2017-09-21 09:25:45 +02:00
Christian Kamm
30843cd368 Fix compile with bad strrchr signature 2017-09-19 12:44:59 +02:00
Christian Kamm
53195b064a Conflicts: Upload them files if env variable says so
Set OWNCLOUD_UPLOAD_CONFLICT_FILES=1 to trigger this behavior.

Note that this is experimental and unsupported. The real feature is
likely to end up in 2.5.

Uploading conflict files is simply done by removing the pattern from
csync_exclude. The rest here deals with making the conflict notification
ui approximately work.

There are still some concerns about where an uploaded conflict file
appears in the sync protocol and issues list (it should be in both, but
is only in one of them currently!).

See #4557.
2017-09-19 11:45:38 +02:00
Christian Kamm
dca2664707 Private links: Retrieve link through propfind property #6020
* The sharing ui does a propfind anyway: use that to query the new
property as well!
* For the socket api, asynchronously query the server for the right url
when an action that needs it is triggered.

The old, manually generated URL will be used as fallback in case the
server doesn't support the new property or the property can't be
retrieved for some reason.

Depends on owncloud/core#29021
2017-09-19 10:51:03 +02:00
Jocelyn Turcotte
2e90e9c35b Fix the build (make install) 2017-09-18 15:32:05 +02:00
Olivier Goffart
8f5110900c Gui: Allow to add multiple sync folder connection of the same folder
... or child folders

There is also no real reason to forbid the user from syncing the same
folder to multiple location on its hardrive.
A real use case is when the user uncheck a big directory using "choose
what to sync", but would still like to sync a folder within this disabled
tree. The user can now do this with the "add folder" feature

Since 2.3, we even support syncing the same local folder to multiple
remote folder, so why not allow syncing the same remote folder several
times?

Relates to issue #3645
2017-09-18 15:17:06 +02:00
Jocelyn Turcotte
5e332983e2 SyncJournalDB: Only reset_and_clear_bindings once
We only need to do it once between each query execution and
that can be right before the first bind.
2017-09-18 14:00:52 +02:00
Jocelyn Turcotte
6e240a3e9c csync_update: Remove the check for csync_get_statedb_exists
This always returns true since _csync_statedb_is_empty also always
returns true. This function was initially intended to be a shortcut
in case the database doesn't contain any row, but has been broken since
27fb5d9128 and now won't return false
unless the statement fails.

The _last_db_return_error in _csync_detect_update would take care
of that code path in a more direct and clearer way anyway.
2017-09-18 14:00:52 +02:00
Jocelyn Turcotte
a1f1775d15 Move SyncJournalDB to src/common 2017-09-18 14:00:52 +02:00
Jocelyn Turcotte
5fbed0d1cd Reverse the dependency between SyncJournalFileRecord and SyncFileItem
This will allow us to also use the SyncJournalDB in csync.
2017-09-18 14:00:52 +02:00
Jocelyn Turcotte
bd25225045 Move non-csync-dependent parts of FileSystem to src/common
This keep the csync-dependent parts in src/libsync, slitting the namespace
over two files.
This will allow moving SyncJournalDB to src/common as well.
2017-09-18 14:00:52 +02:00
Christian Kamm
78212e03d6 Checksums: Clearer behavior and added testing 2017-09-18 12:52:09 +02:00
Jocelyn Turcotte
a8ea7b0858 Remove SyncFileItem::_isDirectory
It's always equivalent to _type == SyncFileItem::Directory.
2017-09-18 11:46:09 +02:00
Jocelyn Turcotte
0e97770c47 Remove SyncFileItem::log
This remove the remaining "other" fields of the sync log to save a
bit of memory.

other_etag and other_fileId don't give much information to the users
and other_instruction will always be INST_NONE anyway.

other_modtime and other_size are kept since they are sometimes used.
They were renamed to have a bit more meaningful name.

SyncEngine::checkPermissions will now fetch its information from the
csync trees since they are now preserved until right after this point.

Fixes #3213
2017-09-18 11:46:09 +02:00
Jocelyn Turcotte
3d7bd7583b Remove SyncEngine::_remotePerms
Now that csync is using a more convenient data structure for
its file trees, wait a little bit longer before destroying them and
fetch the remote permissions from the remote tree there instead.
2017-09-18 11:46:09 +02:00
Jocelyn Turcotte
bfacac8683 Remove the usage of phash in csync
Only store the path since they represent the same thing, and do the
phash conversion during DB lookup like done in libsync.
We could get rid of everything since we also have an index on the path
column, but since it's the primary key this makes the migration non-trivial.
2017-09-18 11:46:09 +02:00
Jocelyn Turcotte
d66c2b5fae Replace the custom rbtree by a std::map 2017-09-18 11:46:09 +02:00
Jocelyn Turcotte
72e44ce3d7 csync: Keep the csync_file_stat_t instances created during discovery
Now that they use the same structure, avoid _csync_detect_update
having to recreate another instance and transfer everything manually.
Any instance created during discovery should now be used all the way
up to SyncEngine::treewalkFile.

This also makes sure that the path and types are properly set in that
object instead of having to pass everything as separate parameters.

This gets rid of csync_ftw_flags_e which was now converted from,
and to csync_ftw_type_e, already in the csync_file_stat_t.

Issue #1817
2017-09-18 11:46:09 +02:00
Christian Kamm
be5d5aea6d AbstractNetworkJob: Allow relative redirect
Previously all redirects were considered absolute.
2017-09-15 15:25:10 +02:00
Christian Kamm
8635b8ac84 Reduce timeout for some admin jobs
The oauth token jobs and the wizard redirect check job shouldn't have
5min timeouts.
2017-09-15 15:25:10 +02:00
Christian Kamm
d1b8370a4a Wizard: Handle url-shortener redirects #5954
Grab any permanent redirects from the base url the user entered
before attempting to connect to a modified url (with status.php
added).
2017-09-15 15:25:10 +02:00
Christian Kamm
1f57fd0407 HttpCreds: Remove migration code from 1.7 2017-09-15 09:29:05 +02:00
Christian Kamm
671599c8b2 Credentials: Use per-account keychain entries #5830
This requires a lot of migration code: the old entries need to be read,
saved to the new locations and then deleted.
2017-09-15 09:29:05 +02:00
Christian Kamm
0b4fd52d63 Journal: Second attempt at journal mode fallback #5723
Some filesystems, vms or other limitations make using the WAL journal
mode impossible. We are notified of this problem through an sqlite
IOERR for SHMMAP. In that case We want to attempt to fall back to the
DELETE journal mode.
2017-09-15 09:28:35 +02:00
Christian Kamm
e05f5fc50d OAuth: Don't use implicit POST bodies
The query args of POST requests become the request body. If there's a
redirect, the redirected url will therefore not contain the query
arguments. Use an explicit request body to make the redirection work.
2017-09-15 09:28:03 +02:00
Christian Kamm
da6250fc1f OAuth: Pass client auth in header instead of url
To play more nicely with redirects.
2017-09-15 09:28:03 +02:00
Christian Kamm
7d075cdcb7 OAuth: Use redirectable jobs for oauth token management 2017-09-15 09:28:03 +02:00
Christian Kamm
3a55ff2119 PropagateUpload: Model of remote quota, avoid some uploads #5537
When we see a 507 error, assume that quota is < uploaded size.
2017-09-15 09:27:07 +02:00
Christian Kamm
b5b055e1ae SyncOptions/Propagator: Parallelism as an option
Very useful for changing it on a per-test basis.
2017-09-15 09:27:07 +02:00
Christian Kamm
0c99673581 Make DetailError different from BlacklistedError
It's quite different in regard to blacklist handling and overall
sync failure changes.
2017-09-15 09:27:07 +02:00
Helmut K. C. Tessarek
709aa27031 remove qt4 code 2017-09-15 07:11:05 +02:00
Christian Kamm
0b7ad2c804 Excludes: Allow escaping # #6012
Otherwise adding patterns that start with # are impossible to add, since
they get treated as comments. Also add this escaping for patterns added
in the ui.
2017-09-14 14:53:05 +02:00
Christian Kamm
70aafd74a8 Journal: Fall back to DELETE on IO error #5723
Also add logging of extended error codes for this IO error, maybe we can
become more specific about which situations should trigger a journal
mode switch.
2017-09-12 14:12:24 +02:00
Christian Kamm
66415831ea Folder: Check etag again after active sync #4116
Maybe more things were happening on the server?
2017-09-12 13:58:59 +02:00
Christian Kamm
09173fb727 Update server url in case of permanent redirection #5972
This is the first time the account url may update outside of
account setup.

Summary of redirection handling:
1. During account setup (wizard)
   - status.php gets permanently redirected -> adjust url
   - authed PROPFIND gets *any* redirection -> adjust url
2. During connectivity ping (ConnectionValidator)
   - status.php gets permanently redirected -> adjust url (new!)

All other redirections should be followed transparently and
don't update the account url in the settings.
2017-09-11 19:27:36 +02:00
Christian Kamm
de5de6284c Use DetermineAuthTypeJob in HttpCredentials
* Move it to networkjobs
* Minor adjustments to its logic
* Fixes redirect handling for oauth/basic http auth check #6003
2017-09-11 19:15:43 +02:00
Jocelyn Turcotte
2d7a4bdb06 Windows: Make sure that the folder and Desktop.ini have the right attributes (#6018)
When created from scratch, the owncloud icon won't be picked-up by
explorer unless the right attributes are set on both the sync root and the
Desktop.ini file.

Issue #2446
2017-09-11 15:32:42 +02:00
rockihack
6f270a3648 Enable DEP & ASLR on Windows 2017-09-11 11:18:18 +02:00
Markus Goetz
8be2aaa751 Remove qtkeychain submodule #6004 2017-09-08 15:23:16 +02:00
Jocelyn Turcotte
5ede5ab4ce Fix the macOS Sparkle build 2017-09-08 13:58:14 +02:00
Christian Kamm
506f7c0764 Http credentials: Fix behavior for bad password #5989
When the GET request from askFromUser is scheduled on the QNAM inside
the slot that handles the QNetworkReply::finished signal, it seems to
not get processed at all.

This workaround moves the sending of the new GET to the event loop,
sidestepping the problem.
2017-09-07 11:23:24 +02:00
Jocelyn Turcotte
a18a601291 csync_statedb: (really) Make sure children of non-synced items aren't read from the DB
No tests are covering this and I reversed the original logic.
2017-09-07 10:26:19 +02:00
Jocelyn Turcotte
92fc50d4b0 csync_statedb: Make sure children of non-synced items aren't read from the DB
Fix a regression during C++ conversion from 704ca366b3
2017-09-07 10:17:58 +02:00
Jocelyn Turcotte
715b8c4683 Fix build after C++ conversion of csync
Use the same macro as in SyncFileItem for bitfields on enums.

Fixes #5993
2017-09-06 13:08:23 +02:00
Jocelyn Turcotte
b1bb7ec1a8 Use a C++ contructor and destructor for CSYNC
Merge csync_create and csync_init into the constructor and
replace csync_destroy with the destructor.

Also use a QByteArray for csync_s::root_perms and flatten
csync_rename_s as a rename sub-struct of csync_s since it
can now handle C++ types.
2017-09-06 13:08:23 +02:00
Jocelyn Turcotte
f6136dd036 Remove csync_s::replica
The only difference with csync_s::current is that it's
assigned the value of csync_s::local::type and
csync_s::remote::type, which never change. So might as
well only use the "current" field with constants.
2017-09-06 13:08:23 +02:00
Jocelyn Turcotte
cb49635231 Replace TREE_WALK_FILE with csync_file_stat_t
Just expose csync_file_stat_t since we don't need an abstraction layer
anymore. Also pass the nodes of both trees directly to the visitor
function.

Issue #1817
2017-09-06 13:08:23 +02:00
Jocelyn Turcotte
e8f7adc7ca Replace csync_vio_file_stat_t with csync_file_stat_t
Also move csync_normalize_etag to common/utility since we
don't need the char* function anymore.

Remove the single space file_stat->remotePerm codepath since
this won't be used in csync anymore since
8de3bda0b1.

Issue #1817
2017-09-06 13:08:23 +02:00
Jocelyn Turcotte
704ca366b3 Make csync_file_stat_t public and partly convert to C++
This is the first commit trying to unify csync_file_stat_s,
csync_vio_file_stat_s and csync_tree_walk_file_s. Use QByteArray
and unique_ptr already since I'm not used to track memory allocations
and this will make the transition easier.

Issue #1817
2017-09-05 17:25:19 +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
Jocelyn Turcotte
48d2fc1599 StatusTracker: Fix different case paths not matching (#5981)
Use a custom std::map comparator functor to do all comparisons
on contained QStrings using Qt::CaseInsensitive on macOS and Windows.

Issue #5257
2017-08-31 13:32:00 +02:00
Roeland Jago Douma
cdc5c1db43
Merge remote-tracking branch 'oc/master' into master-oc 2017-08-23 15:40:35 +02:00
Jocelyn Turcotte
4e5898efd7 Compile almost all of csync as C++
This will allow us to unify data structures between csync and libsync.

Utility functions like csync_time and c_std are still compiled as C
since we won't need to be coupled with Qt in the short term.
2017-08-22 15:22:56 +02:00
Jocelyn Turcotte
a512586140 Use .cpp for existing csync .cc files
Make this consistent with the rest of the client code.
2017-08-22 11:18:22 +02:00
Jocelyn Turcotte
28a0971cdf Move csync to src/csync 2017-08-22 11:18:22 +02:00
Jocelyn Turcotte
5c9827a33c Move csync/tests to test/csync 2017-08-22 11:18:22 +02:00
Jocelyn Turcotte
251f1d0047 Windows: Use the application icon for the sidebar
By setting the icon in Desktop.ini of the root folder, this adds the icon
both when browsing the folder directly and to the sidebar shortcut.

To avoid overwriting any user setting that could exist in Desktop.ini,
only do this if the file doesn't exist. Editing .ini files on Windows
isn't trivial and isn't worth it given that this file won't exist most
of the time.

Fixes #2446
2017-08-15 13:37:33 +02:00
Markus Goetz
20a979173f Sync Folder: Add file manager favorite also in folder wizard #455
Not only in the account wizard.
2017-08-04 17:38:01 +02:00
Markus Goetz
4aad318446 Upload: Log the checksum / file hash 2017-08-04 15:42:11 +02:00
Jocelyn Turcotte
9e36cabcbf macos: Add a sidebar icon
In the process, use an iconset to generate the icns using iconutil.
Also add some missing icon resolutions according to the guidelines.

Issue #296
2017-07-31 18:43:47 +02:00
Olivier Goffart
f707a43b3c FolderWizard: fix crash in FolderWizardRemotePath::slotHandleLsColNetworkError
The Job is a LsColJob, not a MkColJob!

Reproduce by entering a name with invalid character that cause an error 400
in the folder wizard's remote path line edit.

(Relates issue #5924)
2017-07-28 11:57:08 +02:00
Jocelyn Turcotte
7a96e8a292 General settings: Put all advanced checkboxes in a layout
The mac style has the concept of Layout Item Rectangle that bleeds
widgets margins into parent margins. This unfortunately doesn't work
when the parent layout doesn't have any margin, like we do when we
have the hierarchy:
 Vertical(normal margin)
   / Horizontal(no margin, uses parent layout spacing)
     /Widget

I guess Qt should propagate remaining uneaten margins to grand-parent
layouts and so on to have this work properly, but nobody seems to
have touched that code since Qt 4.4.
So just try to make the problem less worse by making sure that
all checkboxes we want to align are either in the same layout, or
in a loyout of their own.

Issue #5492
2017-07-27 17:37:27 +02:00
Jocelyn Turcotte
90cce0ab56 Fix the selective sync notification folder list being cropped
The maximumHeight would stay at the last animated value.

Issue #5492
2017-07-27 17:37:27 +02:00
Olivier Goffart
41ed603abf AccountState: reset _waitingForNewCredentials when signin in
Just to force the logic to re-ask the credenticals, in case we were
already asking them when singin off.

Issue: https://github.com/owncloud/client/issues/5893#issuecomment-316949686
2017-07-26 14:58:28 +02:00
Olivier Goffart
6ae88514d8 OAuth: clear refresh token when the server claim not to support oauth
Allow upgrade path when the server removes support for oauth
Relates: https://github.com/owncloud/client/issues/5848#issuecomment-317353049

We also need to force the account to commit the config to the disk,
otherwise we may not register we are no longer using owncloud and we
risk sending the password as the token to the token refresh API call
2017-07-25 12:34:13 +02:00
Olivier Goffart
c043840cb1 OAuth: Fix refresh of token after expiration
Before commit d3b00532b1,
fetchFromKeychain was called everytime we detect that the creds are
invalid (in AccountState::slotInvalidCredentials)
But since that commit, AccountState was calling askFromUser directly,
breaking the refresh of the token.

So I made sure AccountState::slotInvalidCredentials still calls
refreshAccessToken.

Another change that was made was too be sure to clear the cookies
in HttpCredentials::invalidateToken even when we are only clearing the
access_token. That's because the session with a cookie may stay valid
longer than the access_token
2017-07-25 12:34:13 +02:00
Olivier Goffart
a831164d65 Revert "Revert "Discovery: consider also the "shared by me" as shared""
This reverts commit efa7821dd2.

This reverts the revert, but also add a check that the server version
is bigger than 10.0

Issue #4788
2017-07-25 12:11:33 +02:00
Jocelyn Turcotte
a41dc00160 Don't keep the list of touched files for the whole sync
We only want to know if they were touched within the last 15 seconds,
so change the data structure to use a QMultiMap, and sort them by
QElapsedTimer. This allows us to iterate over old entries ordered by
time and to stop once we find a recent entry.

This makes the look-up slower but in most cases the folder watcher
will report any change within milliseconds, and we start from the
most recent. What this really makes slower are actual user file
changes while a fast sync is underways which will need to iterate
over the whole map to find out the file isn't there.

This reduces the growth of the memory usage when downloading a large
amount of files.
2017-07-24 17:54:29 +02:00
Jocelyn Turcotte
5a1bf7d8fe windows: Fix a memory leak in FileSystem::longWinPath
Also use c_path_to_UNC directly instead of doing an extra
UTF-8->wchar conversion.
2017-07-24 17:54:29 +02:00
Olivier Goffart
d9813dbc90 Propagator: fix a qMax which should have been a qMin 2017-07-18 08:58:07 +02:00
Olivier Goffart
50874eecfa OAuth: Add the user in the authorize call
Issues: #5897, https://github.com/owncloud/oauth2/issues/48
2017-07-17 10:13:12 +02:00
Olivier Goffart
3cea550d08 PropagateUpload: Remove the Qt workaround against data corruption
This was only for Qt <= 5.4, which we don't really support anymore.
And even then, the data corruption is happens very seldomly anyway.
2017-07-17 10:12:48 +02:00
Olivier Goffart
5e9d6f1cbd Merge pull request #5905 from kaustubh-welankar/issue_5692_pull
Fix for issue number #5692 : 

Abort owncloudcmd if the capabilities call fails.
2017-07-17 08:38:57 +02:00
Olivier Goffart
b1363d1a79 AccessManager: Disable HTTP/2 without TLS
Qt would otherwise still try to do HTTP/2 connection even over "http://".
And that does not work with server that does not support it
2017-07-17 08:20:17 +02:00
Olivier Goffart
520923b5a7 HTTP/2 Support
We need Qt 5.9 for HTTP2 because, even if Qt 5.8 already has support
for it, there is some critical bug in the HTTP2 implementation which
make it unusable [ https://codereview.qt-project.org/186050 and
https://codereview.qt-project.org/186066 ]

When using HTTP2, we can use many more parallel network request, this
is especially good for small file handling

Lower the priority of the GET and PUT propagation jobs, so the quota
or selective sync ui PROPFIND will not be blocked by them
2017-07-17 08:20:17 +02:00
Kaustubh Welankar
90ed57f478 Change error message. Removed Qt5 if check 2017-07-15 16:50:40 +05:30
Kaustubh Welankar
1c6a83d0dd Fix for issue number 5692 2017-07-14 16:50:49 +05:30
Olivier Goffart
06f3a70f9a OAuth: Better message when loggin in with the wrong username
Since the user is already in the browser, put the error message in the
browser with a message to log out and then log in as the right user.

Issue #5895
2017-07-14 11:17:24 +02:00
Markus Goetz
1fb68e8711 X-Request-ID: Send per request not per account #5853 2017-07-14 09:14:01 +02:00
Christian Kamm
bd107e133f Ensure qsrand is called 2017-07-13 18:06:40 +02:00
Christian Kamm
1c2d5f16c8 Account: Send a X-Request-ID header #5853 2017-07-13 18:06:40 +02:00
Olivier Goffart
5738110cb6 OAuth2: Have a link to the browser in the owncloud UI
When the browser is open, ad a link in the ui to re-open
the browser.

Issue #5893
2017-07-13 16:09:42 +02:00
Christian Kamm
7979342edf AccountSettings: Draw a box to indicate pending conflicts 2017-07-13 11:48:10 +02:00
Christian Kamm
2cdf5517cb Conflicts: Detect and show in issues tab
Incidentally fixes a potential issue where conflicts were silently-
ignored and thus deleted if the parent folder was deleted.
2017-07-13 11:48:10 +02:00
Olivier Goffart
acf65b4c23 csync: Use Qt for encodeing/decoding filesystem strings
Issues:
 - #5661   On mac, iconv did not support all of unicode and some
           files with emoji in the filename could not be uploaded

 - #5719 , #5676  On linux, we will now support non utf-8 locale
2017-07-13 10:01:17 +02:00
Christian Kamm
fe0de111fd IssuesWidget: Fix insertion of sync errors before item errors 2017-07-12 10:10:00 +02:00
Christian Kamm
da54b3d7e5 Merge remote-tracking branch 'origin/2.3' 2017-07-12 10:06:04 +02:00
Christian Kamm
971abaea80 IssuesWidget: Add button to retry 507 errors #5537
Since these errors are blacklisted, it can take up to 24h to retry items
that had a 507 error for a while. This way users can intervene and cause
an upload attempt immediately.
2017-07-12 09:04:27 +02:00
Christian Kamm
a76670f3b8 IssuesWidget: Hide folder column when possible 2017-07-12 09:04:27 +02:00
Christian Kamm
e13b618a65 Add ElidedLabel
A label that adjusts its text based on Qt::TextElideMode.
2017-07-12 09:04:27 +02:00
Christian Kamm
cd1b89475c PropagateUpload: Better messaging for 507 #5537
It now produces a summary error message indicating the problem.

Adjust blacklist database table to contain 'errorCategory'. This is
useful for two things:
  - Reestablishing summary messages based on blacklisted errors. For
    example if we don't retry a 507ed file, we still want to show the
    message about space on the server
  - Selectively wiping the blacklist: When we have ui for something like
    "I deleted some files, please retry all files now!", we want to
    delete all blacklist entries of a specific category only.
2017-07-12 09:04:27 +02:00
Christian Kamm
5d90b48790 PropagateUpload: Put upload error handling in one function 2017-07-12 09:04:27 +02:00
Christian Kamm
c3cb186952 ProgressInfo: Carry a sync status
* A bunch of code was determining sync status by ad-hoc comparing some
  progress info fields. It can now just check the status, making it
  easier to comprehend.
* There's a clear indication for "a new sync is starting", which helps
  wiping the issues tab at the right time.
2017-07-12 09:04:27 +02:00
Christian Kamm
5ca743dd25 SyncEngine: Introduce overall errors that are not tied to a file #5746
For now we use them for:
* csync errors: This allows them to appear in the sync issues tab
* insufficient local disk space, as a summary of individual file errors

Insufficient remote space will use them too, as might other issues that
are bigger than a single sync item.
2017-07-12 09:04:27 +02:00
Olivier Goffart
d34dbbdb0b OAuth: Redirects to the server in case of sucessfull login
Requires https://github.com/owncloud/oauth2/pull/45

This commit moves the reply after we got the token reply from
the server, that allows to reply with an error to the browser
if the login does not work.
2017-07-11 09:56:04 +02:00
Christian Kamm
1c9b51c330 IssuesTab: Hide filters if they wouldn't be useful
As suggested by @dragotin
2017-07-10 11:13:48 +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
a5ace5e71d Account/Credentials: Have identical lifetimes
The QNAM may continue to outlive both.

Rename Credentials::getQNAM() to createQNAM() while we're at it - it's
used to make a new QNAM that will subsequently be owned by the Account
object.

See d01065b9a1 for rationale.

Relates to
d40c56eda5
147cf798a6
2017-07-08 13:07:13 +02:00
Christian Kamm
99b1f69271 Link share: Remove direct download if unavailable #5837
It would have been much nicer to keep the menu assigned to the
QToolButton, but if one switches away from InstantPopup (to adjust the
entries before they're displayed), the button always gets a menu
indicator that can't be removed.
2017-07-07 11:23:32 +02:00
Christian Kamm
e54be1c4ee Link shares: Add "show file listing" option #5837 2017-07-07 11:23:32 +02:00
Christian Kamm
411621bf03 shell integrations: Change share menu title to "Share..."
Since the appname is in the context submenu title already.

Also drop APPNAME string.
2017-07-07 10:50:07 +02:00
Christian Kamm
ca2ffd4fb3 SocketAPI: Change strings to a consistent _MENU_TITLE postfix 2017-07-07 10:49:51 +02:00
Jocelyn Turcotte
3b20684dc7 shell/macos: Remove legacy (< 10.10) overlay icons
Having to update the plugins to add a submenu in the context menu,
it's more cost-effective to remove support for legacy macOS versions
than implementing and testing this setup.
2017-07-07 10:49:51 +02:00
Jocelyn Turcotte
389499d639 SocketApi: Add GET_STRINGS:BEGIN and END
The Windows shell extension relied on the response of
SHARE_MENU_TITLE to advance its state machine, but in order
to use the new GET_STRINGS instead, we need to know when the
last string was received. Also add BEGIN for consistency.
2017-07-07 10:49:51 +02:00
Jocelyn Turcotte
7b58a82840 SocketApi: Adjust the format of the mailto: URL
Minor tweaks that weren't actually an issue, but just in case.
2017-07-07 10:49:51 +02:00
Jocelyn Turcotte
9d818066a7 SocketApi: Improve logging 2017-07-07 10:49:51 +02:00
Christian Kamm
0238a29c7c Introduce private link sharing #5023
* SocketAPI has COPL_LOCAL_LINK / EMAIL_LOCAL_LINK commands
* The nautilus and dolphing shell integrations show a submenu from which
  one can share as well as access the private link.
* The SocketAPI provides a new GET_STRINGS command to access localized
  strings.
* The private link can also be accessed from the user/group sharing
  dialog.
* The numeric file id is extracted from the full id to create the
  private link url.
2017-07-07 10:49:51 +02:00
Christian Kamm
d01065b9a1 Fix crash on account deletion
Calling forgetSensitiveData() on account deletion leads to a timer for
clearQNAMCache() being queued. Then the Account object is deleted. The
Credentials object stays alive for now because it has a deleteLater
deleter.

If the timer calls into a slot on the Credentials object, the _account
pointer will be invalid at this time.

As a workaround, move the target slot to Account - that way it will not
be called as the account object is already destroyed.

However since Account and Credentials are mutually dependent, it would
be much preferable if their lifetimes were linked, avoiding this
category of bugs.

The current behavior was introduced in
d40c56eda5 and I currently don't
understand why - maybe there's another way of dealing with the problem
that existed then.
2017-07-06 14:34:02 +02:00
ckamm
ce8341ca1f Add a more functional error view #5516 (#5861)
* Add a more functional error view #5516

* Allow filtering of ignores and warnings to see only important bits.
* Navigate from the folder view to the error view by clicking on the
  error list with the red background.
* Move the error list into its own ui file to allow easier extension.
* Fix issue around tab id handling in ActivitySettings.
* Rename "Action" column to "Issue".
* Change mouse cursor to hand over button and new error list area

Several OSX fixes provided by guruz.
2017-07-04 14:08:41 +02:00
Christian Kamm
9493e8f42e AccountState: Add a 1-5min reconnection delay #5872
This only applies when the server was explicitly in maintenance mode or
when it was 503-unavailable.
2017-07-04 13:12:41 +02:00
Christian Kamm
b1aaf055b1 Blacklist: Don't let errors become warnings #5516
Before, blacklisted errors were set to FileIgnored status and hence
displayed as warnings. Now, they have their own BlacklistedError
category which allows them to appear as errors in the issues list and in
the shell integration icons.
2017-07-04 13:07:51 +02:00
Olivier Goffart
34e75f80bc main.cpp: Fix a compiler warning
src/gui/main.cpp:112:9: warning: bool literal returned from 'main' [-Wmain]

Used 1 to keep previous behaviour. I supposed the code was meant
to return success (0), but it does not really matter anyway.
2017-07-04 11:43:07 +02:00
Markus Goetz
f4d1a07b72 SyncEngine: Keep local size in SyncItem #5855 2017-07-04 11:42:44 +02:00
Piotr Mrowczynski
d1e00099dc Classify chunked items correctly. Issue #5850 2017-07-03 14:41:53 +02:00
Samuel Alfageme
aeea27b57b Update central.owncloud.org link
Desktop client category was renamed, old link was 404 - see: https://central.owncloud.org/t/new-central-categories-you-decide
2017-06-29 17:54:42 +02:00
Samuel Alfageme
0f70bd7913 Update central.owncloud.org link
Desktop client category was renamed, old link was 404 - see: https://central.owncloud.org/t/new-central-categories-you-decide
2017-06-29 17:52:00 +02:00
Jan-Christoph Borchardt
3d2f5b6af1
Change wording from synchronizing to synchronized 2017-06-29 15:36:57 +02:00
Christian Kamm
15ee7b39ac Merge remote-tracking branch 'origin/2.3' 2017-06-22 14:06:31 +02:00
Markus Goetz
f44d3914ef owncloudcmd: Explain --debug parameter 2017-06-21 10:01:32 +02:00
Christian Kamm
1e78a14f1a Ignore ui: Add the sync journal patterns #5844
The ignore patterns for the journal files are hardcoded. Add them to
the UI to make them discoverable.
2017-06-20 13:35:34 +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
5d24a2dc0f Remove debug messages by default from sync.engine
Other categories were already set properly.
2017-06-15 20:10:30 +02:00
Christian Kamm
8160963110 Compare the hash of files with identical mtime/size #5589
* For conflicts where mtime and size are identical:

  a) If there's no remote checksum, skip (unchanged)
  b) If there's a remote checksum that's a useful hash, create a
     PropagateDownload job and compute the local hash. If the hashes
     are identical, don't download the file and just update metadata.

* Avoid exposing the existence of checksumTypeId beyond the database
  layer. This makes handling checksums easier in general because they
  can usually be treated as a single blob.

  This change was prompted by the difficulty of producing file_stat_t
  entries uniformly from PROPFINDs and the database.
2017-06-15 13:54:16 +02:00
Olivier Goffart
85d8ae6b93 AccountSettings: Triggering log in re-ask about previously rejected certificates #5819
Issue #5819
2017-06-14 11:48:24 +02:00
Olivier Goffart
5100a2daf1 OAuth: cleanup debug messages
- Add category to the all messages (they did not have it was merged right after
the patch to add category everywhere, but this code did not have it.)

- Make sure there is no warnings in the normal flow. (The wizard does a request
without authentication to determine the auth type)
2017-06-13 12:08:24 +02:00
Olivier Goffart
6e57b0219e Don't link dirrectly against openssl
All our crypto code is handled by qt nodaways.
No need to carry this dependency.

Especially since it causes warnings on system where there are
twp openssl version installed:
/usr/bin/ld: warning: libcrypto.so.1.0.0, needed by /usr/lib/libQt5Network.so.5.9.0, may conflict with libcrypto.so.1.1
2017-06-13 11:27:23 +02:00
Christian Kamm
4b0d956b3d OAuth: Fix a typo in the success message 2017-06-12 12:58:20 +02:00
Olivier Goffart
85408961ba Wizard: Don't let the second to last page go back with OAuth2
We don't want to re-open the browser in that case.
2017-06-12 12:58:20 +02:00
Olivier Goffart
04b6794318 OAuth: Error handling in the wizard
Issues: #5813 and #5811
2017-06-12 12:58:20 +02:00
Olivier Goffart
3314a472c3 SyncEngine: SelectiveSync: Remove local files of undelected folder despite other modified files
Issue #5783

When the directry that should be removed by selective sync contains changes,
we ignore the whole sub tree instead of only ignoreing new files.
We cannot ignore the whole directory, we need to ignore only the directory
that do not have files to remove
2017-06-08 14:53:54 +02:00
Christian Kamm
aeeb408c74 Merge branch '2.3' 2017-06-08 13:02:34 +02:00
Olivier Goffart
18c39197e5 ownsql: fix build on jenkins
sqlite3_system_errno was only added in sqlite 3.12

(cherry picked from commit e2e56f45af)
2017-06-08 12:53:45 +02:00
Christian Kamm
7eb8219419 Add extra logging for SQLITE_CANTOPEN errors #5633
(cherry picked from commit 05c1dcef9b)
2017-06-08 12:52:58 +02:00
Olivier Goffart
63c40b45e4 OAuth: Fix the secret to the one from commit 05fd985f9f in the oauth2 repository
05fd985f9f
2017-06-06 14:49:34 +02:00
Olivier Goffart
c17a678385 FolderStatusModel: fix assert in Qt when the list of subfolder is empty
Fix an assert that happens in beginInsertRows when opening a folder
and that folder is empty.
This can only be reproduced with a debug build of Qt.
2017-06-06 14:49:03 +02:00
Olivier Goffart
e2e56f45af ownsql: fix build on jenkins
sqlite3_system_errno was only added in sqlite 3.12
2017-06-06 14:47:11 +02:00
Christian Kamm
05c1dcef9b Add extra logging for SQLITE_CANTOPEN errors #5633 2017-06-06 12:59:57 +02:00
Christian Kamm
cc5fe558ba Fix maintenance mode detection #5755
The server sends "maintenance": "true" which isn't a json boolean...
2017-06-06 10:45:41 +02:00
Olivier Goffart
3d93527a8e Authentication with OAuth2
When the OAuth2 app (https://github.com/owncloud/oauth2) is enabled,
We will open a browser and perform the OAuth2 authentication

Issue: #4798 and https://github.com/owncloud/platform/issues/17
2017-06-01 10:39:33 +02:00
Julius Härtl
b7fa50be4c Set proper application name, icon name for freedesktop notifications
Use application name defined in OEM build configuration
2017-06-01 10:01:05 +02:00
Markus Goetz
42751f87d9 Application: debug implies logdebug 2017-05-29 22:05:26 +02:00
Christian Kamm
577a2715bd Download: Retrigger folder discovery on 404
See owncloud/enterprise#1966

If the server and the client's database go out of sync, there could be
persistent 404 errors. This change ensures that the problem corrects
itself eventually by triggering a remote discovery of the file's
parent folders.

It does not address the root cause that might have lead to the
divergence.
2017-05-29 21:41:10 +02:00
Olivier Goffart
f88431adbf Don't call QElapsedTimer::restart on uninitialized timer
That's an undefined behavior.
Since we don't use the return value anyway, we should just use start()
2017-05-29 10:51:05 +02:00
Christian Kamm
03aa7e3044 Sharing: Disable 'set password' button when password is empty #5788 2017-05-22 14:41:06 +02:00
Christian Kamm
91f6cae168 Share dialog: Use default icon if available #5781 2017-05-22 14:15:53 +02:00
Christian Kamm
ddd584077c Share link: Fix disabled API/sharing #5778
* Don't hide the displayed error directly after showing it
* Don't try to fetch shares when sharing isn't possible
2017-05-22 10:59:57 +02:00
Christian Kamm
8201f0b6ea Share Dialog: Remove unused hline 2017-05-22 10:59:57 +02:00
Christian Kamm
f2b5fcd706 Share link: Fix parsing integer ids #5777
Older ownCloud servers like 8.2.0 used to use integer ids.

This broke when switching to QJson because toString() on JSON
values is strict and returns "" for integers.
2017-05-22 10:54:30 +02:00
Christian Kamm
950439e5b8 Sharing dialog: Ensure error labels are expanding #5774 2017-05-22 10:52:52 +02:00
Christian Kamm
f24cdf5a05 Share dialog: Hide the icon when unused
Previously this used up some space when there was no icon, leading
to an oddly indented header.
2017-05-22 10:52:52 +02:00
Christian Kamm
d3b00532b1 Credentials: Simplify credential flow #5728
And as a side effect: don't ask for user password when we can't
connect to the server in the first place.
2017-05-22 10:52:18 +02:00
Christian Kamm
b7ed0fce2a Account: forget credentials on delete #5752 2017-05-22 10:49:11 +02:00
Christian Kamm
c1d2a9ab92 Sharing: Show warning that link shares are public #5785 #5747
Backport of 3872e060ba33913e43714776a1afce787e772351
2017-05-22 10:28:16 +02:00
Christian Kamm
87a7642381 Settings: Ensure the 'about' label isn't cut off #5760 2017-05-22 10:11:09 +02:00
Christian Kamm
5eaae83a01 Merge remote-tracking branch 'origin/2.3' 2017-05-17 13:10:19 +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
Christian Kamm
ae263d60bd Reformatting: Reformat some lines that would become really long 2017-05-17 12:26:27 +02:00
Christian Kamm
df3fe25702 Reformatting: Adjust trailing comments
These would otherwise be line-wrapped by clang-format,
and then consecutive reformattings remove the aligned
comment indentation

Example:

int a; // too long comment

->

int a; // too long
       // comment

->

int a; // too long
// comment
2017-05-17 12:26:27 +02:00
Christian Kamm
c5a0ce5a43 Selective sync: Skip excluded folders when reading db
When a new folder becomes selective-sync excluded, we already mark it
and all its parent folders with _invalid_ etags to force rediscovery.

That's not enough however. Later calls to csync_statedb_get_below_path
could still pull data about the excluded files into the remote tree.

That lead to incorrect behavior, such as uploads happening for folders
that had been explicitly excluded from sync.

To fix the problem, statedb_get_below_path is adjusted to not read the
data about excluded folders from the database.

Currently we can't wipe this data from the database outright because we
need it to determine whether the files in the excluded folder can be
wiped away or not.

See owncloud/enterprise#1965
2017-05-16 13:58:45 +02:00
Christian Kamm
ee4892e345 Wizard: Skip result page with acceptance instead of closing #5764 2017-05-12 10:21:07 +02:00
Jocelyn Turcotte
7fd2f292e7 Promote a few more logs to info/warning 2017-05-11 17:22:59 +02:00
Markus Goetz
b68d982619 macOS: Fix usage of qCDebug in .mm file 2017-05-11 17:22:59 +02:00
Jocelyn Turcotte
cf058bc537 Add the possiblility to enable debug logging categories
Add a checkbox in the log window as well as a --logdebug command-line
option that should have the same effect.

Issue #5647
2017-05-11 17:22:59 +02:00
Jocelyn Turcotte
cc9680c1e8 Also pass csync logs through QMessageLogger
This allows using logging rules and custom message patterns with csync.
This also pass the a relative verbosity to the message logger.

Issue #5647
2017-05-11 17:22:59 +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
Jocelyn Turcotte
3a193655b3 Improve the logging message pattern
Add the log level and category name in the output. Only output the
thread ID and function name for qCDebug statements as they are not
necessary for general use and make the log harder to read.

Also make sure that the message pattern is set when NO_MSG_HANDLER is
used. Using an environment variable should have priority over it anyway.
2017-05-11 17:22:59 +02:00
Jocelyn Turcotte
e10a08f64d Remove the unused folderwatcher_qt implementation 2017-05-11 17:22:59 +02:00
Christian Kamm
4b6edaa01a Detect maintenance mode #4485
When we first detect a 503 (probably from a PROPFIND) and enter the
ServiceUnavailable state, we new trigger a status.php query that will
switch the state to MaintenanceMode if necessary.
2017-05-11 11:39:49 +02:00
Markus Goetz
8da7919a43 Sharing: Fix UI glitch when sharing is disabled 2017-05-10 15:41:58 +02:00
Markus Goetz
f52d66a954 Sharing: Optionally show warning that links are public
For https://github.com/owncloud/enterprise/issues/1914
2017-05-10 15:41:58 +02:00
Jocelyn Turcotte
4d3212b31f Merge branch 2.3 into master 2017-05-09 18:23:01 +02:00
Christian Kamm
881641f0b7 Remove stray debug output 2017-05-09 10:37:40 +02:00
Christian Kamm
3da1e9a4b9 Remove 3rdparty qjson #5710 2017-05-08 11:50:33 +02:00
Christian Kamm
f1b42cedda Port PollJob responses to Qt5's QJson #5710 2017-05-08 11:50:33 +02:00
Christian Kamm
2598579d84 Switch JsonApiJob to Qt5's QJson #5710 2017-05-08 11:50:33 +02:00
Christian Kamm
c5b6ec209a Sharing: Switch from QtJson to Qt5's QJson #5710 2017-05-08 11:50:33 +02:00
Olivier Goffart
13705999f7 Discovery: Increase the MAX_DEPTH and show deep folder as ignored
Before this patch, to deep folder would just be ignored, without any feedback.
This patch makes it so deep folder are properly shown as ignored in the UI.

Also increase the MAX_DEPTH

Issue: #1067
2017-05-08 11:29:51 +02:00
Markus Goetz
fbe812b9bc Selective Sync: Open sub folder context menu #5596 2017-05-08 11:24:02 +02:00
Christian Kamm
aff8008baf Downloads: Remove empty temporary if disk space full #5746 2017-05-04 15:12:14 +02:00
Christian Kamm
c922015521 SSL error handling: Remove unnecessary confusing code
I'm confident this is unnecessary. The original bug in #3283 was
to call ignoreSslErrors() without an argument in the 'accept'
case, which meant ignoring *all* subsequent SSL errors.

With that fixed, explicitly aborting the reply and resetting QNAM
is not needed since not ignoring the error will lead to the SSL
handshake failing.

See also:
  75b38d1a2f (workaround introduced)
  89376e14d6 (real fix)
  76ce5adbf0 (cherry-pick of workaround)
2017-05-04 09:19:01 +02:00
Markus Goetz
4ed9edb104 Wizard: Don't show not-so-useful result page #5726
Better immediately show the settings dialog where people can see what's going on.
They can go to sync folder or webinterface from there.
2017-05-03 19:21:46 +02:00
Olivier Goffart
bb244d527c Better words for the error message when one cannot create the database.
Issue #5291
2017-05-03 17:53:46 +02:00
Christian Kamm
d709a47b93 Share dialog: Add option to copy/email direct links #5627 2017-05-03 10:26:27 +02:00
Luca Lorenzetto
3db8d3dfb6 When creating explorer favorite use more specific windows functions (#5690)
Fixes https://github.com/owncloud/client/issues/2719
2017-04-27 10:34:07 +02:00
Tommy Sparber
72a3e08907 Move check for mono icons into separate function 2017-04-26 17:39:01 +02:00
Christian Kamm
f8c0e796df SqlDatabase: Ask freeSpace for directory, fix for Windows
See owncloud/enterprise#1955
2017-04-26 12:38:04 +02:00
Christian Kamm
cd4e647816 Merge remote-tracking branch 'origin/2.3' 2017-04-24 10:32:53 +02:00
Kiril Vladimiroff
3a31694147 Remove all conditional checks for Qt 4.x (#5505) 2017-04-21 18:13:32 +02:00
Christian Kamm
05236f0a7a Sharing multiple public links: Depend on new capability
See owncloud/core#27709: files_sharing/public/multiple
2017-04-21 14:08:00 +02:00
Christian Kamm
3c1a2cde33 ShareDialog: Review fixes
* Allow creating nameless shares
* Display token as name for nameless shares
  (both to be consistent with server)
* Allow changing a share's name by editing it in the table
* Minor adjustments
2017-04-21 10:16:08 +02:00
Christian Kamm
a1f7168d2a ShareDialog: Add support for multiple public link shares #5655
Starting from oC 10.0.0 having several public link shares with
different attributes for a path will be supported. This adds
functionality to create, edit and delete these public link shares.

The behavior is currently gated by server version, but should be
adapted to use a capability as soon as one is introduced, see
owncloud/core#27622.

The UI reduces to a single-share version when talking to older servers.

Testing scenarios:
* Link sharing is disabled (by capability, not by theme)
* Required passwords
* Required expiry
* Forbidden 'allow upload' for folders
* New and old servers
2017-04-21 10:10:12 +02:00
Christian Kamm
1e1c2f8de2 Rename ShareWidget to ShareUserLine
There will probably be a ShareLinkLine too, due to #5655
2017-04-21 10:09:01 +02:00
Christian Kamm
76e67db04b ShareDialog: Use a tab widget #5655 2017-04-21 10:09:01 +02:00
Kaustubh Welankar
70c3514996 Removed Magic Numbers in propagator #5685 (#5705) 2017-04-20 11:14:53 +02:00
Olivier Goffart
9aeb587d6c Require Qt5 2017-04-20 09:39:41 +02:00
ckamm
543e8a224c Fix a crash in ProxyAuthHandler (#5711)
See
https://sentry.io/owncloud/desktop-win-and-mac/issues/243433178/activity/
https://sentry.io/owncloud/desktop-win-and-mac/issues/234182688/activity/

The problem was that an account's QNetworkAccessManager can be deleted
when reentering the event loop.
2017-04-20 09:21:33 +02:00
ckamm
ea378fe837 FolderStatusModel: Fix crash for empty relativePath (#5713)
The problem was that split("", SkipEmptyParts) is the empty list.

See
https://sentry.io/owncloud/desktop-win-and-mac/issues/251167186/
2017-04-20 09:16:55 +02:00
Markus Goetz
de9ee295be Some Dialogs: Bring to top on tray click #5515 #5566 (#5664)
On my OS X, it might get hidden under other apps while I opened it and then want to quickly
verify something in another app.
2017-04-20 08:55:44 +02:00
Markus Goetz
5ac58d3b83 Server: Parse version from capabilities too #5691 (#5698)
Newer servers will have the option of hiding version, versionstring, edition
and productname. They will always send the full information in the capabilities.
2017-04-19 11:02:03 +02:00
dheule
ada2be94f2 added owncloudcmd bandwidth limit parameter (#5707) 2017-04-19 10:32:36 +02:00
Olivier Goffart
8cb3a77022 Merge remote-tracking branch 'origin/avatar_pics'
Also fix compilation because of 22370fdbdadd06f0cacd249a8d7a32f0d3c1374e

Pull request #5482
2017-04-13 11:54:28 +02:00
Olivier Goffart
1ed4eb46f2 Merge remote-tracking branch 'origin/2.3'
Conflicts:
	VERSION.cmake
2017-04-13 10:19:35 +02:00
Christian Kamm
7c31da5a95 AccountSettings: Sync with clean discovery on Ctrl-F6 #5666 2017-04-13 10:11:21 +02:00
Christian Kamm
1f245b3791 AccountSettings: Easier access to selected folder alias 2017-04-13 10:11:21 +02:00
Olivier Goffart
4af45394f9 owncloudcmd: return code depend on sync result
Issue #3936
2017-04-13 10:10:47 +02:00
Markus Goetz
554d1b88fc Avatar: macOS support 2017-04-12 17:55:28 +02:00
Christian Kamm
8a639d39fc ShareDialog: Reenable user input textedit on error #5694 2017-04-11 15:50:32 +02:00
Markus Goetz
26af3ce525 Wizard: Improve folder creation (2) 2017-04-10 16:15:28 +02:00
Markus Goetz
e08ec11fd4 Wizard: Improve folder creation 2017-04-05 16:55:52 +02:00
Christian Kamm
6abc2bf72d Transfers: Show a decimal for single digit MB rates #4428 2017-04-04 09:54:06 +02:00
Christian Kamm
a10fe84a83 ShareDialog: Hide the detailed permissions if there is only one #5655 2017-04-04 09:40:48 +02:00
Christian Kamm
7d9c4d052c ShareDialog: Margin and spacing refinements #5627 2017-04-04 09:40:48 +02:00
Christian Kamm
f8d69dfe8e ShareDialog: Fix thumbnail size #5654 2017-04-04 09:40:48 +02:00
Christian Kamm
35af03b2e5 Improve http error messages; cleanup
By default QNetworkReply::errorString() often produces messages like
   "Error downloading <url> - server replied: <reason>"
but the "downloading" part invariably confuses people since the
error might very well have been produced by a PUT request.

This commit produces clearer error messages for HTTP errors.

Additionally:
* Remove some unnecessary null checks from slots connected to
  network job signals and document that these signals never send
  null replies.
* There was a bug where AbstractNetworkJob::_timedout wasn't
  set when derived classes overrode slotTimeout. We now ensure
  it's always set by disallowing overrides of slotTimeout.
  Instead it now calls onTimedOut, which allows custom handling.
* Several subclasses declared errorString, isTimedOut. Move
  these to AbstractNetworkJob.
* Unify handling of OC-ErrorString (via the new, general
  Job::errorString)
* Add documentation in various places.
2017-04-04 09:27:37 +02:00
Markus Goetz
28e9c56a4b Chunking NG: Also send OC-Total-Length on MOVE
For https://github.com/owncloud/core/issues/26988
2017-03-29 19:51:02 +02:00
Roeland Jago Douma
68f0f1b404 complete url when using themed wizardUrlPostfix
Before we would only open the part of the url that the users entered.
Now if the wizardUrlPostfix is used this is should be appended to that
when opening the browser on the result page.
2017-03-29 18:09:15 +02:00
Olivier Goffart
039ff0ca8e PropagateDownload: fix possible crash
Backtrace looks like this:
Crash: EXCEPTION_ACCESS_VIOLATION_READ at 0x0
  File "propagatedownload.cpp", line 234, in OCC::GETFileJob::slotReadyRead
  File "moc_propagatedownl_CA5CFSHZDTX34X.cpp", line 86, in OCC::GETFileJob::qt_static_metacall
  File "qobject.cpp", line 495, in QMetaCallEvent::placeMetaCall
  File "qobject.cpp", line 1256, in QObject::event
  File "qapplication.cpp", line 3804, in QApplicationPrivate::notify_helper

GETFileJob::slotReadyRead can be called with a QueuedConnection when the
bendwith manager is involved. In that case, if the QNAM was reset
in between, the reply might have been destroyed.
(This is only speculation based on the backtrace)
2017-03-28 18:04:19 +02:00
Olivier Goffart
85afa4788b AccountState: Attempt to fix a crash
Backtrace from the crash reporter:

Crash: EXCEPTION_ACCESS_VIOLATION_READ at 0x21
  File "qcoreapplication.cpp", line 1281, in QCoreApplication::postEvent
  File "qobject.cpp", line 2125, in QObject::deleteLater
  File "connectionvalidator.cpp", line 240, in OCC::ConnectionValidator::reportResult
  File "connectionvalidator.cpp", line 206, in OCC::ConnectionValidator::slotAuthFailed
  File "moc_connectionvalidator.cpp", line 127, in OCC::ConnectionValidator::qt_static_metacall
  File "qobject.cpp", line 3716, in QMetaObject::activate
  File "moc_networkjobs.cpp", line 653, in OCC::PropfindJob::finishedWithError
  File "networkjobs.cpp", line 570, in OCC::PropfindJob::finished

I believe the problem is caused because 'this' was deleted in ConnectionValidator::reportResult
as the signal connectionResult gets emited. The AccountState::slotConnectionValidatorResult
slot does indeed call slotInvalidCredentials which might call {Shibboleth,Http}Credentials::fetchFromKeychain
which might emit fetched directly, which will call AccountState::slotCredentialsFetched
which deletes the _connectionValidator

So use deleteLater when deleting the _connectionValidator, hoping this helps
2017-03-28 18:04:19 +02:00
Christian Kamm
e86499d990 dynamic chunking: cleanup, fixes, improvements
* make target duration a client option instead of a capability
* simplify algorithm for determining chunk size significantly
* preserve chunk size for the whole propagation, not just per upload
* move options to SyncOptions to avoid depending on ConfigFile
  in the propagator
* move chunk-size adjustment to after a chunk finishes, not when
  a new chunk starts
2017-03-28 11:32:10 +02:00
Piotr M
88e0f97798 dynamic chunking prototype 2017-03-27 13:43:39 +02:00
Christian Kamm
a0e88477c1 ShareDialog: Make "can edit" partially checked sometimes #5642
Previously the check box was checked if *any* of its sub-permissions
were granted. This can hide the fact that only a limited subset of them
are actually granted.

The new behavior is to display as "partially checked" if only some
of the sub-permissions are available. Clicking the check box itself
still toggles between granting all or none of them.
2017-03-24 09:52:01 +01:00
Christian Kamm
f67989afea Wizards: Never propose an existing folder for syncing #5597 2017-03-21 17:07:35 +01:00
Christian Kamm
14fef4a0d3 Wizard: Remove unused oldLocalFolder property 2017-03-21 17:07:35 +01:00
Olivier Goffart
d3439d5526 owncloudsetuppage.ui: Remove that file, it is unused 2017-03-21 16:38:13 +01:00
Olivier Goffart
722918abd6 Folder::showSyncResultPopup: Fix undefined behavior when there is no errors
When there is no errors  _syncResult.firstItemError() is NULL, and accessing
it's _file member is an undefined behavior. (Thankfully, createGuiLog did not
use the string when the count was 0, but we are not supposed to create
null references.

Found with the UB sanitizer:

src/gui/folder.cpp:348:49: runtime error: member access within null pointer of type 'OCC::SyncFileItem'
src/gui/folder.cpp:348:19: runtime error: reference binding to null pointer of type 'const QString'
2017-03-20 11:53:13 +01:00
Olivier Goffart
4597201560 Merge remote-tracking branch 'origin/2.3'
Conflicts:
	src/libsync/owncloudpropagator.h
2017-03-16 14:35:08 +01:00
Olivier Goffart
a60370255e ActivityListModel: attempt to fix a crash.
The backtrace seems to indicate that the account is invalid.
I don't know how this can happen, maybe the account's display
name was changed while the app is running?

Backtrace:
Crash: EXC_BAD_ACCESS / KERN_INVALID_ADDRESS at 0x18
  Module "owncloud", in OCC::AccountState::account
  Module "owncloud", in OCC::ActivityListModel::data
  Module "owncloud", in OCC::ActivityItemDelegate::paint
  Module "QtWidgets", in QListView::paintEvent
  Module "QtWidgets", in QWidget::event
  Module "QtWidgets", in QFrame::event
  Module "QtWidgets", in QAbstractScrollArea::viewportEvent
  Module "QtWidgets", in QAbstractItemView::viewportEvent
  Module "QtWidgets", in QAbstractScrollAreaFilter::eventFilter
  Module "QtCore", in QCoreApplicationPrivate::sendThroughObjectEventFilters
2017-03-16 14:31:15 +01:00
Olivier Goffart
21909cae04 Propagator: change order of destruction
The destructor of the PropagateItemJob will access the propagator's
_activeJobList. So the _rootJob needs to be destroyed before it.
Order of destruction is the reverse of the order of the members in
the class. So put it at the end so it can be destroyed first.

(This made TestSyncEngine::testDirDownloadWithError crash sometimes
in the master branch)
2017-03-16 14:24:25 +01:00
Olivier Goffart
574435687d Merge remote-tracking branch 'origin/2.3'
Conflicts:
	src/libsync/owncloudpropagator.cpp
2017-03-16 13:51:53 +01:00
Christian Kamm
1a279ca158 About: Show the runtime versions of Qt and OpenSSL #5592
I didn't want to touch this visible translated string in a
patch release so I just switched the data.

For Qt versions before 5, we continue to show the build-time version
of OpenSSL but it's clearly marked as such.
2017-03-16 12:40:42 +01:00
Olivier Goffart
0ed929f24b SyncEngine: fix test regression in TestChunkingNG::testCreateConflictWhileSyncing
In 8ef11a38c9, we started blacklisting
SoftError for 0 seconds.  But if the two sync happen with less than
1s interval, we would still prevent them to happen.
So make sure we expire if 0 seconds have expired
2017-03-16 10:17:08 +01:00
Olivier Goffart
8e68e0321c Attempt to fix a crash in FolderStatusModel::slotUpdateDirectories
The backtrace looks like:

  File "atomic_base.h", line 396, in QString::~QString
  File "qlist.h", line 442, in OCC::FolderStatusModel::slotUpdateDirectories

This is the only QList operation, and it may crash if the list is empty.
It can be empty if the propfind returned empty results.
I'm not sure how this can be possible to have an empty list there since
the server is always supposed to return at least one entry, for the directory
itself. But it can happen if a directory was transformed in a file, or
if there is a bug on the server.
2017-03-15 17:23:39 +01:00
Christian Kamm
881b32521b HttpCreds: Update app passwords url #5605
See also owncloud/core#27360
2017-03-15 16:30:08 +01:00
Christian Kamm
b98876e265 Account server version: Helper to create versions
Hex literals don't work well with version 10: 0x100000 doesn't do
the right thing.
2017-03-15 16:30:08 +01:00
Olivier Goffart
dbb5bcb784 Ignore list editor: adjust the size
The previous patch on this file made it a bit too big, so make it a bit smaller
For issue #5600
2017-03-15 16:00:48 +01:00
Samuel Alfageme
fce194ce08 Using different window flags on the connection method dialog (#5614)
This is a possible fix for #3850, applying custom window flags (http://doc.qt.io/qt-5.8/qt.html#WindowType-enum) on the connection method dialog. These avoid resizing the dialog and displaying a maximize button on OS X and context help button on Windows.
2017-03-15 15:46:51 +01:00
Christian Kamm
9ca9773e9d Add more versions to --version #5592
* Add git revision, if available
* Add SSL runtime version
* Add compile-time Qt version
2017-03-14 16:13:52 +01:00
Christian Kamm
13b2568358 Windows/NTFS: Do not attempt to upload inaccessible files #5544
It is possible to create files with filenames that differ
only by case in NTFS, but most operations such as stat and
open only target one of these by default.

When that happens, we want to avoid uploading incorrect data
and give up on the file.

Typically this situation should never occurr during normal use
of Windows. It can happen, however, when a NTFS partition is
mounted in another OS.
2017-03-14 16:03:08 +01:00
Olivier Goffart
2152bc5fca Ignore list editor: adjust the size of the columns in the table
So the title of the column is fully visible.
Adjust the default size and the size policy of the label so it behave
correctly as the window get resized

Issue #5600
2017-03-13 17:05:24 +01:00
Christian Kamm
8ef11a38c9 Blacklist: Escalate repeated SoftError to NormalError #5500 2017-03-10 15:51:55 +01:00
Klaas Freitag
5e33898a08 Avatar: Use QImage instead of QPixmap to avoid dep on QApplication.
That fixes the test suite.
2017-03-09 22:34:36 +01:00
Olivier Goffart
9c83c57f1c Propagator: Attempt to fix a crash in OwncloudPropagator::scheduleNextJob
The crash reporter shows many crashes in OwncloudPropagator::scheduleNextJob.
We don't really know what could be the cause, but it's probably because
the _activeJobList contains dangling pointer.
So this patch makes sure to remove all the jobs from this list as they get
destroyed.
2017-03-09 15:48:52 +01:00
Olivier Goffart
0e8f0481d4 Merge remote-tracking branch 'origin/2.3'
Conflicts:
	src/libsync/owncloudpropagator.cpp
2017-03-09 09:54:14 +01:00
Christian Kamm
4a1a5fa076 AbstractNetworkJob: Improve redirect handling #5555
* For requests:
  - reuse the original QNetworkRequest, so headers and attributes
    are the same as in the original request
  - determine the original http method from the reply and the request
    attributes
  - keep the original request body around such that it can be sent
    again in case the request is redirected

* Simplify the interface that is used for creating new requests in
  AbstractNetworkJob.
2017-03-07 13:18:01 +01:00
Olivier Goffart
f4495c5c80 ActivityListModel: fix possible crash in slotActivitiesReceived
Backtrace from the crash reporter:

Crash: EXCEPTION_ACCESS_VIOLATION_READ at 0x401
  File "moc_activitylistmo_M5OEXJ7XGJYTWT.cpp", line 92, in OCC::ActivityListModel::qt_static_metacall
  File "qobject.cpp", line 3730, in QMetaObject::activate
  File "moc_networkjobs_7AMNCW4BBANVRK.cpp", line 1342, in OCC::JsonApiJob::jsonReceived
  File "networkjobs.cpp", line 714, in OCC::JsonApiJob::finished
  File "abstractnetworkjob.cpp", line 207, in OCC::AbstractNetworkJob::slotFinished
  File "moc_abstractnetwor_PFI2TXGQHRE33H.cpp", line 98, in OCC::AbstractNetworkJob::qt_static_metacall
  File "qobject.cpp", line 3730, in QMetaObject::activate
  File "moc_qnetworkreply.cpp", line 367, in QNetworkReply::finished
  File "qnetworkreplyhttpimpl.cpp", line 2100, in QNetworkReplyHttpImplPrivate::finished
  File "qnetworkreplyhttpimpl.cpp", line 279, in QNetworkReplyHttpImpl::abort

My theory is that the AccountState stored in a property of the job was destroyed.
before the job timed out.
Therefore, the qobject_cast within the qvariant_cast would call the metaObject()
virtual function on a dangling pointer.

Fix it by storing a QPointer instead which will track the deletion.
2017-03-06 17:25:22 +01:00
Olivier Goffart
f862c626a1 Propagator: Fix finished signal of directory being emited twice and causing crash
When there is a FatalError, we ended up emiting the finished signal for
the directory job several times, which would lead to crashes

Issue #5578
2017-03-06 16:14:04 +01:00
Olivier Goffart
13df7fcee0 Merge branch '2.3'
Conflicts:
	src/libsync/owncloudpropagator.cpp
2017-03-03 10:57:23 +01:00
Olivier Goffart
4a010ce7cd SslButton: Remove additional ')'
Regression since 7bfe061382
Issue: #5573
2017-03-03 10:43:47 +01:00
Jocelyn Turcotte
384f18da38 Potential fix for crash in PropagateDirectory::abort (#5564) 2017-02-27 17:09:29 +01:00
Jocelyn Turcotte
793a994ce6 Don't abort propagation job abortions synchronously from finished
This leads to crashes since we changed the connection to the parent
jobs not to be queued anymore.
We don't really need to bubble up the finished state through
parents in that case, and it would also mean that we'd recurse
all the way through leaves as we go up to each parent. So just call
abort directly on the OwncloudPropagator and make sure the abortion
call is posted to the event loop.
2017-02-23 17:54:33 +01:00
Jocelyn Turcotte
19bf5e2ff1 Reduce the connection data used by PropagateDirectory objects
Avoid using connections to report up the job tree for signals
that we can directly communicate to the OwncloudPropagator.
This slightly reduces the memory usage and avoid passing those calls
through the whole parent chain.
2017-02-23 17:54:33 +01:00
Jocelyn Turcotte
16ad3d5c88 Create PropagateItemJobs only before starting them 2017-02-23 17:54:33 +01:00
Jocelyn Turcotte
ff2d98596f Split running jobs into a separate vector 2017-02-23 17:54:33 +01:00
Jocelyn Turcotte
072698d606 Split the subjob logic out of PropagateDirectory 2017-02-23 17:54:33 +01:00
Jocelyn Turcotte
0b098045f1 Replace WaitForFinishedInParentDirectory with WaitForFinished for directory moves
In preparation for the PropagateDirectory refactoring, simplify things
by removing WaitForFinishedInParentDirectory, which is currently
implemented as a one-level check.

This value is important for directory items, but is however never
used since a directory CSYNC_INSTRUCTION_RENAME item will always be in
PropagateDirectory::_firstJob, which will have to pass through its own
PropagateDirectory job's parallelism() before reaching the parent's
_subJobs optimization.
Since PropagateDirectory::parallelism can only return WaitForFinished
or FullParallelism, that value is lost. So this commit doesn't
change the behavior for directories, and allow file renames to be
scheduled in parallel across directories (which isn't a problem).
2017-02-23 17:54:33 +01:00
Jocelyn Turcotte
ddb6b3b262 Fix TestSyncEngine::abortAfterFailedMkdir (again)
It could be possible that _firstJob is marked as finished if
aborted before its parent PropagateDirectory was marked as finished,
allowing a posted scheduleNextJob call to schedule the child job
in-between.
2017-02-23 17:54:33 +01:00
Olivier Goffart
7bfe061382 Verify that all strings are properly escaped (#5558)
- I checked every occurence of a '%2' and make correct use of the
QString::arg overload that takes several argument instead of chaining
them, because the first argument can contains a '%1'

 - I tried to look for every label that they either use plain text or richtext
and escape the user provided strings in there.
2017-02-23 14:54:17 +01:00
Christian Kamm
21a09df7d1 Wizard: Handle PROPFIND redirects #5553
By default, followRedirects is true for all requests, to transparently
handle redirections. In the wizard, we have special redirect-handling
code though and that was being skipped.

Setting the flag to false allows the wizard to be aware of redirects
and to handle them in the correct way. Tested with the server described
in
https://github.com/owncloud/administration/tree/master/redirectServer

There's a second bug here, where followRedirects always converts
redirected requests to the GET verb. That means redirected PROPFINDs
will never have worked. This change un-breaks them for the wizard only.
There should be no case that previously worked that stops working now.
2017-02-22 13:24:13 +01:00
Markus Goetz
65d8f51a10 Message Boxes: Force to be more on top #5503 (#5536) 2017-02-20 13:58:35 +01:00
Olivier Goffart
112a7dba73 Propagator: Fix t8.pl
The test sets OWNCLOUD_MAX_PARALLEL to 1 to disable parallelism.
But since the max amount of parallelism is twice as much, that does not
work.
So change the way we compute the hardMaximumActiveJob: Use the value of
OWNCLOUD_MAX_PARALLEL to maximize this amount and base the maximum amount
of transfer jobs on it instead of the other way.

A result of this change is that, in case of bandwidth limit, we keep the
default of 6 non-transfer jobs in parallel. I believe that's fine since
the short jobs do not really use bandwidth, so we can still keep the same
amount of small jobs.
2017-02-17 16:56:57 +01:00
Christian Kamm
ee11b5d9be Revert "Don't blacklist 507 Insufficent Storage #5346 (#5424)"
This reverts commit e1f5a49c21.

Retrying uploads with insufficent storage errors frequently leads to
high server traffic. See #5537 for links and a sketch of a correct
solution.
2017-02-17 16:21:54 +01:00
Jocelyn Turcotte
824be789bf Revert "Fix TestSyncEngine::abortAfterFailedMkdir"
This reverts commit 1cec2ca13d
but keeps the reset() -> take() part that is probably the cause
of crashes we've seen in the crash reporter.
2017-02-17 14:06:30 +01:00
Olivier Goffart
a3f4907e0b AccessManager: don't set an invalid network configuration on linux (#5538)
If we call
 setConfiguration(QNetworkConfiguration());
This sets an invalid configuration on the QNAM.
But later, when we really go online because interfaces are discovered,
QNetworkAccessManagerPrivate::_q_onlineStateChanged is called (with isOnline=true).
And this will set the state to disconnected because customNetworkConfiguration is
true, and the networkConfiguration state is disabled.

The workaround we to fix another bug on Windows in which the default network
configuration was not behaving properly.

The issue on linux is hard to reproduce and only happen in some condition,
but it was reproduced on smashbox when they run two owncloudcmd at the same time.

Issues: #4720 , #3600
2017-02-16 16:14:55 +01:00
Christian Kamm
4d7dd0c909 Recent Changes: Fix duplicates #5256
The transmissionProgress emission when the whole sync finishes
shouldn't look exactly like the one for the last file.
2017-02-16 15:10:46 +01:00
Olivier Goffart
e8c10501a5 Folder: Keep files option after aboutToRemoveAllFiles should not clear selective sync list (#5531)
We were removing the wholme journal db when the user wanted to keep all files,
But that would also remove the selective sync lists.
We should only remove the metadata table.

Issue #5484
2017-02-15 13:27:41 +01:00
Olivier Goffart
172689d35c Merge remote-tracking branch 'origin/2.3' 2017-02-14 15:08:10 +01:00
Jocelyn Turcotte
b26db062d2 Fix the UNIT_TESTING build on Windows
- Put all tests in the bin directory so that DLLs can be loaded
- Add missing exports
- Skip tests that use code depending on zlib
- The "GMT" timezone is named differently, use the int constructor instead

5 tests are still failing, it's not really worth fixing at the moment
since no developper is currently using Windows as its main platform.
2017-02-14 14:32:41 +01:00
Jocelyn Turcotte
867b78052d Fix UtilityTest on macOS 2017-02-14 14:32:41 +01:00
Olivier Goffart
058f7df635 Folder: remove unused variable 2017-02-14 10:10:07 +01:00
Jocelyn Turcotte
d1dace9e7f Remove unneeded Q_DECLARE_METATYPE 2017-02-08 17:57:20 +01:00
Jocelyn Turcotte
1cec2ca13d Fix TestSyncEngine::abortAfterFailedMkdir
It could be possible that _firstJob is marked as finished if
aborted before its parent PropagateDirectory was marked as finished,
allowing a posted scheduleNextJob call to schedule the child job
in-between.
2017-02-08 17:32:04 +01:00
ckamm
7879c470b3 Merge pull request #5518 from ckamm/asserts
Improve usage of asserts
2017-02-08 15:25:02 +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
Christian Kamm
18e25122db Performance: reserve() _remotePerm #5496 2017-02-08 15:06:09 +01:00
Olivier Goffart
439e688906 Folder: Change the wording for the massive deletion message
Issue #5503
2017-02-08 14:30:14 +01:00
ckamm
4198d9f420 Settings: Don't migrate settings on access error #5499 (#5523)
Previously, we'd try migrating from legacy settings if reading
the settings failed with an error. Now, we try again after a
couple of seconds and eventually give up.
2017-02-08 14:28:50 +01:00
Olivier Goffart
06579a5c70 AccountManager: Fix small leak in the account migration code
The QSettings object was not deleted in every possible code paths
2017-02-08 12:31:07 +01:00
Markus Goetz
df773ea8bb CentOS: More build fixes 2017-02-08 11:39:28 +01:00
Markus Goetz
e7be4faac8 CentOS: Another attempt 2017-02-08 11:15:23 +01:00
Markus Goetz
1102ac20ac Improve previous fix
After comment on 78a798eef3
2017-02-07 19:40:32 +01:00
Markus Goetz
6a4ae63f14 CentOS: Another fix for old compiler version (2) 2017-02-07 19:22:04 +01:00
Markus Goetz
78a798eef3 Old Qt: Another build fix 2017-02-07 18:54:40 +01:00
Markus Goetz
19dd656989 CentOS: Another fix for old compiler version 2017-02-07 18:32:34 +01:00
Markus Goetz
d9fac50e9b CentOS: Fix build for old compiler version 2017-02-07 18:05:29 +01:00
Markus Goetz
9614a94035 Revert "Disable RTTI"
This reverts commit 85d3de1589.
This breaks our old Qt on CentOS.

We can re-introduce this with #5470
2017-02-07 17:35:04 +01:00
Olivier Goffart
0d16cf41fe Merge remote-tracking branch 'origin/master' into 2.3
We can do that because the only changes that were in master but not in 2.3 were the
translations change and documentation change, and the support for the 'M' permission
which we want in 2.3.
2017-01-27 17:45:05 +01:00
Olivier Goffart
65e4afedc4 Account Wizard: don't whitelist everything on the first sync if we still want to confirm big folder
Issue: https://github.com/owncloud/client/pull/5340#issuecomment-274564441
2017-01-27 15:59:59 +01:00
Olivier Goffart
b76a9654cc General Settings: Make sure to reload the settings when an account is added
The Size limit, or confirmation checkboxes might have changed.

We need to guard against saving if the control changes while we are loading

Issue: https://github.com/owncloud/client/pull/5340#issuecomment-274878023
2017-01-27 15:59:59 +01:00
Olivier Goffart
38cf459b3e Confirm External Storage: adjust the notification message
We need to forward the information that the folder is an external storage
for the notification message.

Issue: https://github.com/owncloud/client/pull/5340#issuecomment-274878023
2017-01-27 15:59:59 +01:00
Olivier Goffart
ed7416098e Wizard: Increase the size
The advanced page has become quite complex and does not fit on the screen
anymore if the fonts are too big
2017-01-27 15:59:59 +01:00
Olivier Goffart
517623e457 FolderStatusModel: Different icon for external storages
Issue: https://github.com/owncloud/client/pull/5340#issuecomment-274564441
2017-01-27 15:59:59 +01:00
Olivier Goffart
f89bc09fd1 Discovery: Filter 'M' out of permissions for non root storage
The sync engine rely on the 'M' in premission to ask for confirmation
(As requested in issue #5340)
But we only want to ask the premission for the 'root' of the mounting point and not
for every subfolders within it.
So we change the discovery phase in a way that it does not keep the 'M' for
children within the external storage.
2017-01-27 15:59:59 +01:00
Olivier Goffart
f854c5263b Wizard: Add options to ask confirmation for external storage
Added two checkboxes in the Account Wizard in the advanced page to change the first options.
Also added a checkbox in the general settings to ask for confirmation for external storages.

Theme options allow to hide the checkboxes in the wizard.

As described in issue #5340
2017-01-27 15:59:59 +01:00
Olivier Goffart
70da607e06 Discovery: Add branding option to disable default sync of 'M' directories
Issue #5331 and https://github.com/owncloud/enterprise/issues/1594
2017-01-27 15:59:59 +01:00
Jocelyn Turcotte
8884fe7236 Remove PropagateDirectory::_runningNow
This variable isn't used anymore except in a stray Q_ASSERT.
2017-01-26 17:13:54 +01:00
Jocelyn Turcotte
bb3efc5988 Clear SyncEngine::_remotePerms after the sync
Also make reuse the SyncFileItem::_remotePerm QByteArray allocation
instead of redoing the copy from the csync char*.
2017-01-26 17:13:54 +01:00
Jocelyn Turcotte
f6665ccc81 Pack boolean members in PropagateUploadFileCommon #5457 2017-01-26 17:13:54 +01:00
Jocelyn Turcotte
f1e9be4fa8 Don't use the StopWatch for each job in production builds #5456
This accounted for more than 10% of the peak memory usage while only
providing value through the debugging log.
2017-01-26 17:13:54 +01:00
Jocelyn Turcotte
9db23d4df1 Remove SyncFileItem::_requestDuration #5456
This will save a QElapsedTimer in each job that was used only for
.owncloudsync.log (for which the request duration doesn't bring much
value).
2017-01-26 17:13:54 +01:00
Jocelyn Turcotte
9d16ad844c Don't reallocate a QByteArray for each contentChecksumType call #5481 2017-01-26 17:13:54 +01:00
Jocelyn Turcotte
b0700ebbab Remove duplicate SyncFileItem entries for the log
The accuracy of that log isn't as important as the few bytes those
fields take as hostage for the whole sync.
2017-01-26 17:13:54 +01:00
Markus Goetz
2bda55be81 Don't create legacy 'folders/' subdirectory 2017-01-26 12:29:58 +01:00
Markus Goetz
e859d220be Cookies: Use different DB for different accounts (#5490)
This is a follow up to #5469
2017-01-26 10:54:03 +01:00
Piotr Mrówczyński
c3ae5123cb Delete finished propagation jobs in PropagateDirectory #5269 (#5400) 2017-01-26 10:03:22 +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
1fc5a76622 Pass the SyncFileItem as SyncFileItemPtr in itemCompleted
This will allow us to keep a reference on the items in connected slots.
2017-01-25 23:26:23 +01:00
Jocelyn Turcotte
a764d7eb86 Don't pass the PropagatorJob in itemCompleted
This was to catch duplicate emissions for PropagateDirectory but we
don't emit this signal anymore from there.
This fixes a warning about PropagatorJob not being a registered metatype.

This reverts commit fe42c1a818.
2017-01-25 23:26:23 +01:00
Jocelyn Turcotte
92e86641d1 Bring back the error message if the sync-exclude.lst file is missing
We unconditionnally add the file on startup, but don't check for errors.
During sync we check for errors, but only try loading the file if it
exists.
2017-01-25 23:26:23 +01:00
Markus Goetz
c8cfb3160e Merge remote-tracking branch 'origin/selective-sync-big-folder' into 2.3 2017-01-25 19:45:20 +01:00
Olivier Goffart
268fc97a71 Merge pull request #5480 from owncloud/chunking-ng-cleanup
Chunking ng cleanup
2017-01-25 19:19:48 +01:00
Christian Kamm
59c1fdbe05 Shib: Use different keychain entry per account #5469
Previously shib multiaccount didn't work at all because the
session cookie was stored in the same keychain entry.
2017-01-24 13:14:11 +01:00
Christian Kamm
26234dbf6c Folders: Adjust ui when account is disconnected #5477
Previously if you paused/unpaused a folder for a disconnected account
they would prepare to sync and thus display the 'Waiting...' text. With
this change, folders that can't possibly sync don't show text like
this.

When account connectivity changes, all unpaused folders will be
scheduled anyway.
2017-01-24 10:26:03 +01:00
Klaas Freitag
e95b73dfac Avatar: Set a circle mask around the avatar image.
The server displays the avatar cut into a circle, and so we do.
2017-01-23 21:36:18 +01:00
Klaas Freitag
c00e3e8c0a ConnectionValidator: Set a 20 second timeout for Avatar request. 2017-01-23 21:35:12 +01:00
Klaas Freitag
2a12610a46 Update ASCII-Art describing the connection check flow.
Added Avatar fetching
2017-01-23 21:34:34 +01:00
Klaas Freitag
d466a05915 SettingsDialog: Display the user avatar as action icon if available.
The avatar image is fetched from the server async, thus connect a signal
from the account if the avatar changes.

Server feature https://github.com/owncloud/core/pull/26872 is needed.
2017-01-22 13:58:36 +01:00
Klaas Freitag
e05d6bfcdc Make the Account store the avatar pixmap.
The avatar pixmap is fetched from the server by the Connectionvalidator,
once it has validated the user name, it queries the avatar pixmap.

If the server does not have the avatar route, an empty pixmap is stored.
2017-01-22 13:55:08 +01:00
Klaas Freitag
b49dd02e3d New network job AvatarJob: GETs the account avatar from server. 2017-01-22 13:52:19 +01:00
Olivier Goffart
d6fdda8efa ChunkingNG: add '0' padding on the filename (#5476)
The server sorts the chunk by name alphabetically. So if we want to keep
the chunk in order, we need to add a few '0' in front of the chunk name
2017-01-20 16:03:50 +01:00
Olivier Goffart
a63d970e5e ChunkingNG: remove stale chunks when cleaning the uploadInfo table
Stale chunks might be there because a file was removed or would just not
be uploaded, for any reason.
We just start the DeleteJob but we don't care if it success or not.

Relates to https://github.com/owncloud/core/issues/26981

One of the test is testing the case where the file is modified on the server
during the upload. So this test the precondition failed error.
The FakeGetReply logic was modified because resizing a 150MB big QByteArray
by increment of 16k just did not scale when downloading a big file.
2017-01-20 14:48:53 +01:00
Olivier Goffart
f6c77fad17 ChunkingNG: delete stale chunks if the file was changed locally
Relates to https://github.com/owncloud/core/issues/26981

We do not track the success or error of the DeleteJob because it does not
matter. If it fails, it might be because the chunks were already removed.
If not, the chunks will be stale, but the server must anyway do a few
cleanup from time to time because we do not always remove the chunks
2017-01-20 14:48:53 +01:00
Jocelyn Turcotte
b68a28de8d StatusTracker: Emit OK for the last child before parents (#5467)
The current logic tried to avoid a DB lookup just to fetch whether
the file is shared or not since that info is already in the
SyncFileItem. The implementation would however need to decrease the
sync count for itself (and parents) before emitting the new status,
thus emitting the OK status for parents before that last child that
ended the propagation for that folder.

Change the implementation to achieve what we want: give the
possibility to decSyncCount to use a pre-fetched sharing state while
still doing the emission for all involved files. This ensures that
the leaf file also gets its status emitted before its parents.

Issue #4797
2017-01-18 15:40:52 +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
Jocelyn Turcotte
c25b599bbb SocketApi::slotReadSocket: Small optimizations
- Use the looked-up method index also for the invocation
- Do the method name concatenation already on QByteArray since we'll
  convert anyway
- Use staticMetaObject instead of metaObject()
2017-01-18 12:15:52 +01:00
Jocelyn Turcotte
a5ff9e58e3 SocketAPI: Remove unecessary null-checks
Those methods are private and there is only one call-site, we can
be sure that this parameter won't be null already.
2017-01-18 12:15:52 +01:00
Olivier Goffart
9b96899d75 Sync Engine: Specify what chars are not syncable in the error message #1733 (#5449) 2017-01-18 11:45:46 +01:00
Olivier Goffart
b046cca010 Fix more compilation errors with Qt 4
Ammand last commit which was a fixup to the change from pull request #5468
for issue #5453
2017-01-18 10:19:51 +01:00
Olivier Goffart
edf0a99a8a Fix compilation with Qt 4
Fixup to the change from pull request #5468 for issue #5453
2017-01-18 09:57:36 +01:00
Christian Kamm
352f168313 Folder: Remove unused variable 2017-01-17 14:53:09 +01:00
Markus Goetz
85d3de1589 Disable RTTI
Shrinks owncloud binary by 24 KB and libowncloudsync by 14 KB.
I don't know if it has influence on memory usage or runtime speed though.

Was worth a try.
2017-01-17 14:52:10 +01:00
Markus Goetz
588a88fb63 Updater: Don't create instance for invalid URL
Also don't use dynamic_cast
For enterprise/#689
2017-01-17 14:52:10 +01:00
Christian Kamm
cd9e88ad22 PropagatorJob: Remove unneccessary pointer #5453 2017-01-17 14:47:38 +01:00
Christian Kamm
29b39acfbe PropagatorJob: Access propagator through function #5453 2017-01-17 14:47:38 +01:00
Markus Goetz
9d7425b201 DB: Also migrate -shm and -wal to new name #3764 #5045 (#5459) 2017-01-16 15:42:11 +01:00
Markus Goetz
7eb43d7f7e PropagateUploadFileNG: Delete unused map contents to free memory 2017-01-13 19:00:04 +01:00
ckamm
d76e0ec6d8 Reset stuck chunked uploads eventually #5344 (#5443)
Previously this wasn't happening for errors that were not
NormalErrors because they don't end up in the blacklist.

This revises the resetting logic to be independent of the
error blacklist and make use of UploadInfo::errorCount
instead.

412 errors should reset chunked uploads because they might be
indicative of a checksum error.

Additionally, server bugs might require that additional
errors cause an upload reset. To allow that, a new capability
is added that can be used to advise the client about this.
2017-01-13 14:44:45 +01:00
Olivier Goffart
0249a68420 SelectiveSync: adjust the position of the "Loading" label
It should be parented to the treeview to be sure that is shows inside of it.
2017-01-13 10:55:45 +01:00
Christian Kamm
aa6f041c36 wizardSelectiveSyncDefaultNothing applies to folder wizard #4581
Previous the Theme option only applied to the account setup wizard.
2017-01-13 10:52:39 +01:00
Christian Kamm
dce3f8c4f6 Selective sync: Adjust widget common to folder/account wizards 2017-01-13 10:52:10 +01:00
Christian Kamm
ffbf34cb97 Log the auth type being used for accounts
There have been hard to track down bugs related to the wrong auth
type being used.
2017-01-11 09:30:59 +01:00
Markus Goetz
76fde49282 sqlite: Update bundled version to 3.16.1
For OS X and Windows.
2017-01-05 17:27:46 +01:00
Christian Kamm
adbe5ecf55 ownsql: qFatal on prepare errors #5357 2017-01-04 15:15:06 +01:00
Christian Kamm
084146756b Account: Fix displayName() #5413
This displayName() seemed to be based on Account::user() which used
to call _credentials->user(). But then we repurposed user() to be
davUser() and this usage wasn't updated to point back to the username
used for the credentials.
2017-01-03 13:54:59 +01:00
ckamm
e1f5a49c21 Don't blacklist 507 Insufficent Storage #5346 (#5424) 2017-01-03 13:48:32 +01:00
Christian Kamm
e286bb1b64 Wizard: Don't accidentally pre-fill url field #5412
slotUrlEditFinished() is called when the wizard is triggered in
some situations.
2017-01-03 11:53:40 +01:00
Olivier Goffart
d433f0e08e HTTPCreds: remove all cookies when logging out (#5383)
Some custom server use persistent cookies with the auth token. So we should
clear all the cookies when disconnecting.
Account::clearCookieJar is only called from the HTTPCredentials. This funciton
is not used for shibboleth.
There is probably no reasons to keep the HTTP cookie anyway.

Issue #5370
2017-01-03 11:39:10 +01:00
Christian Kamm
fa9b36f829 Wizard: Let the user know if url is invalid #5398 2017-01-03 11:28:56 +01:00
Christian Kamm
6835429a28 Sql: Allow prepare fail for PRAGMA quick_check #5357
This actually happens in low-disk situations.
2017-01-03 10:43:29 +01:00
Christian Kamm
22135f9f57 Fixup broken authType on load #5408 2017-01-03 10:38:20 +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
Markus Goetz
c6f4f44619 Fix up SSL client certificates #5213 #69 (#5289)
The re-enables the UI, uses Qt API for importing and
stores the certificate/key in the system keychain.
People who had set up client certs need to re-setup the account. This is ok
since it was an undocumented feature anyway.
2017-01-02 08:34:02 +01:00
Christian Kamm
3b7887ca35 Wizard: Detach saved account from wizard
Fixes #5408 #5407.

The problem was that cleanup of the credentials page set the
credentials of the account back to dummy, thereby overriding
things like shib usernames.

This should be broken since a932eac832.
2016-12-21 15:31:12 +01:00
Piotr Mrówczyński
d781e63fab Add capability to disable parallel chunked upload #5364 - technical review (#5403) 2016-12-21 15:08:45 +01:00
Christian Kamm
030e3a5d4a Increase initial bandwidth estimates #4428 #5390
To 2 MB/s and 10 files/s.
2016-12-21 08:53:47 +01:00
Christian Kamm
3912dba33a Move qDeclareMetatype from Folder to SyncEngine 2016-12-20 11:43:39 +01:00
Christian Kamm
d8c479ab1e Don't wipe db if check fails while disk space is low #5357
An experimental fix for the issue, merged because it's low risk and
makes testing easier.
2016-12-20 09:33:59 +01:00
Olivier Goffart
775a1c9ad8 FolderStatusModel: Fix insert/remove items when there are labels
Otherwise it might happen that the model is inconsistant and this can
lead to crash in the worst case.

(For example, if there was a "fetching" label, and we hide it because it
was a 404. In this case, we would not call begin/endRemoveRows, so the
view could still call the model with an index of row 0, that used to be
for the label, but now correspond to the first element of _subs. And
because _subs is empty, this could lead to crashes)
2016-12-14 14:13:47 +01:00
Olivier Goffart
ac95844ebd Propagator: make sure every network job has a parent
This could make sure that the network job gets deleted if the parent job gets
deleted, and would avoid crashes like:

Crash: EXCEPTION_ACCESS_VIOLATION_READ at 0xffffffff8b008a04
  File "qiodevice.cpp", line 1617, in QIODevice::errorString
  File "propagatedownload.cpp", line 264, in OCC::GETFileJob::slotReadyRead
  File "moc_propagatedownload.cpp", line 85, in OCC::GETFileJob::qt_static_metacall
  File "qobject.cpp", line 3716, in QMetaObject::activate
  File "moc_qiodevice.cpp", line 154, in QIODevice::readyRead
  File "qnetworkreplyhttpimpl.cpp", line 1045, in QNetworkReplyHttpImplPrivate::replyDownloadData

(#5329)
2016-12-14 14:13:47 +01:00
Olivier Goffart
c5b90d9507 Account::slotHandleSslErrors: add guards in case the reply gets deleted in the dialog event loop
Since slotHandleSslErrors will show a dialog with an eventloop, it could be
That the reply gets deleted. Guard against that.

(#5329)
2016-12-14 14:13:47 +01:00
Christian Kamm
d631f2e070 Sync now: Disable on disconnect, rename while running #2158 2016-12-13 15:28:52 +01:00
Jocelyn Turcotte
f985111b62 Fix the log window not showing csync logs
The csync log level was only set up on startup, and for log files.
Fix the issue by making Logger::isNoop rely on being explicitly activated
for the log window instead of relying on the presence of a connected
signal, and move the csync log level logic in Logger.
2016-12-09 10:03:46 +01:00
Jocelyn Turcotte
e8d734b1c2 Fix the sync direction being wrong on MSVC
The compiler seems to use signed enums and we need to reserve an extra
bit for the sign to avoid the 2 value to overflow and being interpreted
as -2 when read, and thus not being correctly compared to the full enum
value.
2016-12-09 10:03:46 +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
Olivier Goffart
4ac2b764a4 libsync: Clear the upload info after several retries (#5345)
Issue #5344
2016-12-05 17:21:36 +01:00
Olivier Goffart
19d2677db1 libsync: use the new webdav url if the server reports it
The rules to select the webdav url are now:

 - If the server reports that the new chunking algorithm is working,
   always use remote.php/dav/files/<username>
   This capability can be overriden with an environment variable

 - Otherwise, use the dav path provided by the theme, which defaults to
   remote.php/webdav

This means that with the newer server, the branding can no longer override
the webdav URL. If there is still an usecase for the branding to do so, we
need to find another way to override it. But it is now more complicated to
configure as might need include the username and need different endpoint
depending on the operations (chunks or not)

Issue #4007
2016-11-29 16:16:20 +01:00
Christian Kamm
a139d1a279 FolderWizard: pass AccountPtr by const&
For review of #5045
2016-11-29 10:39:20 +01:00
Christian Kamm
acb155503b Ensure the 'Sync paused' state is used after pausing #5290 2016-11-29 09:56:45 +01:00
Olivier Goffart
109056e676 owncloudcmd: Don't put the password in the URL
As the URL might be print on the logs.
Also don't change the scheme from http to owncloud.

This was required before when we were using neon through csync, but now that
we use QNAM for everything we don't need it. The credentials from the account
are used.
2016-11-26 12:57:44 +01:00
Christian Kamm
68f99bcc27 AccountSettings: Add a "Force sync now" context menu option 2016-11-25 14:23:56 +01:00
Christian Kamm
045498c71a Account: Rename user() to davUser()
Avoids potential confusion with credentials->user()
2016-11-23 17:08:17 +01:00
Christian Kamm
49f8143f00 Bugfixes for sync journal name generation and usage
* Use 'user' value for journal name generation
* Save journal name in settings
* Make owncloudcmd choose the right db
2016-11-23 16:48:15 +01:00
Christian Kamm
bea7241910 Don't wipe each journal on each start 2016-11-23 16:48:15 +01:00
Christian Kamm
61b4da944c Split folders configuration locations for backwards compatibility 2016-11-23 16:48:15 +01:00
Christian Kamm
6fe1868693 Always migrate .csync_journal to ._sync_xxx 2016-11-23 16:48:15 +01:00
Christian Kamm
9641c7a1e7 Rename sync journal to ._sync_xxx.db.
The added underscore means that older clients will also ignore the
file.
2016-11-23 16:48:15 +01:00
Christian Kamm
3e59a9b316 Merge branch 'master' into dbjournal_per_account 2016-11-23 16:47:56 +01:00
Markus Goetz
679ac0d26a Wizard: Show if server asks for client certificate #2799 #69 (#5261)
This also nicely displays the 'Untrusted domain' message of oC.
The link to add a trusted domain (via web browser) is clickable.
2016-11-23 11:43:15 +01:00
Markus Goetz
2e3a3bcf84 Folder: Make folder only accessible by user #5282 (#5315)
Because on OS X the parent folder might not protect
against access.
2016-11-23 11:05:41 +01:00
Olivier Goffart
d22d0e7e30 Propagator: don't use dynamic_cast for QObject
qobject_cast is better. (no need to use RTTI when we have QMetaObject
2016-11-22 17:37:41 +01:00
Samuel
4998303c42 Fixing a typo on a message
This refers to the message shown when copying the list of unsynced items on the activity tab
2016-11-22 12:14:03 +01:00
Christian Kamm
ceef2f2d46 FolderMan: Never schedule paused folders #5290
Previously the last folder in the queue was scheduled, regardless
of whether it was paused or not.
2016-11-22 10:53:15 +01:00
Olivier Goffart
a1dc4069c9 libsync: Don't store the remote URI in the csync or in the SyncEngine
We are going to change the webdav path depending on the capabilities.
But the SyncEngine and csync might have been created before the capabilities
are retrieved.

The main raison why we gave the path to the sync engine was to pass it to csync.
But the thing is that csync don't need anymore this url as everything is done by the
discovery classes in libsync that use the network jobs that use the account for the urls.
So csync do not need the remote URI.

shortenFilename in folderstatusmodel.cpp was useless because the string is the
_file of a SyncFileItem which is the relative file name, that name never
starts with owncloud://.

All the csync test creates the folder because csync use to check if the folder
exists. But we don't need to do that anymore
2016-11-21 08:09:11 +01:00
Christian Kamm
eb8de8e3c0 Enable clicking on 'not synced' items #5306 2016-11-18 16:19:36 +01:00
ckamm
ec7333a4bf Merge pull request #5272 from owncloud/licensefix-pending
License: Adjust license of GPLv2 source files to GPLv2+
2016-11-18 15:14:47 +01:00
Christian Kamm
e485c5c008 Always send a progress message at the end of a sync #5290
Some listeners detect whether a sync is finished by checking
for isUpdatingEstimates and completedFiles >= totalFiles. But
if a sync didn't transfer any files we never sent signal
with these values. Now we do.
2016-11-18 12:33:44 +01:00
Christian Kamm
6451eb3ade Tray: Add a 'New account...' action if no account is configured #5307
Useful when left-clicking the tray icon isn't working for some reason.
2016-11-18 12:17:05 +01:00
Olivier Goffart
efa7821dd2 Revert "Discovery: consider also the "shared by me" as shared"
This reverts pull request 5313 (commit
2d6e473a40 and
2f3db04e87)

The problem is that this loads the server too much.
2016-11-16 17:45:40 +01:00
Markus Goetz
89f55cf9df Folder: Add comments after discussion about pre-selected selective sync 2016-11-16 14:08:05 +01:00
Markus Goetz
52552a4204 Merge pull request #5102 from owncloud/chunking-ng
Chunking ng
2016-11-15 15:56:52 +01:00
Olivier Goffart
2f3db04e87 Rename SyncFileStatus::sharedWithMe to shared
Last commit for issue #4788 made the meaning to be simply shared
(with the user or from the user)
2016-11-15 14:32:20 +01:00
Olivier Goffart
2d6e473a40 Discovery: consider also the "shared by me" as shared
The "S" in the permission is only for the "Shared with me" files.
It is only used to show the shared status in the overlay icons.
But we also wish to show the shared status for files that are shared
"by" the users. We can find that out using the 'share-types' webdav
property. If set, then we are sharing the object.
We fake a 'S' in the permission as for our purpose, they mean the same.

Issue #4788
2016-11-15 14:32:20 +01:00
Olivier Goffart
2723cd225e FolderStatusDelegate: Fix compiler warning.
QStyleOptionProgressBarV2 is deprecated in Qt5.
2016-11-15 10:16:41 +01:00
Olivier Goffart
77e790d2ee Merge pull request #5304 from owncloud/Kawohl-linktocentral
documnetation.
2016-11-14 12:43:10 +01:00
Tobias Haeussler
0c0a3ca0a5 Add manifest file on Windows to make the application UAC aware. 2016-11-14 12:16:58 +01:00
Olivier Goffart
5377d1e283 Chunking-NG: code cleanup after review 2016-11-14 10:42:07 +01:00
Jonathan Kawohl
29d3c33eb2 added missing quotes 2016-11-09 08:59:14 +01:00
Jonathan Kawohl
469eca1f5f added link to central 2016-11-09 08:59:14 +01:00
Jonathan Kawohl
0864d67a9a fixing wrong files Revert "fix for https://github.com/owncloud/client/issues/1251"
This reverts commit 4f1feab845.
2016-11-09 08:59:14 +01:00
Jonathan Kawohl
e9503664f5 fix for https://github.com/owncloud/client/issues/1251 2016-11-09 08:59:14 +01:00
ckamm
36d61ef3a9 Doc: Add sync algorithm overview and comments (#5277)
* Doc: Add sync algorithm overview and comments
2016-11-08 16:10:55 +01:00
Christian Kamm
f1f27221a7 Conflicts: Use the local mtime for the conflict file name #5273
Otherwise local conflict files may be overridden in a restore
situation. See ticket for details.
2016-11-08 14:47:51 +01:00
Christian Kamm
eb012d26ee FolderStatusModel: Minor cleanups. 2016-11-08 14:01:07 +01:00
Christian Kamm
9ee8187083 Sort folder list alphabetically #5299 2016-11-08 14:01:07 +01:00
Christian Kamm
90cea69692 Network: Add "Accept" header for some firewalls #5298 2016-11-08 11:01:49 +01:00
Christian Kamm
0e2782d369 Terminate sync when pausing from context menu #5290 2016-11-07 12:50:06 +01:00
Olivier Goffart
15f2b911d9 ChunkingNG: remove stale files when resuming 2016-11-04 16:43:01 +01:00
Olivier Goffart
e3a4c3989a SyncEngine: disable heuristics for backup restoration for server >= 9.1
The ownCloud 9.1 server has a data-fingerprint property that the admin must
change in case of backup restoration. When this change, the client understands
that a backup was restored, and will generate conflict files and re-upload
new files.

The heuristics based system checks that there is at least two files wose mtime
is put back in the past and no files that goes forward. In that case we ask the
user before creating the conflicts.

This commit disable the heuristics for newer server that have the data-fingerpint.
And change the heuristics to two hours because we want to avoid false positive due
to some clock error, and that 2 hours of lost due to backup restoration is probably
not so bad.

We only ask the user in the heuristics based aproach so in practice this mean that
the "backup-detected" dialog will no longer appear with newer server.

Relates issues #5260, #5109
2016-11-04 16:30:58 +01:00
Piotr Mrówczyński
a2287c9657 Merge pull request #5274 from owncloud/reduce_loops_dirjob
Cache the value of last unfinished job in the PropagateDerectory scheduleNextJob
2016-10-31 22:07:50 +01:00
Piotr M
34c59ba9ed reduce number of loops 2016-10-31 19:45:24 +01:00
Olivier Goffart
c8014a0afd ChunkingNG: Add Test 2016-10-31 15:16:53 +01:00
Olivier Goffart
456d82715e Fix compile after merge 2016-10-31 11:29:33 +01:00
Olivier Goffart
8ca3eb7883 Merge remote-tracking branch 'origin/master' into chunking-ng 2016-10-31 11:09:12 +01:00
Christian Kamm
5f47c01346 Account: Rearrange for readability 2016-10-25 13:20:23 +02:00
Christian Kamm
10644d3568 Move concatUrl and settingsWithGroup to Utility
There was little reason to keep them cluttering Account.
2016-10-25 12:05:28 +02:00
Christian Kamm
9ee3144358 Account: Remove wasMigrated/setMigrated
It was unused since early in the multi-account work:
a932eac832
2016-10-25 11:43:06 +02:00
Christian Kamm
cf48ea2e00 Remove unused functions
Account::changed and AbstractCredentials::changed have not been needed
in a long while.
2016-10-25 11:33:38 +02:00
Christian Kamm
db24f60ae3 License: Adjust license of GPLv2 source files to GPLv2+
See #5180
2016-10-25 11:06:54 +02:00
Christian Kamm
6026148692 FolderMan: Clean up API
Many public slots didn't need to be public or slots.
2016-10-25 09:44:34 +02:00
Christian Kamm
a2222228c9 FolderMan: Document and clean up folder scheduling 2016-10-25 09:44:34 +02:00
Olivier Goffart
e33b89c222 Chunking-NG: Enable if the server supports it 2016-10-21 16:42:27 +02:00
Olivier Goffart
273590fdfc ChunkingNG: Use the 'If' header
As discussed in https://github.com/owncloud/core/pull/26368
2016-10-20 11:16:06 +02:00
Olivier Goffart
0960058842 Merge remote-tracking branch 'origin/master' into chunking-ng 2016-10-20 09:25:03 +02:00
Christian Kamm
69a1e46d0c Progress: Reset lastCompletedItem #5256
Otherwise progress listeners think it's still the last-completed
item when the next sync starts. This lead to spurious entries in
the "Recent Changes" list.
2016-10-18 12:29:52 +02:00
Christian Kamm
e020a5327e Force a remote discovery when upgrading to this version #5242
A remote discovery will fix up any lingering problems caused by #5190.
2016-10-18 11:21:01 +02:00
Christian Kamm
1b04489887 Remove stale commented code
These functions don't even exist anymore.
2016-10-18 11:21:01 +02:00
Olivier Goffart
36a19703db SyncEngine: Permission error in subfolder of a folder that cannnot be added is a SoftError
Issue #5059
2016-10-17 12:22:04 +02:00
Markus Goetz
d600fdc89b OS X: Use monochrome tray icon by default (#5229) 2016-10-14 14:26:31 +02:00
Markus Goetz
8c5ea8dc90 Propagator: Also upload more in parallel (#5230)
Fix for https://github.com/owncloud/client/issues/4986#issuecomment-227071801

This is before we have bundling at some point.
2016-10-14 14:23:55 +02:00
Olivier Goffart
766d9ae1ac QProgressIndicator: update copy from upstream
Update from commit 05ce8a23cdc12e825532dc6de06c267fb8d48b4f from
https://github.com/dragotin/QProgressIndicator
Which itself is forked from commit e5ba0fd09bfd43b067ee3646d70b294c7efcb558 from
upstream, with additional license header.

It was relicensed to MIT according to
14bb9d10e2

Relates to issues #5180 and #5184
2016-10-13 12:05:59 +02:00
Markus Goetz
5000d40619 Fixup previous commit
Thanks @ogoffart for spotting.
2016-10-12 19:10:56 +02:00
Klaas Freitag
16e28567a6 Folderman: Some comments for the checkPathValidityForNewFolder method. 2016-10-12 18:16:53 +02:00
Klaas Freitag
3bef42db6b folderman: checkPathValidityForNewFolder - correct file path comparison
It now checks based on the correct case sensitivity and also using the new
method for filename comparison.
2016-10-12 14:50:10 +02:00
Klaas Freitag
27d23edacc Utility: Add a function to check if two filenames are equal plus test.
It calls canonical path always and works with the correct case preserving
depending on the platform.
2016-10-12 14:48:00 +02:00
Markus Goetz
fc7aaf792b Auto Start: Only set on first account setup, not all later ones 2016-10-11 20:28:14 +02:00
Markus Goetz
f6355e15a3 sqlite: Update bundled version to 3.14.2
For OS X and Windows.
2016-10-11 20:06:43 +02:00
Olivier Goffart
d80d5a8ee4 SyncEngine: Fix renaming a folder should keep the selective sync state
Issue #5224

Two problems:

 - In the discovery phase, we need to check the selective sync entries of
   the source path in case of renames.

 - When the rename is done, we need to actually update the black list in the
   database.
2016-10-11 14:38:25 +02:00
Olivier Goffart
9d3e78ed54 AccountManager: do not load invalid account
Some tests (such as FolderManTest) can polute the config file with invalid
accounts.

(That's because most of the code, (even in libsync) always instentiate a ConfigFile)
2016-10-11 14:27:14 +02:00
Olivier Goffart
b6079bfe4f Remove usused variable 2016-10-11 12:12:28 +02:00
Olivier Goffart
f75106fd8e SyncJournalDB: check the return value of the prepare statements in checkConnect
Relates to #5199
2016-10-11 11:35:26 +02:00
Olivier Goffart
57fe7b800f Theme: Fix compiler warning
Relates #5227
2016-10-11 10:31:47 +02:00
Klaas Freitag
e1a48e3c33 Move the journal file name generation to the syncjournaldb class.
As requested by Olivier.
2016-10-10 16:59:17 +02:00
Olivier Goffart
c2fa9b5bbf AccoutWizard: Change the set policy of a radio button
In an attempt to make sure the button next to it don't get too small.

Issue #5209
2016-10-10 13:27:28 +02:00
Olivier Goffart
86522cbbf0 OwnSQL: avoid crashing in SqlQuery::reset_and_clear_bindings
The crash reporter shows a lot of crashes in sqlite3_clear_bindings
which seems to indicate that _stmt is null. We should guard against
a null value in order to avoid crashing.

This should only happen if the prepare call fails. We don't usually
check the return value of the prepare call, but if _stmt is null, the
exec call should return false, not true. We check the result of the
exec call, so this should then abort the sync with an error, rather
than crashing.
2016-10-10 13:27:12 +02:00
Klaas Freitag
c84140d293 checkPathValidityForNewFolder: Catch sync folders underneath sym links.
plus some whitespace changes.
2016-10-07 16:23:13 +02:00
Christian Kamm
91b6b88883 Tray: Fix crash on startup for non-OSX oses 2016-10-07 13:32:42 +02:00
Tommy Sparber
67ecca492b Improve macOS SysTray/StatusBar monochrome icon (#5227)
- Use a white icon if the context menu is visible.
- Enable `QIcon::setIsMask` if compiled on Qt >= 5.6 to allow automatic
  macOS color handling.
- No changes if the colored icons are used.
2016-10-06 17:18:51 +02:00
Markus Goetz
84c925dc58 503: Also parse other server error message (#5228)
From https://github.com/owncloud/core/pull/26145
2016-10-06 14:45:04 +02:00
Klaas Freitag
838c072ccc Folder Setup: Allow to set up more sync connects to the same folder.
One local folder can now be configured as sync target for multiple
accounts as long as their url and user differ.

Also this patch accepts that the sync folder is behind a symlink.
Also this patch fixes a bug that before the user input was taken
canonically which was not working for the symlink handling.
2016-09-30 14:08:00 +02:00
Klaas Freitag
ed6a708460 SyncJournalDb: Migrate the old csync journal to the new name.
Migration strategy to the new filename.
2016-09-29 16:41:11 +02:00
Christian Kamm
bd2bcad3ba ShareDialog: Remove context help button
Ticket #5203
2016-09-28 13:00:52 +02:00
Christian Kamm
598a7cec5d Merge remote-tracking branch 'origin/2.2' 2016-09-28 12:07:45 +02:00
Markus Goetz
95c479aa07 Wizard: Do the system proxy lookup in a thread (#5160)
This is analogous to the code in ConnectionValidator.
2016-09-26 15:45:30 +02:00
ckamm
035442b6da Improve the "new big folder" UI #5202 (#5204)
Instead of using the regular selective-sync UI (where it's unclear what
the "Cancel" button would even mean in this context), provide a
different set of buttons that allow the user to quickly synchronize
all pending big folders, none of them, or perform manual changes
as usual.
2016-09-23 13:47:57 +02:00
ckamm
98efb07535 Tray: Workaround collection (#5179)
Tray: Workaround collection

* QDBus workaround for Qt 5.5.0 only, there were reports of the tray
  working fine with 5.5.1. #5164
* OWNCLOUD_FORCE_QDBUS_TRAY_WORKAROUND to force the workaround on an off
* OWNCLOUD_TRAY_UPDATE_WHILE_VISIBLE to enable or disable updating of
  the menu while it's visible - disable by default due to problems on OSX and Xubuntu.
* Track the visibility of the tray menu with aboutToShow/aboutToHide
  only on OSX - the aboutToHide signal doesn't trigger reliably on linux
* Refactor such that setupContextMenu is different from updateContextMenu
* Don't use on-demand updating of the tray menu when the qdbus workaround
  is active, instead to occasional (30s) updates of the tray menu.
2016-09-23 10:44:54 +02:00
Olivier Goffart
bc04f79959 Missing Inc -> GmbH (#5181) 2016-09-22 15:32:12 +02:00
Christian Kamm
e10c97573f Warning if mailto url fails #5142 2016-09-22 14:16:58 +02:00
Olivier Goffart
fca5f1b210 owncloudcmd: fix --silent
We ignored csync log, but we also need to silent Qt debug output.
We need to ignore it at the very begining because there might be
qDebug also in account creation.

Issue #5196
2016-09-22 10:32:27 +02:00
Christian Kamm
0cea3d85f5 Add log messages for LockWatcher use #5190 2016-09-22 09:57:42 +02:00
Olivier Goffart
85b8ab178e SyncEngine: Fix renaming of folder when file are changed (#5195)
Two bugs:
 - The change filed are not considered as move, they are re-downloaded
   but the old file was not removed from the database. The change in
   owncloudpropagator.cpp takes care of removing the old entries.

 - Next sync would then remove the file in the server in the old folder
   This was not a problem until we start reusing the sync engine, and
   that the _renamedFolders map is not cleared. We were before deleting
   a non-existing file. But now we delete the actual file.

Also improve the tests to be able to do move on the server.
This include support for file id.

Issue #5192
2016-09-22 09:02:47 +02:00
Piotr Mrówczyński
b7eb37dc03 Merge pull request #5170 from owncloud/add_capabilities_owncloudcmd
add server capabilities to owncloudcmd
2016-09-21 22:28:41 +02:00
Olivier Goffart
98bfa8d5de Propagator: properly send the success flag (#5189)
In case of the root directory, it may happen that the _item
is empty and the _item->_status is NoStatus.  But we still need to report
the proper success or error of the whole propagation. We should really
use _hasError for that. However, _hasError is also defined to NoStatus
if there was no error, so in that case we need to set Success.

This fixes the problem in which the data-fingerprint is not saved on the
database because the SyncEngine think that the sync failed. (Issue #5185)
2016-09-21 16:35:42 +02:00
Olivier Goffart
ff701bd473 ConnectionValidator: properly handle error in status.php (#5188)
We wwer enot connecting to the right signal from the check server
job, and therefore we were not catching the condition in which the
json was invalid. We would then never terminate the ConnectionValidator job.

Note that instanceNotFound is also emited if there is a network error.

The log looked like this:

10:25:51.247 OCC::CheckServerJob::finished: status.php from server is not valid JSON!
10:25:51.248 OCC::CheckServerJob::finished: status.php returns:  QMap()   QNetworkReply::NetworkError(NoError)  Reply:  QNetworkReplyHttpImpl(0x2b6a790)
10:25:51.248 OCC::CheckServerJob::finished: No proper answer on  QUrl("http://localhost/~owncloud/status.php")
10:26:23.235 OCC::AccountState::checkConnectivity: ConnectionValidator already running, ignoring "owncloud@localhost"
10:26:55.235 OCC::AccountState::checkConnectivity: ConnectionValidator already running, ignoring "owncloud@localhost"
[...]
2016-09-20 11:55:43 +02:00
Jocelyn Turcotte
31aaf956f5 Merge pull request #5182 from jturcotte/msvcBuild
Fix the MSVC build
2016-09-20 10:39:14 +02:00
Jocelyn Turcotte
2b274e9460 Fix the MSVC build
- Replace functions that are provided by MinGW with a Win32-based
  implementation
- Explicitly export needed symbols from ocsync.dll
- Rename share.h to sharemanager.h since the name clashes with one
  of the Windows headers and get included from there
- Remove the timestamp from the fallback csync stderr logging, it's
  not used since we always provide a log callback
2016-09-16 17:43:39 +02:00
Olivier Goffart
da26e59770 Chunking-NG: add some headers when uploading chunks
These are not understood by owncloud yet, but were requested for CernBox

OC-Total-Length in the MKCOL: The full lenght of the file
OC-Chunk-Offset in the PUT: The offset within the file in which this chunk belongs
OC-Checksum in the MOVE: The transission checksum
2016-09-16 16:36:46 +02:00
Olivier Goffart
3c24d5a148 Chunking-NG: The MOVE will return the code 204 if the file was already there 2016-09-16 16:20:40 +02:00
Olivier Goffart
c222793525 Chunking-NG: use OC-If-Destination-Match instread of If-Match
For the MOVE command, because If-Match in Webdav relates to the source, not
the destination
2016-09-16 16:15:09 +02:00
Olivier Goffart
28018e8590 Chunking-NG: Fix destination URL 2016-09-16 16:14:53 +02:00
Olivier Goffart
4c79ce2ae6 ConnectionValidator: fetch the account name.
This is needed for the new webdav path used by the new chunking.
The user might not be the same as the one used to connect
2016-09-16 15:49:43 +02:00
Markus Goetz
aa5d3055be Folder/Watcher: Fix up #5174 #5153 (#5186)
It was surprising to have a broken symlink return empty for
canonical path.
2016-09-15 14:56:37 +02:00
Christian Kamm
3e1690ff7a Improvements to file recall 2016-09-14 15:42:19 +02:00
Olivier Goffart
6f1b03c560 SyncEngine: Fix renaming of folder when file are changed (#5195)
Two bugs:
 - The change filed are not considered as move, they are re-downloaded
   but the old file was not removed from the database. The change in
   owncloudpropagator.cpp takes care of removing the old entries.

 - Next sync would then remove the file in the server in the old folder
   This was not a problem until we start reusing the sync engine, and
   that the _renamedFolders map is not cleared. We were before deleting
   a non-existing file. But now we delete the actual file.

Also improve the tests to be able to do move on the server.
This include support for file id.

Issue #5192
(cherry picked from commit 85b8ab178e)
2016-09-22 09:05:09 +02:00
Olivier Goffart
a810d69daa ConnectionValidator: properly handle error in status.php (#5188)
We wwer enot connecting to the right signal from the check server
job, and therefore we were not catching the condition in which the
json was invalid. We would then never terminate the ConnectionValidator job.

Note that instanceNotFound is also emited if there is a network error.

The log looked like this:

10:25:51.247 OCC::CheckServerJob::finished: status.php from server is not valid JSON!
10:25:51.248 OCC::CheckServerJob::finished: status.php returns:  QMap()   QNetworkReply::NetworkError(NoError)  Reply:  QNetworkReplyHttpImpl(0x2b6a790)
10:25:51.248 OCC::CheckServerJob::finished: No proper answer on  QUrl("http://localhost/~owncloud/status.php")
10:26:23.235 OCC::AccountState::checkConnectivity: ConnectionValidator already running, ignoring "owncloud@localhost"
10:26:55.235 OCC::AccountState::checkConnectivity: ConnectionValidator already running, ignoring "owncloud@localhost"
[...]
(cherry picked from commit ff701bd473)
2016-09-21 14:30:36 +02:00
Olivier Goffart
b228488eb7 Revert "FolderWatcher: Act on relative paths #5116 (#5153)"
This is not sufficient as it is not working for the Socket API.
Next commit will fix it in another layer.

Also, not ignoring paths that are not inside the folder is wrong
as it might still happen if the name has a different casing

This reverts commit d5a481f132.

(cherry picked from commit 904cd46f75)
2016-09-15 16:26:25 +02:00
Markus Goetz
b7809ded23 OS X: Try to fix tray menu not updating correctly #5158 (#5177)
I even had this issue long before 2.3 that submenus suddenly disappeared.
Now we refrain from updating while visible.
2016-09-13 14:34:22 +02:00
ckamm
dfb121236c Excludes: Consider files in hidden folders excluded #5163 (#5173)
Previously, we only checked the hiddenness of the target file and
ignored the hiddenness of the containing folders. This lead to
undesired behavior when people synced their home folders and there
was a folder watcher notification for a non-hidden file in one of
the hidden folders.

I'm not fully sure why, but sometimes notifications for .foo/bar were
already ignored, but notifications for .foo/bar/car were not. This may
be because of how we set up the FolderWatchers on Linux.

The new behavior is to check all path components for hiddenness, up
until the base path (but excluding the base path, so using a hidden
folder as a sync folder will work).
2016-09-13 14:14:27 +02:00
Olivier Goffart
c2cb729fee Folder: Cannonicalize the path
This is important because we compare the paths from the file system watcher if it
starts with this path.
Same in the SocketAPI where we need to use cannonical paths in the REGISTER_PATH command,
as the plugin themself will do this comparison.

Issue #5116
2016-09-12 16:56:59 +02:00
Olivier Goffart
904cd46f75 Revert "FolderWatcher: Act on relative paths #5116 (#5153)"
This is not sufficient as it is not working for the Socket API.
Next commit will fix it in another layer.

Also, not ignoring paths that are not inside the folder is wrong
as it might still happen if the name has a different casing

This reverts commit d5a481f132.
2016-09-12 16:05:55 +02:00
Piotr M
7fd00b2cd5 add server capabilities to owncloudcmd 2016-09-12 14:43:40 +02:00
Markus Goetz
907918dca3 FolderWatcher: Act on relative paths #5116 (#5153)
(cherry picked from commit d5a481f132)
2016-09-12 14:09:13 +02:00
Christian Kamm
5ffaf3a90f Set discovery thread priority to low #5017
(cherry picked from commit bd7ec19644)
2016-09-12 14:09:13 +02:00
Olivier Goffart
1040e7b57b ExcludeFiles: Fix when the folder casing is not the same in the settings and in the FS
If the folder has different case in the settings and in the FS, we should
not ignore all the files. This is important for the files system watcher.

(cherry picked from commit 98268d102f)
2016-09-12 14:09:12 +02:00
Olivier Goffart
65c49e1de6 CleanupPollsJob: Fix possible leak
Missing deleteLater when the CleanupPollsJob aborts.
This is only a problem if the SyncEngine is kept alive a long time. Which is
usually not the case in the configuration where poll jobs are used.

(cherry picked from commit 3465024898)
2016-09-12 14:09:12 +02:00
Christian Kamm
4abaee7736 Recall: Copy instead of move recalled file #5150
That was an unintentional change in
2662203fb7

Also expand the test case to cover this.

(cherry picked from commit af9c4d0e2f)
2016-09-12 14:09:12 +02:00
Markus Goetz
3cdcd8dea0 Selective Sync: Fix request loop and show error in view (#5154)
I got into a situation where the model would endlessly request the directory
contents from the server because we did not notice yet that the server
is actually in maintenance mode while we were expanding the tree view when
changing the tab to the account or when just expanding it by clicking.
(cherry picked from commit 524220d090)
2016-09-12 14:09:12 +02:00
Christian Kamm
cb19ebc9e3 ShareLink: Ensure the password line edit is enabled #5117
(cherry picked from commit b541fea793)
2016-09-12 14:09:12 +02:00
Daniel Molkentin
37adaa7872 Update owner to be ownCloud GmbH
Fixes #5079

(cherry picked from commit a83c5598e8)
2016-09-12 14:09:12 +02:00
Markus Goetz
d5a481f132 FolderWatcher: Act on relative paths #5116 (#5153) 2016-09-12 14:03:11 +02:00
Olivier Goffart
1d09f6b60f Allow to disable Shiboleth to build without QtWebkit (#5166) 2016-09-11 16:14:08 +02:00
Olivier Goffart
98268d102f ExcludeFiles: Fix when the folder casing is not the same in the settings and in the FS
If the folder has different case in the settings and in the FS, we should
not ignore all the files. This is important for the files system watcher.
2016-09-11 12:12:10 +02:00
Olivier Goffart
9e895a6ecc FolderStatusModel: Fix beginInsertRow/endInsertRow
We need to do the change between the begin and the end call so the selection
don't get broken
2016-09-11 12:12:10 +02:00
Olivier Goffart
7c75a39bc1 Chunking-NG: Some fixup after feedback from the pull request #5102 2016-09-10 12:30:14 +02:00
Markus Goetz
524220d090 Selective Sync: Fix request loop and show error in view (#5154)
I got into a situation where the model would endlessly request the directory
contents from the server because we did not notice yet that the server
is actually in maintenance mode while we were expanding the tree view when
changing the tab to the account or when just expanding it by clicking.
2016-09-06 11:11:03 +02:00
Christian Kamm
af9c4d0e2f Recall: Copy instead of move recalled file #5150
That was an unintentional change in
2662203fb7

Also expand the test case to cover this.
2016-09-06 10:42:59 +02:00
Klaas Freitag
c97d8aa8fd Show the rename target in the client log file. (#5149) 2016-09-05 13:26:49 +02:00
Klaas Freitag
f0dc3b2deb FolderWatcher: Also ignore the new sync journal file name format. 2016-09-02 16:19:10 +02:00
Klaas Freitag
84ede3f01f Make sync journal name generating a method of SyncJournal.
Before it was in Folder, however, the command line client does not
have the Folder class. To not duplicate code, the function to generate
the sync journal name went to SyncEngine class.
2016-09-02 16:19:10 +02:00
Klaas Freitag
3b651b2da9 folderman: Clean some comments 2016-09-02 16:19:04 +02:00
Klaas Freitag
e46fad52bb Make the sync journal file name a method of the Folder class.
The sync journal name has a dependency on the remote url now.
2016-09-02 12:29:21 +02:00
Olivier Goffart
c41f6ed76b Chunking-NG: use new dav URL for the move 2016-08-31 12:12:34 +02:00
Olivier Goffart
818b5854ce Chunking-NG: Qt4 compile 2016-08-31 10:28:44 +02:00
Olivier Goffart
79abb8b4e3 ChunkingNg: enable depending on an environment variable 2016-08-31 10:28:15 +02:00
Olivier Goffart
fad387b6b8 Chunking-Ng: Resume 2016-08-31 10:28:15 +02:00
Olivier Goffart
a1558100b8 WIP: new chunking algorithm
Current limitations of this WiP
 - No resuming implemented yet
 - No parallel chunks
 - Hackish way to get the webdav paths
2016-08-31 10:28:15 +02:00
Olivier Goffart
4f3f642da6 Upload: refactor the upload in two classes so the new chuning can be implemented 2016-08-31 10:28:15 +02:00
Olivier Goffart
86eab48981 Qt4 Compile 2016-08-31 10:27:20 +02:00
Olivier Goffart
d2bde5489f Propagator, remove the QNAM in the name as the alternative has been removed a long time ago 2016-08-31 10:25:06 +02:00
Christian Kamm
39e93768ea Account wizard: Enable back button consistently #5107
Tested with http auth and shib auth.
2016-08-26 13:12:25 +02:00
Christian Kamm
c1eb9244d1 Shibboleth: Fix detection in account wizard #5138
Following redirections generally
(bb5c2cbfa5) meant that the special
shib-redirection detection code was no longer being used.
2016-08-26 12:58:06 +02:00
Markus Goetz
6ecda6e7f4 Merge branch '2.2' 2016-08-24 11:39:12 +02:00
Jocelyn Turcotte
2ff7b63551 Merge pull request #5122 from jturcotte/syncfilestatustrackerTests 2016-08-17 16:04:02 +02:00
Christian Kamm
b541fea793 ShareLink: Ensure the password line edit is enabled #5117 2016-08-17 15:48:25 +02:00
Jocelyn Turcotte
efb6b8c2c9 [overlays] Fix folders appearing as OK even though children are still syncing #4797
This would happen if the directory would first need to be created
through an mkdir propagation job. This job's itemCompleted signal
would trigger the directory to show as SYNC even though its children
are still propagating.

Fix the issue by tracking the sync count for each file, affecting
its parents. This allows us to get rid of the O(n) vector lookup
for each status query, and properly track the hierachical sync
status of a directory.

This also removes the itemCompleted signal emission from the
PropagateDirectory job. Since we only needed for overlay icons, and
since this job doesn't do any direct propagation, we can remove it
to ensure that we won't call itemCompleted twice for the item attached
to Propagate*Mkdir jobs (since the PropagateDirectory is backed by
the same SyncFileItem, instruction and status).
2016-08-17 15:40:02 +02:00
Jocelyn Turcotte
e974771796 csync: Use an explicit instruction for should_update_metadata
The current way of tracking the need to update the metadata without
propagation using a separate flag makes it difficult to track
priorities between the local and remote tree. The logic is also
difficult to logically cover since the possibilities matrix isn't
100% covered, leaving the flag only used in a few situations
(mostly involving folders, but not only).

The reason we need to change this is to be able to track the sync
state of files for overlay icons. The instruction alone can't be
used since CSYNC_INSTRUCTION_SYNC is used for folders even though
they won't be propagated. Removing this logic is however not possible
without using something else than CSYNC_INSTRUCTION_NONE since too
many codepath interpret (rightfully) this as meaning "nothing to do".

This patch adds a new CSYNC_INSTRUCTION_UPDATE_METADATA instruction
to let the update and reconcile steps tell the SyncEngine to update
the metadata of a file without any propagation. Other flags are left
to be interpretted by the implementation as implicitly needing
metadata update or not, as this was already the case for most file
propagation jobs. For example, CSYNC_INSTRUCTION_NEW for directories
now also implicitly update the metadata.

Since it's not impossible for folders to emit CSYNC_INSTRUCTION_SYNC
or CSYNC_INSTRUCTION_CONFLICT, the corresponding code paths in the
sync engine have been removed.

Since the reconcile step can now know if the local tree needs metadata
update while the remote side might want propagation, the
localMetadataUpdate logic in SyncEngine::treewalkFile now simply use
a CSYNC_INSTRUCTION_UPDATE_METADATA for the local side, which is now
implemented as a different database query.
2016-08-17 15:39:31 +02:00
Jocelyn Turcotte
82ef1bcfe0 Make sure that we invalidate parents on blacklisted items
Add a missing call that we currently only do in slotItemCompleted.
This would normally only affect the first sync and would have
gotten properly update at the end of the sync anyway.
2016-08-17 15:39:30 +02:00
Jocelyn Turcotte
b7ff4a76e8 Add TestSyncEngine and TestSyncFileStatusTracker auto tests
To be able to test the SyncEngine efficiently, a set of server
mocking classes have been implemented on top of QNetworkAccessManager.

The local disk side hasn't been mocked since this would require adding
a large abstraction layer in csync. The SyncEngine is instead pointed
to a different temporary dir in each test and we test by interacting
with files in this directory instead.

The FakeFolder object wraps the SyncEngine with those abstractions
and allow controlling the local files, and the fake remote state
through the FileModifier interface, using a FileInfo tree structure
for the remote-side implementation as well as feeding and comparing
the states on both side in tests.

Tests run fast and require no setup to be run, but each server feature
that we want to test on the client side needs to be implemented in
this fake objects library. For example, the OC-FileId header isn't
set as of this commit, and we can't test the file move logic properly
without implementing it first.

The TestSyncFileStatusTracker tests already contain a few QEXPECT_FAIL
for what I esteem being issues that need to be fixed in order to catch
up on our test coverage without making this patch too huge.
2016-08-17 15:39:30 +02:00
ckamm
88cd5421bf Tray menu: Update only on demand #4990 #4985 (#5072)
The tray menu is now only updated when it becomes visible or while
it is visible.
2016-08-15 13:42:56 +02:00
ckamm
7b26e6b8f9 Progress: Don't display unlikely estimates #5046 (#5066) 2016-08-15 13:36:53 +02:00
Daniel Molkentin
bb5c2cbfa5 Always follow redirects in network jobs (#4905)
This is a move away from the original policy where jobs
would only follow redirects in special cases.

Two restrictions are in place:

1. We do not allow protocol downgrades (https -> http)
2. We stop redirects after we find them looping (e.g. old = new url, or
indirectly when looping 10 times).

This is closer to RFC conforming behavior, although currently
we will treat 301 replies like they were 302. This is for a separate
commit.

Error handling (and display) also needs improvement.

Addresses #2791
2016-08-09 16:01:29 +02:00
Markus Goetz
fc868d89f3 Merge pull request #5108 from owncloud/limit_library_path
Limit Qt and OpenSSL Library pathes to the install directory
2016-08-05 16:39:04 +02:00
Daniel Molkentin
5a57e4a7a6 Ensure OpenSSL config file is only read from app dir 2016-08-05 16:38:08 +02:00
Olivier Goffart
4a7f3cb486 SyncEngine: Fix detection of backup (#5104)
Once upon a time, the SyncEngine was instantiated once per sync. But now that
the SyncEngine is kept between sync, we need to reset all these variable between
syncs.
2016-08-04 16:06:10 +02:00
Jocelyn Turcotte
b307f2b65c Revert "Fix a deadlock when shutting down during discovery" (#5100)
Reverts commit 622017adcf

Could be the cause of #5092 and the cost is higher than the benefit if this is the case.
A network request taking more than 30 seconds isn't something unlikely in this world
and shouldn't be a good reason to abort. We should try to untangle the threads
dependencies to properly fix this if possible instead.
2016-08-03 16:35:24 +02:00
Olivier Goffart
73a6939b70 ownsql: handle QByteArray without converting to QString (#5097)
QByteArray is used for checksum
2016-08-02 11:39:08 +02:00
Olivier Goffart
88e5a9411a SyncEngine: Reads the data-fingerprint property (#5056)
When it changes, assume a backup was recovered, and keep conflict files.

Issues: #2325 and https://github.com/owncloud/enterprise/issues/966
2016-08-02 10:30:49 +02:00
Klaas Freitag
5ac434a740 Logs: Add the name of the platform we're running on to the log. (#5082) 2016-07-28 16:30:40 +02:00
Daniel Molkentin
a83c5598e8 Update owner to be ownCloud GmbH
Fixes #5079
2016-07-26 16:48:08 +02:00
Klaas Freitag
ebcec44202 ShibbolethView: Open a debug windows that shows cipher info. (#5080)
It opens a window and connects to a cipher test
page, showing the output from there, that helps for debugging.

The window is enabled by setting the environment variable
OWNCLOUD_SHIBBOLETH_DEBUG
2016-07-25 17:47:23 +02:00
Christian Kamm
39bde6f3e4 Revert "Add 'open in browser' to account menu #4824"
This reverts commit 3c575a2f37.

One can already open the account in the browser by clicking the
link in the settings dialog!
2016-07-19 11:19:40 +02:00
Olivier Goffart
3465024898 CleanupPollsJob: Fix possible leak
Missing deleteLater when the CleanupPollsJob aborts.
This is only a problem if the SyncEngine is kept alive a long time. Which is
usually not the case in the configuration where poll jobs are used.
2016-07-14 09:23:22 +02:00
Olivier Goffart
7c671756e6 Merge remote-tracking branch 'origin/2.2'
Conflicts:
	src/libsync/syncfilestatustracker.cpp
2016-07-12 17:38:15 +02:00
Olivier Goffart
f3f387c36b Merge pull request #5016 from owncloud/overrideurl
AccountManager: Don't force the server URL while loading the config.
2016-07-12 14:33:28 +02:00
Olivier Goffart
b53ce78eb6 Merge pull request #5025 from ArthurChiao/bugfix_#5015
fix #5015 overlay icon not show: compare folder paths with no case-se…
2016-07-12 14:32:54 +02:00
ckamm
bc4753e938 Sharing: Fix bug with file names containing percent encodes #5042 (#5043) 2016-07-12 14:25:33 +02:00
Olivier Goffart
cb64ba22b3 Fix Qt4 build 2016-07-11 12:27:59 +02:00
Klaas Freitag
0884ad6517 owncloudcmd: Adopt to new syncJournalDb MD5 based name schema. 2016-07-10 13:05:09 +02:00
Klaas Freitag
37fc4e4332 SyncJournalDb: Cleanup of Constructor interface.
The parameter path is not longer needed.
2016-07-10 13:04:29 +02:00
Klaas Freitag
9cc90159f1 FolderMan: ensureJournalGone needs to know the exact journal name, WIP 2016-07-10 12:57:35 +02:00
Klaas Freitag
4ceee86c66 SyncEngine: Calculate a uniq journal name using the remote account.
That should allow to sync the same local folder to multiple remote destinations.

see #3764
2016-07-10 12:56:43 +02:00
Klaas Freitag
3033e693be Folder: For wipe reuse the journal name from SyncEngine.
Do not compute on its own any more.
2016-07-10 12:52:47 +02:00
Klaas Freitag
a1bc01d3b1 SyncJournalDb: Add a method to set the name of the db file. 2016-07-10 12:51:42 +02:00
arthurchiao
3335c733d7 be case insensitive for MacOSX, too 2016-07-08 15:53:11 +08:00
arthurchiao
4da55b69df ignore case-sensitivity only on windows 2016-07-08 15:12:37 +08:00
Christian Kamm
699d1ba13b owncloudcmd: Make source_dir absolute #5035
Fixes a problem with relative paths on Windows.
2016-07-05 15:40:32 +02:00
Christian Kamm
3c575a2f37 Add 'open in browser' to account menu #4824 2016-07-05 14:48:51 +02:00
Christian Kamm
bd7ec19644 Set discovery thread priority to low #5017 2016-07-05 13:53:57 +02:00
Daniel Molkentin
8a1a2eb5b3 Only accept notification API Capability if endpoint is OCS-enabled
Fixes #5033
2016-07-04 18:33:02 +02:00
arthurchiao
7a2a439426 fix #5015 overlay icon not show: compare folder paths with no case-sensitivity 2016-07-01 13:03:42 +08:00
Olivier Goffart
dff57362f9 AccountManager: Don't force the server URL while loading the config.
While loading the account, only override the server url if Theme::forceConfigAuthType
is set. This restore the behavior from the client 2.1 for theme that did not
use Theme::forceConfigAuthType.

Issue: owncloud/enterprise#1418
2016-06-28 14:32:03 +02:00
Olivier Goffart
3f3a679f81 Fix the URL from previous commit
The pull request was merged too early and did not contain the URL change

(Issue #4877)
2016-06-28 14:17:16 +02:00
Olivier Goffart
cde9017340 GUI: Show link to the page that allow to add a new token (#4963)
If owncloud >= 9.1 is detected:
and add a link to the ownCloud page that allow to add device token.

Issue #4877
2016-06-28 12:25:04 +02:00
Jocelyn Turcotte
446e7cbd93 Fix a QAction leak (#5008)
Attach the accout menu QAction to the menu rather than the
ownCloudGui since it should be destroyed when the context
menu is cleared.
2016-06-27 16:22:51 +02:00
ckamm
b4d26ba952 Fix windows HiDPI #4994 (#4998)
This was removed in 0194ebb222
because it breaks on Linux. However, it looks like it is correct
for Windows. In the meantime the surrounding ifdef has changed
from !Q_OS_MAC to Q_OS_WIN, so reverting it makes sense.
2016-06-27 16:17:58 +02:00
Jocelyn Turcotte
622017adcf Fix a deadlock when shutting down during discovery (#4993)
Since the SyncEngine now quits and waits for the discovery thread,
the main thread can enter a deadlock where the discovery thread waits
for its directory result.

Add a 2 seconds timer to the discovery thread wait condition
to limit the deadlock time.
2016-06-27 16:12:39 +02:00
ckamm
86fd982b00 SocketAPI: Use different pipe name #4977 (#4997)
Named pipe names that contain backslashes sometimes lead to problems.
2016-06-27 15:13:08 +02:00
ckamm
bdb304f8ec Share: Permissions for federated shares on servers >=9.1 #4996 (#5001)
This disables the workaround 487e1fdca5ee04fc98c1ed77898df70d740967c8
for servers that are new enough to support fine grained permissions
on federated shares.

The consequence is that the 'reshare' permission is now granted by
default and that users can edit permissions on the usual fine-grained
level again.

The way the client deals with servers <9.1 is unchanged.
2016-06-27 11:09:51 +02:00
Christian Kamm
440a804836 Tray: Add minimal mode as workaround and testing tool #4985 #4990 2016-06-23 10:22:43 +02:00
Christian Kamm
7601783553 Fix Qt4 build 2016-06-22 15:47:33 +02:00
Christian Kamm
6e9df8673f Merge remote-tracking branch 'origin/2.2' 2016-06-22 15:41:37 +02:00
Christian Kamm
c0b0bd5b63 owncloudcmd: Fix --exclude regression
It's ok if the system exclude file is missing when --exclude is
specified explicitly.
2016-06-22 15:30:20 +02:00
Jocelyn Turcotte
5d71ad83ec Fix the Qt4 build
QSharedPointer::reset doesn't exist in Qt4.
2016-06-21 12:04:26 +02:00
Markus Goetz
ab24980001 Merge pull request #4979 from jturcotte/2.2
Memory improvements during propagation
2016-06-21 10:00:41 +02:00
ckamm
07dea72c37 Setup csync logging earlier (#4991)
We were missing some csync related log output during startup.

Discovered in #4967
2016-06-21 09:58:53 +02:00
ckamm
43a2aec92b Performance: Don't redundantly add the same exclude files #4967 (#4988)
Excludes: Don't redundantly add the same exclude files #4967, Never accept duplicate exclude patterns #4967
2016-06-20 15:14:13 +02:00
ckamm
681243277e Share dialog: Add 'Mail link' button #3261 (#4961) 2016-06-20 13:06:57 +02:00
Jocelyn Turcotte
edfd75949d Reduce the memory usage of the StopWatch during propagation
Use a QMap to avoid using a full hashtable for only a few entries, and
clear the QMap once we're done with the measuring. This saves a few
hundred bytes per job during propagation that would otherwise only be
freed at the end of the sync.
2016-06-17 19:20:53 +02:00
Jocelyn Turcotte
7fb134b4e0 Delete the ComputeChecksum object when the job is finished
Each object takes almost 1k and we don't need it once the propagation is
done.
2016-06-17 19:20:53 +02:00
Jocelyn Turcotte
87e3553c85 Prevent the sync protocol widget from over-using memory
During propagation, we create a line for each file, taking memory, but
we delete all lines passed 2000 right at the beginning of the next sync.
Since the user has little chances of being able to read past those 2000
lines in the log, we might as well keep it capped at 2000 also during
propagation to prevent it from eating memory.
2016-06-17 19:20:53 +02:00
Jocelyn Turcotte
6f3aaecb78 Fix a crash on if shutting down during propagation
The SyncRunFileLog owned by the Folder must be destroyed after the
SyncEngine since the SyncEngine will abort during destruction, resulting
in all jobs being aborted.

It's possible that this crash only happens with a debug build.
2016-06-17 19:20:52 +02:00
Jocelyn Turcotte
3342ebfcc5 SocketAPI: Push new status of dirty files regardless when not synced (#4970)
The FolderWatcher inserts files to be marked as SYNC and we
currently assume that all file statuses will be updated by the
following sync. It's however possible that the FolderWatcher
notify us of a change that csync won't consider necessary to
propagate, in which case a new status wouldn't be pushed and
the file manager would continue showing this file as syncing.

Re-push the file status when emptying the dirty files list
before propagating to avoid this issue, most likely the OK
status.
2016-06-16 15:27:10 +02:00
Olivier Goffart
b4900d60b7 Checksum speedup. (#4968)
No need to allocate (and initialize to 0) a 10 MiB buffer for each files, even
when most files are much smaller than that.
So make sure the buffer that we allocate is not bigger than the file size.
And Also 10 MiB is a bit big for a buffer. 500 KiB should be more than enough.
(Too big allocations can cause problem because of memory fragmentation and such)
2016-06-16 08:28:30 +02:00
Olivier Goffart
92309013da SyncEngine: make abort and closing more robust
We first need to set the abort flag to csync and then aborting the discovery
job, otherwise, the discovery thread could start a new job in the mean time.

We also need to make sure that the thread has existed before we destroy the
exclude list.
2016-06-16 08:26:33 +02:00
Jocelyn Turcotte
cb50fae0a7 SocketAPI: Move the normalization closer to the data entrance (#4972)
Follow-up for #4884
2016-06-15 21:03:21 +02:00
Jocelyn Turcotte
05d199881e Merge pull request #4971 from owncloud/fixAccountHandleSslErrorsCrash
Attempt to fix the Account::slotHandleSslErrors crash
2016-06-15 18:53:47 +02:00
Jocelyn Turcotte
147cf798a6 Attempt to fix the Account::slotHandleSslErrors crash
Events from the crash reporter suggest that the QNAM and its
child replies might get deleted before returning from this method
and the only possible cause we can see is that the inner event
loop has something to do with it.

Try keeping a ref on the QNAM while in this method to make sure
that it won't get deleted by the inner event loop.
2016-06-15 18:12:02 +02:00
Jocelyn Turcotte
d40c56eda5 Account: Use smart pointers to hold its credentials and QNAM objects
Also make sure that both use QObject::deleteLater as their delete
function.
2016-06-15 18:12:01 +02:00
Olivier Goffart
6dade0b114 PropagateUpload: fix crash in PUTFileJob::slotTimeout
Same fix as in commit 60c101d9

From the crash reporter:

Crash
EXCEPTION_ACCESS_VIOLATION_READ at 0x4
qnetworkreply.cpp in QNetworkReply::request at line 476
propagateupload.cpp in OCC::PUTFileJob::slotTimeout at line 100
moc_abstractnetworkjob.cpp in OCC::AbstractNetworkJob::qt_static_metacall at line 98
qobject.cpp in QMetaObject::activate at line 3716
moc_qtimer.cpp in QTimer::timeout at line 192
qtimer.cpp in QTimer::timerEvent at line 247
qobject.cpp in QObject::event at line 1267
qapplication.cpp in QApplicationPrivate::notify_helper at line 3722
qapplication.cpp in QApplication::notify at line 3505
qcoreapplication.cpp in QCoreApplication::notifyInternal at line 932
2016-06-15 14:32:25 +02:00
Christian Kamm
d655074f85 Log: Include start of propagation and lap duration 2016-06-09 14:28:15 +02:00
Christian Kamm
85a173e174 Log: Write the sync log during propagation #3108
...instead of when done with the sync. This way we get information
even if the client crashes.
2016-06-09 14:10:47 +02:00
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
Jürgen Weigert
ebc44fa494 Update accountsettings.cpp 2016-06-07 14:21:50 +02:00
ckamm
355a8a0a27 Workaround for Ubuntu 16.04 tray issue #4944 (#4947) 2016-06-07 11:48:25 +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
Olivier Goffart
b99c8fe28b Folder: fix removing folder with escaped characters (#4943)
FolderDefinition::save and load escapes the alias. We also need to escape
it when we remove it.
New folder can't be created with alias that needs escaping, but old folder
from old config may still exist, and we must allow user to delete them.
2016-06-03 13:10:01 +02:00
Olivier Goffart
5a3120bd52 Folder: Ignore change from the watcher if the file has not changed its mtime or size (#4942)
For issue #4927:
On Windows 10, we get a notification after the sync is finished for file that were
just downloaded. The guard we have against our "own changes" are only working when
the sync is running and the OwncloudPropagator still alive.
2016-06-03 13:06:11 +02:00
Markus Goetz
51f8a59a9a OS X: White-list the folder watcher enums
I got syncs triggered for even opening a file by double clicking it in Finder
and having launched Preview.app (e.g. for JPEG files).
2016-06-02 18:20:07 +02:00
Olivier Goffart
6ccd9e872d GUI: don't force the environment variable for high DPI on linux.
Setting the Environment variable only for owncloud makes in inconsistant with
other Qt application running at the same time.

The users can still set it themself for the whole desktop if they wish.

Addresses #4840
2016-06-02 17:57:10 +02:00
Daniel Molkentin
1787da8a9d Fix memleak in updater 2016-06-02 15:03:52 +02:00
Markus Goetz
de82d8fcdb QNAM: Try to workaround missing Qt patches #4720 #3888 #4051
We try this on all platforms now so we have more consistent behaviour.
2016-05-31 10:26:52 +02:00
Stephen Colebrook
af2b712dc6 Search results are filtered by server. Don't filter a second time.
Also allows searching on attributes other than displayname in ldap
configurations. Search results match web and mobile apps.
2016-05-31 09:46:52 +02:00
Stephen Colebrook
d4b72132d6 Search results are filtered by server. Don't filter a second time. Also allows searching on attributes other than displayname in ldap configurations. Search results match web and mobile apps. (#4902) 2016-05-31 09:45:38 +02:00
Markus Goetz
a507558dee Connectivity: Reduce ETag job timeout to 60 sec #4275
Before it used the default job timeout
2016-05-31 09:35:47 +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
0194ebb222 Don't try to determine pixel ratio with Qt < 5.6.0
This seems to be broken. Worst case users can still
set it manually

Addresses #4840
2016-05-30 08:27:57 +02:00
Matthew Leeds
7f0cc5b699 Fix typo in folder.cpp 2016-05-27 11:13:18 -04: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
Markus Goetz
75efa8b252 sqlite: Update bundled version to 3.13.0
For OS X and Windows.
2016-05-24 17:27:31 +02:00
Daniel Molkentin
c041ca6163 Fix pot. mem leak found by coverity (CID 96004) 2016-05-24 11:21:33 +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
Christian Kamm
a1ba23eea9 Activity: When a new notification arrives, switch to that tab #4805 2016-05-19 14:13:07 +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
010649f997 FolderWizard: remove dead code and fix the alias
Remove a bunch of dead code.

And also set the root folder name properly since alias is gone.

Fix the warning:
QWizard::field: No such field 'alias'
2016-05-18 10:52:22 +02:00
Olivier Goffart
cf1fe690a3 Shibboleth: Show the inspector if OWNCLOUD_SHIBBOLETH_DEBUG is set
Help to debug https://github.com/owncloud/enterprise/issues/1265
2016-05-17 12:29:20 +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
Christian Kamm
0f9c32452c Protocol: Increase width of timestamp column #4721
Since the font metrics aren't reliable on windows, we add some
extra space there.
2016-05-12 10:24:34 +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
e58739de00 [osx] Fix missing overlay icons on client startup
Since the statuses are cached and that we can't invalidate the cache,
sending NOP would need to be overwritten by the default OK status
once the client successfully connected. But instead of remembering
which files we NOPed, rather wait until we are ready to sync before
sending the REGISTER_PATH message to the socket API client. It will
also prevent the client from sending unnecessary RETRIEVE_FILE_STATUS
requests.

Also remove AccountState::canSync, since it does the same as
isConnected and syncing is not an account responsibility.
2016-05-03 13:01:51 +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
Daniel Molkentin
e833d01288 Re-Apply: Disambiguate socket API pathes on Windows with user name
Addresses #3411
2016-05-02 16:09:48 +02:00
Olivier Goffart
3047682223 ShareDialog: show the error message in red
Do the visual stuff from designer.
The previous code that was ment to change the color in red did not work
and changed it to gray instead.
Also I don't see why there should be a frame.

Issue #4773
2016-05-02 14:12:04 +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
Roeland Douma
31c13f74fb Add spinner during sharee search (#4764)
Fixed #4740

When searching for sharees we should display a loading spinner.
2016-04-29 14:11:27 +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
Markus Goetz
29932004ae Shibboleth: Load username from config for UI (#4751)
For https://github.com/owncloud/enterprise/issues/1034
2016-04-28 14:55:29 +02:00
Daniel Molkentin
b43a9421d2 Revert "Disambiguate socket API pathes on Windows with user name" 2016-04-28 13:52:15 +02:00
Klaas Freitag
e70b78d14b Merge pull request #4738 from owncloud/fix_3411
Disambiguate socket API pathes on Windows with user name
2016-04-28 13:46:10 +02:00
Christian Kamm
a36b4ec863 FolderWizard: Sort remote folders #4612 2016-04-28 09:29:07 +02:00
Christian Kamm
074f8eadb1 Selective sync: Sort folders in FolderStatusModel #4612 2016-04-28 09:29:07 +02:00
Christian Kamm
af5f2d3860 Protocol: Make timestamp column width fit the text #4721 2016-04-28 07:37:42 +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
f7082ee3df sqlite: Update to version 3.12.2
For OS X and Windows
2016-04-27 12:22:12 +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
Olivier Goffart
d0af3ede05 AccountSettings: context menu: don't rely on the alias
Don't rely on the alias to know weather we shuld show a context menu or not.
Use the classify function to know if it's a root folder instead
2016-04-27 11:21:58 +02:00
Olivier Goffart
0da2adcbe0 Workaround ubuntu 16.04 systemtray bug (#4693) (#4747) 2016-04-27 11:21:13 +02:00
Christian Kamm
0829a94c92 Remote folder selection: improve path typing #4745 #4746
* Scroll to the target typed path
* Show non-404 errors that were triggered by typing paths
2016-04-27 10:37:17 +02:00
Markus Goetz
4ea2edcf4a Merge pull request #4741 from owncloud/fix-alias
Accountsettings: Generate an alias for new folders
2016-04-26 17:34:10 +02:00
Olivier Goffart
cd29875b76 Folder: Generate an alias for new folders
Before commit 1a51b6718a, the wizard was
making sure folder had an alias but this is no longer the case.
So generate still an unique alias.

Alias is not used in the UI any longer, it's just use for internal purposes.

For issue #4737
2016-04-26 16:53:24 +02:00
Markus Goetz
ce5ca8a42e UI: Fix account name/alias display oddities #4577 2016-04-26 16:47:47 +02:00
Daniel Molkentin
ce6a365328 Disambiguate socket API pathes on Windows with user name
Addresses #3411
2016-04-26 14:49:45 +02:00
Christian Kamm
09eea7f5f2 Checksums: Use the first supported type if nothing is preferred 2016-04-26 13:10:53 +02:00
Christian Kamm
12bf6e39b7 Share link: Consistent order of options owncloud/core#24122
(cherry picked from commit 8dc178a9f3)
2016-04-26 10:44:29 +02:00
Olivier Goffart
4e7c09de83 QTokenizer: fix Qt4 build
QSharedPointer::reset is new in Qt5
2016-04-26 10:38:20 +02:00
Roeland Jago Douma
d3a93322d2
Only 1 : between namespace and property 2016-04-22 14:38:43 +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
7a82fac0d5 owncloudcmd: Save the selective sync list on the first run
For issue #4690

In the first run, the journal might not exist, we should not cancel
setting the selective sync list
2016-04-21 12:58:10 +02:00
Daniel Molkentin
8b39c6e6ce Merge pull request #4709 from owncloud/fix_4691
Use QTokenizer to properly parse netrc
2016-04-21 12:50:43 +02:00
Daniel Molkentin
e29d7e0128 Use QTokenizer to properly parse netrc
Addresses #4691
2016-04-21 12:46:03 +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
b56919d0c4 SocketAPI: Return NOP state if folder is diconnected or paused.
Later, we can send a specific state for that.
2016-04-20 17:14:12 +02:00
Markus Goetz
f9fb7a59dd Merge pull request #4708 from owncloud/aliasGui
UI: Remove alias from more places #4577 #4695
2016-04-20 15:54:05 +02:00
Markus Goetz
1a51b6718a UI: Remove alias from more places #4577 #4695 2016-04-20 14:27:50 +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
edb942ba61 Merge pull request #4696 from owncloud/issue4573_negative_content_length
Discovery: Be more explicit about files with unknown size #4573
2016-04-19 16:09:48 +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
Roeland Jago Douma
598941948c
Use expireDate if returned by the OCS Share API
If an app modifies the expiration date (for example the password policy
app) then on more recent versions of the server we will get the share
object back REST style. We should use that info!

Fixes #4409
2016-04-19 11:22:32 +02:00
Roeland Douma
9f30e83413 Merge pull request #4687 from owncloud/fix_share-permissions-namespace
The share-permissions namespace was moved
2016-04-18 21:29:26 +02:00
Klaas Freitag
2ab4caf007 ProtocolWidget: Display the recalculated number of issues.
Should fix #3222
2016-04-18 16:48:37 +02:00
Klaas Freitag
11d3aa3c4f Protocolwidget: Removed some leftovers from refactoring. 2016-04-18 16:47:14 +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
Markus Goetz
06c19b0b6f sqlite: Update to version 3.12.1
For OS X and Windows.
2016-04-15 12:02:00 +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
Klaas Freitag
4ad8e04bc3 Merge pull request #4684 from owncloud/less_socket_api_updates
Less socket api updates
2016-04-15 10:15:07 +02:00
Roeland Jago Douma
74301e4373
The share-permissions namespace was moved
See https://github.com/owncloud/core/pull/24017

This was done since other services we want to intergrate with don't use
the ownCloud namespace.
2016-04-15 10:14:05 +02:00
Klaas Freitag
8007331462 SocketAPI: Remove unneeded logging. 2016-04-14 15:39:46 +02:00
Klaas Freitag
12330b38e9 Folderman: Remove one call to updateFolderView.
The reason is that updateFolderView is invoked by the
emitted signal folderSyncStateChange() anyway.

This will reduce the traffic over the SocketAPI nicely,
maybe this was the reason why it was slower than before.
2016-04-14 15:26:11 +02:00
Christian Kamm
dfd7d4d2f9 Activity tab visibility fixes #4651 2016-04-14 11:35:16 +02:00
Christian Kamm
484a2c800d Fix typo 2016-04-14 10:59:40 +02:00
Christian Kamm
8d300b049f ShareDialog: Tell a user early if resharing is impossible #4679 2016-04-14 10:16:37 +02:00
ckamm
48e594ebbf Merge pull request #4673 from ckamm/shareperm
Disable unavailable sharing permissions #4383
2016-04-14 09:44:58 +02:00
Christian Kamm
910c61b492 Disable unavailable sharing permissions #4383
Users can't reshare with more permissions than they have themselves.
2016-04-14 09:44:37 +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
ed3203d25d Merge pull request #4659 from owncloud/fix_client_4651
Fix client #4651
2016-04-13 12:02:45 +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
f443377978 Merge pull request #4664 from ckamm/hiddenfiles
Fix hidden file handling #4655
2016-04-12 17:14:47 +02:00
Olivier Goffart
fdcdddca16 CMakeLists: move QtKeychain detection in client 2016-04-12 14:43:26 +02:00
Klaas Freitag
bf99306a53 Merge branch 'do_not_close_db_on_done' 2016-04-12 14:36:46 +02:00
Christian Kamm
6f454feb39 Fix hidden file handling #4655
There were two issues:

* With the refactoring of how Folder and SyncEngine relate, the
  ignore_hidden_files flag on the CSync context was reset after
  each sync run and not updated from the configuration again.

* The folder watcher failed to enumerate hidden folders and thus
  didn't watch for changes inside them. (linux only)
2016-04-12 11:59:07 +02:00
Olivier Goffart
68b7437afb Merge pull request #4658 from owncloud/fix-qt4-build
Fix qt4 build
2016-04-12 10:36:48 +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
c48b5c4f61 ActivityWidget: use a QHash for _widgetsToRemove
The problem with QSet is that the QDateTime was part of
the hash, but that does not make sens as it should be unique
per widget and not per <date, widget>

Instead make it a QHash so there is only one entry per widget.
2016-04-11 15:49:24 +02:00
Olivier Goffart
976f4dfabe ActivityWidget: Fix Qt4 build
Don't use API added in Qt5
2016-04-11 15:49:24 +02:00
Olivier Goffart
f8dc263338 CMakeLists: fix Qt4 build
Only the src subdirectory needs Qt.
Otherwise it activates Qt4 also for the dolphin plugin which always need Qt5
2016-04-11 15:49:18 +02:00
Klaas Freitag
e896d16f32 ActivityWidget: Make sure Notification are visible if Activity disabled
This is the fix for #4651
2016-04-11 15:39:25 +02:00
Klaas Freitag
2ec642aadb ActivityWidget: Properly set widget for the Scrollview.
Also fixed some SizePolicy settings.
2016-04-11 15:38:25 +02:00
Olivier Goffart
bd3a079a7b Merge pull request #4648 from owncloud/handle-database-errors
Handle setFileRecord errors #4632
2016-04-11 15:36:46 +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
ckamm
4ce97633cd Merge pull request #4630 from ckamm/folderwatchwin
Graceful termination of folderwatcher_win #4620
2016-04-09 06:55:30 +02:00
Klaas Freitag
8f7b833c12 Not Synced Tab: Use tr rather than string concat 2016-04-07 09:18:51 +02:00
Klaas Freitag
48bfcde97d Merge pull request #4640 from owncloud/numberInProtocolTab
ProtocolWidget: Show number of non synced files in tab label.
2016-04-07 09:15:06 +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
058cd33324 Not Synced: Display only the number of not synced items in parathesis.
This was Jans wish.
2016-04-06 17:53:42 +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
4e17dabcb6 Folder: Fixed a couple of plural translation issues. 2016-04-06 12:22:29 +02:00
Klaas Freitag
9bdc84c6f4 NotificationJobs: Set ocs header to maintain the session.
This is needed by the server.
2016-04-05 16:52:51 +02:00
Klaas Freitag
252aea25da ProgressDispatcher: Improve wording about conflicts. 2016-04-05 16:38:18 +02:00
Klaas Freitag
efb0faa14e Folder: After sync, fire up tray notification if conflicts happened.
If there were conflicts, users want to have a tray notification that warn
about.
This will help for #3222
2016-04-05 16:37:54 +02:00