Skip to content

Commit

Permalink
- SDK updated.
Browse files Browse the repository at this point in the history
- Added code removed while rebasing against.
  • Loading branch information
pablocarmu committed Nov 30, 2018
1 parent af94881 commit 7edde84
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
7 changes: 6 additions & 1 deletion ownCloud/Client/Actions/MoreViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ import ownCloudSDK

class MoreViewController: UIViewController {

private var item: OCItem
private var core: OCCore

private var headerView: UIView
private var viewController: UIViewController

Expand All @@ -32,7 +35,9 @@ class MoreViewController: UIViewController {
}
}

init(header: UIView, viewController: UIViewController) {
init(item: OCItem, core: OCCore, header: UIView, viewController: UIViewController) {
self.item = item
self.core = core
self.headerView = header
self.viewController = viewController

Expand Down
20 changes: 15 additions & 5 deletions ownCloud/Client/ClientQueryViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,20 @@ class ClientQueryViewController: UITableViewController, Themeable {
// MARK: - Search
var searchController: UISearchController?

func upload(itemURL: URL, name: String, completionHandler: ClientActionCompletionHandler? = nil) {
if let progress = core.importFileNamed(name, at: query.rootItem, from: itemURL, isSecurityScoped: false, options: nil, placeholderCompletionHandler: nil, resultHandler: { [weak self](error, _ core, _ item, _) in
if error != nil {
Log.debug("Error uploading \(Log.mask(name)) file to \(Log.mask(self?.query.rootItem.path))")
completionHandler?(false)
} else {
Log.debug("Success uploading \(Log.mask(name)) file to \(Log.mask(self?.query.rootItem.path))")
completionHandler?(true)
}
}) {
self.progressSummarizer?.startTracking(progress: progress)
}
}

// MARK: - Navigation Bar Actions
@objc func uploadsBarButtonPressed(_ sender: UIBarButtonItem) {

Expand Down Expand Up @@ -717,11 +731,7 @@ extension ClientQueryViewController: UITableViewDropDelegate {

}

<<<<<<< HEAD
if let progress = self.core.move(item, to: destinationItem, withName: item.name, options: nil, resultHandler: { (error, _, _, _) in
=======
if let progress = self.core.move(item, to: destinationItem!, withName: item.name, options: nil, resultHandler: { (error, _, _, _) in
>>>>>>> 3aded8b... - Made de Duplicate action.
if let progress = self.core.move(item, to: destinationItem, withName: item.name, options: nil, resultHandler: { (error, _, _, _) in
if error != nil {
Log.log("Error \(String(describing: error)) moving \(String(describing: item.path))")
}
Expand Down

0 comments on commit 7edde84

Please sign in to comment.