Set basic property of sharetableitemview in delegate method of data source

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2024-02-28 00:20:43 +08:00
parent c2ec72c132
commit ee21715860

View file

@ -138,8 +138,14 @@ class ShareTableViewDataSource: NSObject, NSTableViewDataSource, NSTableViewDele
@objc func tableView( @objc func tableView(
_ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int _ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int
) -> NSView? { ) -> NSView? {
//let share = shares[row] let share = shares[row]
let view = tableView.makeView(withIdentifier: shareItemViewIdentifier, owner: self) guard let view = tableView.makeView(
withIdentifier: shareItemViewIdentifier, owner: self
) as? ShareTableItemView else {
Logger.sharesDataSource.error("Acquired item view from table is not a Share item view!")
return nil
}
view.label.stringValue = share.label
return view return view
} }
} }