pEpForiOS/UI/EmailDisplay/EmailListViewController.swift
changeset 1678 8eb2c23637d6
parent 1675 21f792356f97
child 1680 a958aa6e5982
     1.1 --- a/pEpForiOS/UI/EmailDisplay/EmailListViewController.swift	Fri Feb 10 17:13:37 2017 +0100
     1.2 +++ b/pEpForiOS/UI/EmailDisplay/EmailListViewController.swift	Fri Feb 10 17:13:38 2017 +0100
     1.3 @@ -19,6 +19,9 @@
     1.4  }
     1.5  
     1.6  class EmailListViewController: UITableViewController {
     1.7 +    /** For debug output */
     1.8 +    let compMessageCount = "messageCount"
     1.9 +
    1.10      struct UIState {
    1.11          var isSynching: Bool = false
    1.12      }
    1.13 @@ -103,6 +106,7 @@
    1.14  
    1.15      override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
    1.16          if let fol = config?.folder  {
    1.17 +            Log.info(component: #function, content: "\(compMessageCount) \(fol.messageCount())")
    1.18              return fol.messageCount()
    1.19          }
    1.20          return 0
    1.21 @@ -380,7 +384,13 @@
    1.22                      // new message has arrived
    1.23                      if let index = folder.indexOf(message: msg) {
    1.24                          let ip = IndexPath(row: index, section: 0)
    1.25 +                        Log.info(
    1.26 +                            component: #function,
    1.27 +                            content: "\(compMessageCount) inserting at \(ip), current \(tableView.numberOfRows(inSection: 0))")
    1.28                          tableView.insertRows(at: [ip], with: .automatic)
    1.29 +                        Log.info(
    1.30 +                            component: #function,
    1.31 +                            content: "\(compMessageCount) now \(tableView.numberOfRows(inSection: 0))")
    1.32                      } else {
    1.33                          tableView.reloadData()
    1.34                      }
    1.35 @@ -407,14 +417,9 @@
    1.36  
    1.37  extension EmailListViewController: MessageFolderDelegate {
    1.38      func didChange(messageFolder: MessageFolder) {
    1.39 -        if let msg = messageFolder as? Message {
    1.40 -            if msg.isOriginal {
    1.41 -                Log.info(component: #function, content: "new message")
    1.42 -            } else {
    1.43 -                Log.info(component: #function, content: "flag changes?")
    1.44 -            }
    1.45 -        }
    1.46          GCD.onMainWait {
    1.47 +            Log.info(component: #function,
    1.48 +                     content: "\(self.compMessageCount) \(self.config?.folder?.messageCount())")
    1.49              self.didChangeInternal(messageFolder: messageFolder)
    1.50          }
    1.51      }