Commit graph

662 commits

Author SHA1 Message Date
Claudio Cambra
1e9dbf8f14 Operate directly on NSMutableData for incoming socket data, do not work with raw buffers
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-07-24 12:12:29 +02:00
Claudio Cambra
4954debfbe Use more informative NSAssert rather than assert for _registeredDirectories
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-07-24 12:12:29 +02:00
Claudio Cambra
49a9f7f263 Allocate new unsigned char buffer for processed line in heap, fixing crash
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-07-24 12:12:29 +02:00
Claudio Cambra
8fa463b109 Do not GENERATE_INFOPLIST_FILE for FinderSyncExt
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-07-24 12:12:29 +02:00
Claudio Cambra
fe3104c2a8 Correctly initialise internal data members for FinderSync
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-07-24 12:12:29 +02:00
Claudio Cambra
736e65934c Define FinderSync internal data members as private interface extension
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-07-24 12:12:29 +02:00
Claudio Cambra
e0da34d36c Use modern dot notation to access _inBuffer properties
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-07-24 12:12:29 +02:00
Claudio Cambra
535402a866 Add quotes to processed line in FinderSyncExt to easily demarcate received line start and end
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-07-24 12:12:29 +02:00
Claudio Cambra
a0088dcd11 Fix parsing of in buffer lines in FinderSyncExt
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-07-24 12:12:29 +02:00
Claudio Cambra
2acec8f4a0 Clean up FinderSyncExt processInBuffer
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-07-24 12:12:29 +02:00
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
Claudio Cambra
60e785ad4e Fix xcodebuild parallel build warning
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-06-14 09:07:29 +02:00
Claudio Cambra
c316ecca91 Simplify variables for propery build paths for FP
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-06-06 22:12:07 +08:00
Claudio Cambra
7937986bc6 Fix Debug builds of File Provider module
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-06-06 22:12:07 +08:00
Claudio Cambra
b7d9826877
Build macOS shell extensions with debug configuration in xcodebuild when CMAKE build type set to debug
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 16:02:39 +08:00
Claudio Cambra
ace8dbc833
Add support for thumbnails in FileProviderExtension
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 16:02:39 +08:00
Claudio Cambra
7d47e2371b
Add convenience method to get thumbnailUrl in NextcloudItemMetadataTable
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 16:02:39 +08:00
Claudio Cambra
486c1a2556
Split local file related metadata management into own extension in NextcloudFilesDatabaseManager
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 16:02:39 +08:00
Claudio Cambra
4cb1e08d89
Split directory item metadata handling in database to new NextcloudFilesDatabaseManager extension
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 16:02:39 +08:00
Claudio Cambra
2b55b43e7b
Correctly report child item count for folders in FileProviderItem
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 16:02:39 +08:00
Claudio Cambra
16a28a7ccb
Add convenience method for NextcloudFilesDatabaseManager to get child items of a directory
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 16:02:39 +08:00
Claudio Cambra
0c78630703
Fix query of childDirectoriesForDirectory in NextcloudFilesDatabaseManager
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 16:02:38 +08:00
Claudio Cambra
6797e12f6e
Properly report modification date for FileProviderItem
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 16:02:38 +08:00
Claudio Cambra
e245ec0d2a
Set interpolated log strings in FileProvider logs to public
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 16:02:38 +08:00
Claudio Cambra
7e1ebed8c7
Split client interfacing code into FileProviderExtension extension
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 16:02:38 +08:00
Claudio Cambra
ebf96e3e81
Make NKError extension code more Swift-like, clean up
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 16:02:38 +08:00
Claudio Cambra
0f578fabdd
Use specific signalEnumerator method in FileProviderExtension item renaming instead of reinventing wheel
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 16:02:38 +08:00
Claudio Cambra
a7344ba3fd
Fix unused/unmodified variable definition warnings in FileProviderEnumerator
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 16:02:37 +08:00
Claudio Cambra
67daae2626
Ensure we return deleted metadata directory copy rather than live fire realm object in recursive delete of NextcloudFilesDatabaseManager
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 16:02:37 +08:00
Claudio Cambra
766ecf410f
Parallelise conversion of NKFiles to NextcloudItemMetadataTables
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 16:02:37 +08:00
Claudio Cambra
7550ed7a1b
Properly handle metadata delete after item deletion in FileProviderExtension
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 16:02:37 +08:00
Claudio Cambra
c088f0eb81
Fix recursive metadata delete in NextcloudFilesDatabaseManager
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 16:02:37 +08:00
Claudio Cambra
2853b88258
Move NKFile to metadata conversion methods to a new extension for NextcloudItemMetadataTable, where they are better placed
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 16:02:37 +08:00
Claudio Cambra
6169594864
Prevent multi-thread modification of the same array with serial array modification dispatch queue when enumerating items in FileProviderEnumerator
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 16:02:37 +08:00
Claudio Cambra
9c1a035e3c
Reintegrate sync engine into FileProviderEnumerator class
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 16:02:37 +08:00
Claudio Cambra
bd50f753fa
Simplify initial item enumeration, no need to fetch from database in FileProviderEnumerator
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 16:02:37 +08:00
Claudio Cambra
fe7ca12d9c
Perform slow metadata to FileProviderItem conversion concurrently in FileProviderEnumerator
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 16:02:36 +08:00
Claudio Cambra
808f976ae9
Fix children serverurl rename in file provider nc files database
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 16:02:36 +08:00
Claudio Cambra
384093cbc6
Remove redundant double read of serverUrl when often we always want to do a depth 1 read in NextcloudSyncEngine
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 16:02:36 +08:00
Claudio Cambra
27a177ab35
Make sure to include new metadatas in folders to scan for changes in recursive scan of NextcloudSyncEngine
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 16:02:36 +08:00
Claudio Cambra
34a43fea69
Make sure to notify when folder moved in FileProviderExtension
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:29:57 +08:00
Claudio Cambra
9fadc89ff0
Fix unsetting of etags on directories (and only) directories on update
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:29:57 +08:00
Claudio Cambra
02e1d6a47f
Fix recursive directory metadata renaming order
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:29:57 +08:00
Claudio Cambra
9cc05457c0
Do not do specific enumeration of items working set in FileProviderEnumerator
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:29:57 +08:00
Claudio Cambra
289f7f2c9f
Ensure we do not set etag if we have set updateDirectoryEtags to false in NextcloudFilesDatabaseManager updateItemMetadatas
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:29:57 +08:00
Claudio Cambra
35570a3160
Move remote sync functionality out of enumerator and into separate NextcloudSyncEngine class
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:29:56 +08:00
Claudio Cambra
1524fc01f0
Progressively enumerate items as we get them for working set
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:29:56 +08:00
Claudio Cambra
5154a57ac6
Move conversion from NSData to NSFileProviderPage to separate func
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:29:56 +08:00
Claudio Cambra
6202f3d70a
Split metadata parsing to complete enumerator into own function
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:29:56 +08:00
Claudio Cambra
8c729fb2f9
Simplify enumerateItems of working set by using fullRecursiveScan in FileProviderEnumerator
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:29:56 +08:00