123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- //
- // NCTrash.swift
- // Nextcloud
- //
- // Created by Marino Faggiana on 02/10/2018.
- // Copyright © 2018 Marino Faggiana. All rights reserved.
- //
- import Foundation
-
- class NCTrash: UIViewController {
-
- @IBOutlet fileprivate weak var collectionView: UICollectionView!
-
- let appDelegate = UIApplication.shared.delegate as! AppDelegate
- var path = ""
- var itemHeight: CGFloat = 180
-
- override func viewDidLoad() {
- super.viewDidLoad()
-
- }
-
- override func viewWillAppear(_ animated: Bool) {
- super.viewWillAppear(animated)
-
- if path == "" {
- let userID = (appDelegate.activeUserID as NSString).addingPercentEncoding(withAllowedCharacters: NSCharacterSet.urlFragmentAllowed)
- path = k_dav + "/trashbin/" + userID! + "/trash/"
- }
-
- let ocNetworking = OCnetworking.init(delegate: self, metadataNet: nil, withUser: appDelegate.activeUser, withUserID: appDelegate.activeUserID, withPassword: appDelegate.activePassword, withUrl: appDelegate.activeUrl)
-
- ocNetworking?.listingTrash(appDelegate.activeUrl, path:path, account: appDelegate.activeAccount, success: { (item) in
-
- NCManageDatabase.sharedInstance.deleteTrash(filePath: self.path)
- _ = NCManageDatabase.sharedInstance.addTrashs(item as! [tableTrash])
-
- }, failure: { (message, errorCode) in
-
- print("error " + message!)
- })
- }
- }
|