Marino Faggiana 7 年之前
父節點
當前提交
70c0084555
共有 3 個文件被更改,包括 11 次插入11 次删除
  1. 9 9
      iOSClient/Create/CCCreateCloud.swift
  2. 1 1
      iOSClient/Main/CCMain.m
  3. 1 1
      iOSClient/Text/NCText.swift

+ 9 - 9
iOSClient/Create/CCCreateCloud.swift

@@ -228,14 +228,14 @@ class CreateFormUploadAssets: XLFormViewController, CCMoveDelegate {
     
     let appDelegate = UIApplication.shared.delegate as! AppDelegate
 
-    convenience init(_ titleServerUrl : String?, serverUrl : String, assets : NSMutableArray, cryptated : Bool, session : String, delegate: createFormUploadAssetsDelegate) {
+    convenience init(serverUrl : String, assets : NSMutableArray, cryptated : Bool, session : String, delegate: createFormUploadAssetsDelegate) {
         
         self.init()
         
-        if titleServerUrl == nil || titleServerUrl?.isEmpty == true {
-            self.titleServerUrl = "/"
+        if serverUrl == CCUtility.getHomeServerUrlActiveUrl(appDelegate.activeUrl) {
+            titleServerUrl = "/"
         } else {
-            self.titleServerUrl = titleServerUrl
+            titleServerUrl = (serverUrl as NSString).lastPathComponent
         }
         
         self.serverUrl = serverUrl
@@ -579,21 +579,21 @@ class CreateFormUploadFile: XLFormViewController, CCMoveDelegate {
     
     let appDelegate = UIApplication.shared.delegate as! AppDelegate
     
-    convenience init(_ titleServerUrl: String, serverUrl: String, text: String, fileName: String) {
+    convenience init(serverUrl: String, text: String, fileName: String) {
         
         self.init()
         
-        if titleServerUrl.isEmpty == true {
-            self.titleServerUrl = "/"
+        if serverUrl == CCUtility.getHomeServerUrlActiveUrl(appDelegate.activeUrl) {
+            titleServerUrl = "/"
         } else {
-            self.titleServerUrl = titleServerUrl
+            titleServerUrl = (serverUrl as NSString).lastPathComponent
         }
         
         self.fileName = fileName
         self.serverUrl = serverUrl
         self.text = text
         
-        self.initializeForm()
+        initializeForm()
     }
     
     //MARK: XLFormDescriptorDelegate

+ 1 - 1
iOSClient/Main/CCMain.m

@@ -745,7 +745,7 @@
 {
     [picker dismissViewControllerAnimated:YES completion:^{
         
-        CreateFormUploadAssets *form = [[CreateFormUploadAssets alloc] init:_titleMain serverUrl:_serverUrl assets:assets cryptated:_isPickerCriptate session:k_upload_session delegate:self];
+        CreateFormUploadAssets *form = [[CreateFormUploadAssets alloc] initWithServerUrl:_serverUrl assets:assets cryptated:_isPickerCriptate session:k_upload_session delegate:self];
         form.title = NSLocalizedString(@"_upload_photos_videos_", nil);
         
         UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:form];

+ 1 - 1
iOSClient/Text/NCText.swift

@@ -120,7 +120,7 @@ class NCText: UIViewController, UITextViewDelegate {
             
         } else {
             
-            let formViewController = CreateFormUploadFile.init(NSLocalizedString("_untitled_txt_", comment: ""), serverUrl: appDelegate.activeMain.serverUrl, text: self.textView.text, fileName: NSLocalizedString("_untitled_txt_", comment: ""))
+            let formViewController = CreateFormUploadFile.init(serverUrl: appDelegate.activeMain.serverUrl, text: self.textView.text, fileName: NSLocalizedString("_untitled_txt_", comment: ""))            
             self.navigationController?.pushViewController(formViewController, animated: true)
         }
     }