marinofaggiana 4 жил өмнө
parent
commit
99360cdafe

+ 1 - 1
Cartfile

@@ -11,7 +11,7 @@ github "weichsel/ZIPFoundation" "0.9.10"
 github "rechsteiner/Parchment" "v2.4.0"
 github "WenchaoD/FSCalendar" "2.8.0"
 github "huri000/SwiftEntryKit" "1.2.3"
-github "scenee/FloatingPanel"
+github "scenee/FloatingPanel" "v1.7.5"
 github "ivanbruel/MarkdownKit"
 github "getsentry/sentry-cocoa"
 github "FabrizioBrancati/Queuer"

+ 3 - 3
Cartfile.resolved

@@ -1,13 +1,13 @@
 github "Alamofire/Alamofire" "5.2.2"
 github "AssistoLab/DropDown" "v2.3.13"
-github "CocoaLumberjack/CocoaLumberjack" "3.6.2"
+github "CocoaLumberjack/CocoaLumberjack" "3.7.0"
 github "FabrizioBrancati/Queuer" "2.1.1"
 github "SVGKit/SVGKit" "58543f3714b34ea66cfe58636d86dcbec3514ccf"
 github "SwiftyJSON/SwiftyJSON" "5.0.0"
 github "WeTransfer/WeScan" "1.2.0"
 github "WenchaoD/FSCalendar" "2.8.0"
 github "dzenbot/DZNEmptyDataSet" "v1.8.1"
-github "getsentry/sentry-cocoa" "5.2.2"
+github "getsentry/sentry-cocoa" "6.0.0"
 github "huri000/QuickLayout" "3.0.0"
 github "huri000/SwiftEntryKit" "1.2.3"
 github "ivanbruel/MarkdownKit" "1.6"
@@ -19,7 +19,7 @@ github "marinofaggiana/OpenSSL" "6c7cf839d9c74e5a0b92bbf343e1a33b6f56a277"
 github "marinofaggiana/TOPasscodeViewController" "0.0.7"
 github "nextcloud/ios-communication-library" "3d434708ca2fca17576d77a41660025c8e89d2b4"
 github "rechsteiner/Parchment" "v2.4.0"
-github "scenee/FloatingPanel" "v1.7.6"
+github "scenee/FloatingPanel" "v1.7.5"
 github "tilltue/TLPhotoPicker" "2.0.12"
 github "weichsel/ZIPFoundation" "0.9.10"
 github "xmartlabs/XLForm" "4.1.0"

+ 12 - 2
Carthage/Checkouts/CocoaLumberjack/CHANGELOG.md

@@ -1,8 +1,18 @@
-## [3.7.0 - Xcode 12 on ???, 2020](https://github.com/CocoaLumberjack/CocoaLumberjack/releases/tag/3.7.0)
+## [3.7.1 - Xcode 12 on ???, 2020](https://github.com/CocoaLumberjack/CocoaLumberjack/releases/tag/3.7.0)
 
 ### Public
 
-- _PLEASE REPLACE WITH FIRST ENTRY_
+- _TBD_
+
+## [3.7.0 - Xcode 12 on Oct 2nd, 2020](https://github.com/CocoaLumberjack/CocoaLumberjack/releases/tag/3.7.0)
+
+### Public
+
+- **Breaking change**: Dropped support for iOS 8 (#1153)
+- Update SPM tools-version to 5.3 to enable Swift 5.3 support (#1148)
+- Add backend for swift-log (#1164)
+- Specify CocoaPods version to ensure `swift_version` attribute works (#1167)
+- Simplify `DDLogFileManager` callbacks for archived log files (#1166)
 
 ## [3.6.2 - Xcode 11.6 on July 31st, 2020](https://github.com/CocoaLumberjack/CocoaLumberjack/releases/tag/3.6.2)
 

+ 6 - 6
Carthage/Checkouts/CocoaLumberjack/CocoaLumberjack.podspec

@@ -1,9 +1,9 @@
 Pod::Spec.new do |s|
 
   s.name     = 'CocoaLumberjack'
-  s.version  = '3.6.2'
+  s.version  = '3.7.0'
   s.license  = 'BSD'
-  s.summary  = 'A fast & simple, yet powerful & flexible logging framework for Mac and iOS.'
+  s.summary  = 'A fast & simple, yet powerful & flexible logging framework for macOS, iOS, tvOS and watchOS.'
   s.homepage = 'https://github.com/CocoaLumberjack/CocoaLumberjack'
   s.author   = { 'Robbie Hanson' => 'robbiehanson@deusty.com' }
   s.source   = { :git => 'https://github.com/CocoaLumberjack/CocoaLumberjack.git',
@@ -14,14 +14,15 @@ Pod::Spec.new do |s|
                   'such as multi-threading, grand central dispatch (if available), lockless '      \
                   'atomic operations, and the dynamic nature of the objective-c runtime.'
 
-  s.requires_arc   = true
-
   s.preserve_paths = 'README.md'
 
-  s.ios.deployment_target     = '8.0'
+  s.ios.deployment_target     = '9.0'
   s.osx.deployment_target     = '10.10'
   s.watchos.deployment_target = '3.0'
   s.tvos.deployment_target    = '9.0'
+
+  s.cocoapods_version = '>= 1.4.0'
+  s.requires_arc   = true
   s.swift_version = '5.0'
 
   s.default_subspecs = 'Core'
@@ -35,5 +36,4 @@ Pod::Spec.new do |s|
     ss.dependency 'CocoaLumberjack/Core'
     ss.source_files        = 'Sources/CocoaLumberjackSwift/**/*.swift', 'Sources/CocoaLumberjackSwiftSupport/include/**/*.{h}'
   end
-
 end

+ 5 - 20
Carthage/Checkouts/CocoaLumberjack/Demos/LogFileCompressor/CompressingLogFileManager.m

@@ -146,28 +146,13 @@
     [self performSelector:@selector(compressNextLogFile) withObject:nil afterDelay:delay];
 }
 
-- (void)didArchiveLogFile:(NSString *)logFilePath
-{
-    NSLogVerbose(@"CompressingLogFileManager: didArchiveLogFile: %@", [logFilePath lastPathComponent]);
-    
-    // If all other log files have been compressed,
-    // then we can get started right away.
-    // Otherwise we should just wait for the current compression process to finish.
-    
-    if (upToDate)
-    {
-        [self compressLogFile:[DDLogFileInfo logFileWithPath:logFilePath]];
-    }
-}
+- (void)didArchiveLogFile:(NSString *)logFilePath wasRolled:(BOOL)wasRolled {
+    NSLogVerbose(@"CompressingLogFileManager: didArchiveLogFile: %@ wasRolled: %@",
+                 [logFilePath lastPathComponent], (wasRolled ? @"YES" : @"NO"));
 
-- (void)didRollAndArchiveLogFile:(NSString *)logFilePath
-{
-    NSLogVerbose(@"CompressingLogFileManager: didRollAndArchiveLogFile: %@", [logFilePath lastPathComponent]);
-    
-    // If all other log files have been compressed,
-    // then we can get started right away.
+    // If all other log files have been compressed, then we can get started right away.
     // Otherwise we should just wait for the current compression process to finish.
-    
+
     if (upToDate)
     {
         [self compressLogFile:[DDLogFileInfo logFileWithPath:logFilePath]];

+ 0 - 1
iOSClient/CCGlobal.h

@@ -329,7 +329,6 @@
 #define k_notificationCenter_richdocumentGrabFocus      @"richdocumentGrabFocus"
 #define k_notificationCenter_reloadDataNCShare          @"reloadDataNCShare"
 #define k_notificationCenter_reloadDataSource           @"reloadDataSource"                 // userInfo: ocId?, serverUrl?
-#define k_notificationCenter_reloadMediaDataSource      @"reloadMediaDataSource"
 #define k_notificationCenter_mediaFileNotFound          @"mediaFileNotFound"                // userInfo: metadata
 #define k_notificationCenter_changeStatusFolderE2EE     @"changeStatusFolderE2EE"           // userInfo: serverUrl
 

+ 1 - 9
iOSClient/Media/NCMedia.swift

@@ -55,9 +55,7 @@ class NCMedia: UIViewController, DZNEmptyDataSetSource, DZNEmptyDataSetDelegate,
     private var lastContentOffsetY: CGFloat = 0
     private var mediaPath = ""
     private var livePhoto: Bool = false
-    
-    private var listOcIdReadFileForMedia: [String] = []
-    
+        
     struct cacheImages {
         static var cellLivePhotoImage = UIImage()
         static var cellPlayImage = UIImage()
@@ -71,7 +69,6 @@ class NCMedia: UIViewController, DZNEmptyDataSetSource, DZNEmptyDataSetDelegate,
 
         appDelegate.activeMedia = self
         
-        NotificationCenter.default.addObserver(self, selector: #selector(reloadDataSource), name: NSNotification.Name(rawValue: k_notificationCenter_reloadMediaDataSource), object: nil)
         NotificationCenter.default.addObserver(self, selector: #selector(applicationWillEnterForeground), name: NSNotification.Name(rawValue: k_notificationCenter_applicationWillEnterForeground), object: nil)
     }
     
@@ -543,10 +540,6 @@ extension NCMedia: UICollectionViewDataSource {
         if indexPath.row < self.metadatas.count {
             let metadata = self.metadatas[indexPath.row]
             NCOperationQueue.shared.downloadThumbnail(metadata: metadata, urlBase: self.appDelegate.urlBase, view: self.collectionView as Any, indexPath: indexPath)
-            if !listOcIdReadFileForMedia.contains(metadata.ocId) {
-                NCOperationQueue.shared.readFileForMedia(metadata: metadata)
-                listOcIdReadFileForMedia.append(metadata.ocId)
-            }
         }
     }
     
@@ -554,7 +547,6 @@ extension NCMedia: UICollectionViewDataSource {
         if !collectionView.indexPathsForVisibleItems.contains(indexPath) && indexPath.row < metadatas.count {
             let metadata = metadatas[indexPath.row]
             NCOperationQueue.shared.cancelDownloadThumbnail(metadata: metadata)
-            NCOperationQueue.shared.cancelReadFileForMedia(metadata: metadata)
         }
     }
 

+ 0 - 97
iOSClient/Networking/NCOperationQueue.swift

@@ -37,7 +37,6 @@ import NCCommunication
     private let copyMoveQueue = Queuer(name: "copyMoveQueue", maxConcurrentOperationCount: 1, qualityOfService: .default)
     private let synchronizationQueue = Queuer(name: "synchronizationQueue", maxConcurrentOperationCount: 1, qualityOfService: .default)
     private let downloadThumbnailQueue = Queuer(name: "downloadThumbnailQueue", maxConcurrentOperationCount: 10, qualityOfService: .default)
-    private let readFileForMediaQueue = Queuer(name: "readFileForMediaQueue", maxConcurrentOperationCount: 10, qualityOfService: .default)
    
     private var timerReadFileForMediaQueue: Timer?
 
@@ -47,7 +46,6 @@ import NCCommunication
         copyMoveCancelAll()
         synchronizationCancelAll()
         downloadThumbnailCancelAll()
-        readFileForMediaCancelAll()
     }
     
     // Download file
@@ -139,39 +137,6 @@ import NCCommunication
     @objc func downloadThumbnailCancelAll() {
         downloadThumbnailQueue.cancelAll()
     }
-    
-    // Get file information
-    
-    @objc func readFileForMedia(metadata: tableMetadata) {
-        for operation in readFileForMediaQueue.operations as! [NCOperationReadFileForMediaQueue] {
-            if operation.metadata.ocId == metadata.ocId {
-                return
-            }
-        }
-        readFileForMediaQueue.addOperation(NCOperationReadFileForMediaQueue.init(metadata: metadata))
-    }
-    
-    func cancelReadFileForMedia(metadata: tableMetadata) {
-        for operation in  readFileForMediaQueue.operations as! [NCOperationReadFileForMediaQueue] {
-            if operation.metadata.ocId == metadata.ocId {
-                operation.cancel()
-            }
-        }
-    }
-    
-    @objc func readFileForMediaCancelAll() {
-        readFileForMediaQueue.cancelAll()
-    }
-    
-    @objc func notificationReloadDataSourceMedia() {
-        NotificationCenter.default.postOnMainThread(name: k_notificationCenter_reloadMediaDataSource)
-    }
-    
-    func reloadDataSourceMedia() {
-        if !(timerReadFileForMediaQueue?.isValid ?? false) {
-            timerReadFileForMediaQueue = Timer.scheduledTimer(timeInterval: 1.0, target: self, selector: #selector(notificationReloadDataSourceMedia), userInfo: nil, repeats: false)
-        }
-    }
 }
 
 //MARK: -
@@ -411,65 +376,3 @@ class NCOperationDownloadThumbnail: ConcurrentOperation {
         }
     }
 }
-
-//MARK: -
-
-class NCOperationReadFileForMediaQueue: ConcurrentOperation {
-   
-    var metadata: tableMetadata
-    
-    init(metadata: tableMetadata) {
-        self.metadata = tableMetadata.init(value: metadata)
-    }
-    
-    override func start() {
-
-        if isCancelled {
-            self.finish()
-        } else {
-            let serverUrlFileName = metadata.serverUrl + "/" + metadata.fileName
-            let requestBody =
-            """
-            <?xml version=\"1.0\" encoding=\"UTF-8\"?>
-            <d:propfind xmlns:d=\"DAV:\" xmlns:oc=\"http://owncloud.org/ns\" xmlns:nc=\"http://nextcloud.org/ns\">
-            <d:prop>
-                <has-preview xmlns=\"http://nextcloud.org/ns\"/>
-                <creation_time xmlns=\"http://nextcloud.org/ns\"/>
-                <upload_time xmlns=\"http://nextcloud.org/ns\"/>
-            </d:prop>
-            </d:propfind>
-            """
-            
-            NCCommunication.shared.readFileOrFolder(serverUrlFileName: serverUrlFileName, depth: "0", requestBody: requestBody.data(using: .utf8)) { (account, files, responseData, errorCode, errorDescription) in
-                if errorCode == 0 && files.count > 0 {
-                    let file = files[0]
-                    let metadata = tableMetadata.init(value: self.metadata)
-                    var modify = false
-                    if metadata.hasPreview != file.hasPreview {
-                        metadata.hasPreview = file.hasPreview
-                        modify = true
-                    }
-                    if file.creationDate != nil && metadata.creationDate != file.creationDate {
-                        metadata.creationDate = file.creationDate!
-                        modify = true
-                    }
-                    if file.uploadDate != nil && metadata.uploadDate != file.uploadDate {
-                        metadata.uploadDate = file.uploadDate!
-                        modify = true
-                    }
-                    if modify {
-                        NCManageDatabase.sharedInstance.addMetadata(metadata)
-                        NCOperationQueue.shared.reloadDataSourceMedia()
-                    }
-                } else if errorCode == 404 {
-                    NCManageDatabase.sharedInstance.deleteMetadata(predicate: NSPredicate(format: "ocId == %@", self.metadata.ocId))
-                    NotificationCenter.default.postOnMainThread(name: k_notificationCenter_mediaFileNotFound, userInfo: ["metadata": self.metadata])
-                }
-                self.finish()
-            }
-        }
-    }
-}
-
-
-