Browse Source

remove deprecated profileViewController class

cyberta 5 years ago
parent
commit
fcbbf62827

+ 0 - 4
deltachat-ios.xcodeproj/project.pbxproj

@@ -30,7 +30,6 @@
 		78E45E4C21D404AE00D4B15E /* CustomMessageCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78E45E4B21D404AE00D4B15E /* CustomMessageCell.swift */; };
 		78ED838321D5379000243125 /* TextFieldCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78ED838221D5379000243125 /* TextFieldCell.swift */; };
 		78ED838D21D577D000243125 /* events.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78ED838C21D577D000243125 /* events.swift */; };
-		78ED838F21D5927A00243125 /* ProfileViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78ED838E21D5927A00243125 /* ProfileViewController.swift */; };
 		78ED839421D5AF8A00243125 /* QrCodeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78ED839321D5AF8A00243125 /* QrCodeView.swift */; };
 		7A0052C81FBE6CB40048C3BF /* NewContactController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A0052C71FBE6CB40048C3BF /* NewContactController.swift */; };
 		7A451D941FB1B1DB00177250 /* wrapper.c in Sources */ = {isa = PBXBuildFile; fileRef = 7A451D921FB1B1DB00177250 /* wrapper.c */; };
@@ -167,7 +166,6 @@
 		78E45E4B21D404AE00D4B15E /* CustomMessageCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomMessageCell.swift; sourceTree = "<group>"; };
 		78ED838221D5379000243125 /* TextFieldCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextFieldCell.swift; sourceTree = "<group>"; };
 		78ED838C21D577D000243125 /* events.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = events.swift; sourceTree = "<group>"; };
-		78ED838E21D5927A00243125 /* ProfileViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileViewController.swift; sourceTree = "<group>"; };
 		78ED839321D5AF8A00243125 /* QrCodeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QrCodeView.swift; sourceTree = "<group>"; };
 		7A0052C71FBE6CB40048C3BF /* NewContactController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewContactController.swift; sourceTree = "<group>"; };
 		7A451D921FB1B1DB00177250 /* wrapper.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wrapper.c; sourceTree = "<group>"; };
@@ -357,7 +355,6 @@
 				7092474020B3869500AF8799 /* ContactDetailViewController.swift */,
 				7AE0A5481FC42F65005ECB4B /* NewChatViewController.swift */,
 				AE0D26FC1FB1FE88002FAFCE /* ChatListController.swift */,
-				78ED838E21D5927A00243125 /* ProfileViewController.swift */,
 				30149D9222F21129003C12B5 /* QrViewController.swift */,
 				78E45E3921D3CFBC00D4B15E /* SettingsController.swift */,
 				7070FB9A2101ECBB000DC258 /* GroupNameController.swift */,
@@ -738,7 +735,6 @@
 				AEE56D762253431E007DC082 /* AccountSetupController.swift in Sources */,
 				AEACE2DD1FB323CA00DCDD78 /* ChatViewController.swift in Sources */,
 				AEE6EC412282DF5700EDC689 /* MailboxViewController.swift in Sources */,
-				78ED838F21D5927A00243125 /* ProfileViewController.swift in Sources */,
 				AEE6EC482283045D00EDC689 /* EditSettingsController.swift in Sources */,
 				7A9FB1441FB061E2001FEA36 /* AppDelegate.swift in Sources */,
 				AEE56D7D2253ADB4007DC082 /* HudHandler.swift in Sources */,

+ 0 - 164
deltachat-ios/Controller/ProfileViewController.swift

@@ -1,164 +0,0 @@
-import UIKit
-
-class ProfileViewController: UITableViewController {
-    var dcContext: DcContext
-    weak var coordinator: QRViewCoordinator?
-
-    var contact: DcContact? {
-        // This is nil if we do not have an account setup yet
-        if !DcConfig.configured {
-            return nil
-        }
-        return DcContact(id: Int(DC_CONTACT_ID_SELF))
-    }
-
-    var fingerprint: String? {
-        if !DcConfig.configured {
-            return nil
-        }
-
-        if let cString = dc_get_securejoin_qr(mailboxPointer, 0) {
-            let swiftString = String(cString: cString)
-            free(cString)
-            return swiftString
-        }
-
-        return nil
-    }
-
-    init(dcContext: DcContext) {
-        self.dcContext = dcContext
-        super.init(style: .plain)
-    }
-
-    required init?(coder _: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-
-    override func viewDidLoad() {
-        super.viewDidLoad()
-        title = String.localized("pref_profile_info_headline")
-    }
-
-    override func viewWillAppear(_: Bool) {
-        navigationController?.navigationBar.prefersLargeTitles = false
-        tableView.reloadData()
-    }
-
-    func displayNewChat(contactId: Int) {
-        let chatId = dc_create_chat_by_contact_id(mailboxPointer, UInt32(contactId))
-        let chatVC = ChatViewController(dcContext: dcContext, chatId: Int(chatId))
-
-        chatVC.hidesBottomBarWhenPushed = true
-        navigationController?.pushViewController(chatVC, animated: true)
-    }
-
-    override func didReceiveMemoryWarning() {
-        super.didReceiveMemoryWarning()
-        // Dispose of any resources that can be recreated.
-    }
-
-    // MARK: - Table view data source
-
-    override func numberOfSections(in _: UITableView) -> Int {
-        return 2
-    }
-
-    override func tableView(_: UITableView, numberOfRowsInSection section: Int) -> Int {
-        if section == 0 {
-            return 2
-        }
-
-        return 0
-    }
-
-    override func tableView(_: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
-        let row = indexPath.row
-
-        let cell = UITableViewCell(style: .default, reuseIdentifier: nil)
-        if indexPath.section == 0 {
-            if row == 0 {
-                if let fingerprint = self.fingerprint {
-                    //FIXME: this formatting is not correct for r-t-l languages
-                    //keeping it simple for now as it is not clear if we will show the FP this way
-                    cell.textLabel?.text = String.localized("qrscan_fingerprint_label") + ": \(fingerprint)"
-                    cell.textLabel?.textAlignment = .center
-                }
-            }
-            if row == 1 {
-                if let fingerprint = self.fingerprint {
-                    let width: CGFloat = 130
-
-                    let frame = CGRect(origin: .zero, size: .init(width: width, height: width))
-                    let imageView = QRCodeView(frame: frame)
-                    imageView.generateCode(
-                        fingerprint,
-                        foregroundColor: .darkText,
-                        backgroundColor: .white
-                    )
-                    imageView.translatesAutoresizingMaskIntoConstraints = false
-                    // imageView.center = cell.center
-                    cell.addSubview(imageView)
-
-                    imageView.centerXAnchor.constraint(equalTo: cell.centerXAnchor).isActive = true
-                    imageView.centerYAnchor.constraint(equalTo: cell.centerYAnchor).isActive = true
-                    imageView.widthAnchor.constraint(equalToConstant: width).isActive = true
-                    imageView.heightAnchor.constraint(equalToConstant: width).isActive = true
-                }
-            }
-        }
-
-        if indexPath.section == 1 {
-            if row == 0 {}
-        }
-
-        return cell
-    }
-
-    override func tableView(_: UITableView, didSelectRowAt _: IndexPath) {}
-
-    override func tableView(_: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
-        if section == 0 {
-            return 80
-        }
-
-        return 20
-    }
-
-    override func tableView(_: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
-        if indexPath.row == 1 {
-            return 150
-        }
-
-        return 46
-    }
-
-    override func tableView(_: UITableView, viewForHeaderInSection section: Int) -> UIView? {
-        let bg = UIColor(red: 248 / 255, green: 248 / 255, blue: 255 / 255, alpha: 1.0)
-        if section == 0 {
-            let contactCell = ContactCell()
-            if let contact = self.contact {
-                let name = DcConfig.displayname ?? contact.displayName
-                contactCell.backgroundColor = bg
-                contactCell.nameLabel.text = name
-                contactCell.emailLabel.text = contact.email
-                contactCell.darkMode = false
-                contactCell.selectionStyle = .none
-                if let img = contact.profileImage {
-                    contactCell.setImage(img)
-                } else {
-                    contactCell.setBackupImage(name: name, color: contact.color)
-                }
-                contactCell.setVerified(isVerified: contact.isVerified)
-            } else {
-                contactCell.nameLabel.text = String.localized("no_account_setup")
-            }
-            return contactCell
-        }
-
-        let vw = UIView()
-        vw.backgroundColor = bg
-
-        return vw
-    }
-}