Commit Graph

111 Commits

Author SHA1 Message Date
Dimitri Papadopoulos 9d830e94f9 Fix typos found by codespell
Signed-off-by: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com>
2023-06-21 08:47:13 +02:00
Matthieu Gallien 5372276779 add more metadata to sync errors to allow filtering
in order to be able to filter some errors when showing them into the
main dialog activity list, add some more info about the error to know
the origin (like a network issue or a sync issue)

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2023-06-07 17:25:44 +02:00
Matthieu Gallien 079d392d36
move init to default value in class declaration
done via clang-tidy and manual tuning

run-clang-tidy -p build -header-filter='.*' -config="{Checks: '*', CheckOptions: [{key: UseAssignment, value: true}]}" -checks='-*,modernize-use-default-member-init' -fix

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2023-02-06 10:43:05 +01:00
Matthieu Gallien 76e88572d6
more fixes for attributes without init value
done with clang-tidy

run-clang-tidy -p build -header-filter='.*' -config="{Checks: '*', CheckOptions: [{key: UseAssignment, value: true}]}" -checks='-*,cppcoreguidelines-pro-type-member-init' -fix

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2023-02-06 10:43:05 +01:00
Matthieu Gallien 61c792c6f4
fully qualify types in signals and slots
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2022-11-15 09:57:54 +01:00
Matthieu Gallien 565a5f0999 add [[nodiscard]] attribute via clang-tidy
ran
run-clang-tidy-14.py -header-filter='.*' -checks='-*,modernize-use-nodiscard' -fix
under linux with most part of our code covered

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2022-10-04 11:14:45 +02:00
Matthieu Gallien 802c7ac906 make AbstractNetworkJob::errorString virtual: it is already overriden
in practice AbstractNetworkJob::errorString is already overriden but the
overrided code is probably never called while the intention looked like
the opposite

fix that by making the method virtual in base class

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2021-11-24 16:17:47 +01:00
Matthieu Gallien 25669938fd let clang-tidy add missing override after enabling again the check
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2021-08-31 08:35:56 +00:00
Hannah von Reth d16befd1fd Align MkColJob finish signal with the other jobs 2021-08-23 09:40:27 +02:00
allexzander eb80f54dcf E2EE Fix incorrect name of a nested encrypted item in the Settings dialog when the root folder is non-encrypted and it is renamed.
Signed-off-by: allexzander <blackslayer4@gmail.com>
2021-01-25 10:35:54 +02:00
allexzander 483a874cb6 Fix folder upload issue due to wrong Lock/Unlock order
Signed-off-by: allexzander <blackslayer4@gmail.com>
2021-01-25 10:35:30 +02:00
allexzander 79fe231acc Fix E2EE root folder rename issue.
Signed-off-by: allexzander <blackslayer4@gmail.com>
2021-01-25 10:35:30 +02:00
Kevin Ottens c57eff6fd8
Please the clang-tidy overlord
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 11:01:53 +01:00
Hannah von Reth aaca3e7ce5
Use separate loggin category for upload v1 and ng 2020-12-15 10:59:12 +01:00
Christian Kamm 69fa1e4775
UploadDevice: Fix windows issues #7264
- Close the UploadDevice to close the QFile after the PUT job is done.
  This allows winvfs to get an oplock on the file later.

- Don't rely on QFile::fileName() to be valid after
  openAndSeekFileSharedRead() was called. The way it is openend on
  Windows makes it have an empty filename.
2020-12-15 10:58:52 +01:00
Christian Kamm 452ed56571
Upload: Read file chunks gradually #7226
Instead of all at once, to reduce peak memory use.

Changing UploadDevice in this way requires keeping the file open for the
duration of the upload. It also means changes to open(), seek(), close()
to ensure that uses of the device work right when a request needs to
be resent.
2020-12-15 10:58:51 +01:00
Olivier Goffart 46bf3ed31a
Upload: asynchronious operations
Implements https://github.com/owncloud/core/pull/31851
2020-12-15 10:58:44 +01:00
Christian Kamm 4c04351360
Fix warnings about signedness
Sizes are always qint64, not unsigned.
TransferIds are always uint.
2020-12-15 10:58:41 +01:00
Christian Kamm e10e953c66
PropagateUpload: Avoid crash due to cascading aborts
https://sentry.io/owncloud/desktop-win-and-mac/issues/698694072/activity/
2020-12-15 10:58:11 +01:00
Kevin Ottens 80cc196f6f Enable bugprone-narrowing-conversions clang-tidy check
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-09-01 06:37:03 +00:00
Kevin Ottens 27b982ceaf Override parallelism() for uploads
This way we'll be able to control parallelism for upload jobs.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-01 17:11:57 +00:00
Kevin Ottens 5e20e2b46f Move PropagateUpload ctor impl to the cpp file
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-01 17:11:57 +00:00
Christoph Wurst c2e3cbca31
Fix memory leak with device pointer
Downstream of https://github.com/owncloud/client/pull/6856

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2019-05-08 19:41:48 +02:00
J-P Nurmi 1af9bf8abc libsync: run clang-tidy modernize-use-nullptr 2018-11-12 18:46:39 +01:00
J-P Nurmi 0d1c15a768 libsync: run clang-tidy modernize-use-override 2018-11-12 18:43:58 +01:00
J-P Nurmi 48acaec66f libsync: search'n'replace "Q_DECL_OVERRIDE" with "override" 2018-11-12 18:39:50 +01:00
Christian Kamm 5f793c151c
Upload: Adjust timeout for final job based on size #6527
Some servers have virus scanners and the like that can delay the
response of the final chunked upload assembly significantly, often
breaking the current 5min (!) timeout. See owncloud/enterprise#2480
for details.
2018-06-07 09:38:16 +02:00
Christian Kamm d9640dd79e
PropagateUpload: Fix miscount in abort() #6516
Previously it tried to abort even jobs that had already finished, which
was not going to work as they wouldn't emit finished() again.

Also, in some cases the abortCount would never go to zero and that case
wasn't well documented.
2018-06-07 08:53:12 +02:00
Christian Kamm 96126a53d3
PropagateUpload: Remove unused PropagateUploadFileCommon::abort 2018-06-07 08:53:10 +02:00
Markus Goetz 367d0c39e8
Logging: Avoid the word "Error"
The old code printed "QNetworkReply::NoError"
2018-06-06 20:24:32 +02:00
Olivier Goffart 073a5184cb
Use std::chrono::milliseconds to represent milliseconds 2018-06-06 17:26:53 +02:00
Christian Kamm a2675b559b
Upload: Simplify 'finished' flag
* Sometimes there was 'finished' and '_finished'
* Make each done() call automatically set _finished to true
2018-05-16 20:57:26 +02:00
Tomaz Canabrava d24a1e542e Merge branch 'master' into clientSideEncryptionV3 2018-01-29 14:06:12 +01:00
Olivier Goffart b8539eb329 Get rid of the StopWatch in the PropagateUpload job
For issue #6318

The StopWatch is using memory, and we are not really using it.
2018-01-19 13:37:48 +01:00
Tomaz Canabrava 06c34ed617 [CSE] Assorted fixes
- Unlock the folder even on error
- Use the correct name of the file for upload
2017-12-24 16:30:39 +01:00
Tomaz Canabrava b72113a53d [CSE] Prepare the beginning of the upload.
I still need to send the metadata.
2017-12-21 00:35:23 +01:00
Tomaz Canabrava 7be5f0a736 [CSE] Update the finished signal 2017-12-20 23:36:49 +01:00
Tomaz Canabrava aa36cc4a5c [CSE] Reduce probability of conflicts when rebasing
Creates a new file/class to handle upload,
propagateuploadencrypted.h/cpp. This should have all the logic to deal
with the encryption and upload.
2017-12-17 22:38:43 +01:00
Tomaz Canabrava e6f835d138 [CSE] Unlock the folder after a lock
This makes sure the folder will be unlocked for next tests
2017-12-12 11:26:54 +01:00
Tomaz Canabrava a08a32ceca [CSE] Fetch the metadata for the upload. 2017-12-08 10:32:05 +01:00
Tomaz Canabrava 6745777ca3 [CSE] Save folder id and token for the lock
So we can unlock it later. - perhaps we should store this
on the disk or something, to make it harder to lose.
2017-12-08 10:19:56 +01:00
Tomaz Canabrava 70d562668c [CSE] Add handling for side-by-side uploads. 2017-12-07 21:51:42 +01:00
Tomaz Canabrava ccd8cff4db [CSE] Try to lock repeteadly the folder if needed.
The upload is made in an event loop with more than one
upload at the same time, this confuses the hell out of the
folder locking mechanism.

We need to lock the folder and ask the other trials to try
again in a few seconds in the future to give time for the
uploader to actually upload the current file that's locking
the folder.
2017-12-07 21:31:20 +01:00
Tomaz Canabrava 9f678652f8 [CSE] Lock the folder to upload a file. 2017-12-07 20:52:54 +01:00
Tomaz Canabrava 76916b6c48 [CSE] Request the Folder ID. 2017-12-07 19:39:30 +01:00
Tomaz Canabrava 6f35cbff6b [CSE] Fetch the Folder information for encryption status 2017-12-04 22:27:13 +01:00
Tomaz Canabrava 387737d908 [CSE] Start to create the upload logic. 2017-12-04 21:33:43 +01:00
Tomaz Canabrava a64bd6059b [uploadImprovements] fix struct hole 2017-11-28 22:22:37 +01:00
Tomaz Canabrava a623b14209 [uploadImprovements] use the new struct info in PropagateUploadV1
Add a new member for the UploadFileInfo in PropagateUploadCommon
to hold the full file path - as it can change if we use a temporary
file to upload.

Adapt propagateuploadv1 to use the new calls.
2017-11-28 22:17:29 +01:00
Tomaz Canabrava f609336bfc Split file to upload from the file on disk
They can be conceptually equal - I can upload the file
on disk, and that's what I do right now. But if we want
to accept filters in the future, filters that change
the file on disk like shrinking an image, the current
information used is wrong and we need a way to separate those.

This patch introduces a new struct that holds the *actual*
file that will be uploaded, be it a temporary one or
the original file.
2017-11-28 21:28:06 +01:00