diff --git a/shell_integration/MacOSX/NextcloudIntegration/FileProviderUIExt/ShareTableItemView.swift b/shell_integration/MacOSX/NextcloudIntegration/FileProviderUIExt/ShareTableItemView.swift index b20527e2e..fe68e91a7 100644 --- a/shell_integration/MacOSX/NextcloudIntegration/FileProviderUIExt/ShareTableItemView.swift +++ b/shell_integration/MacOSX/NextcloudIntegration/FileProviderUIExt/ShareTableItemView.swift @@ -6,12 +6,25 @@ // import AppKit +import NextcloudKit class ShareTableItemView: NSTableCellView { - @IBOutlet weak var typeImageView: NSImageView! - @IBOutlet weak var label: NSTextField! - @IBOutlet weak var copyLinkButton: NSButton! - @IBOutlet weak var optionsButton: NSButton! + @IBOutlet private weak var typeImageView: NSImageView! + @IBOutlet private weak var label: NSTextField! + @IBOutlet private weak var copyLinkButton: NSButton! + @IBOutlet private weak var optionsButton: NSButton! + + var share: NKShare? { + didSet { + guard let share = share else { + prepareForReuse() + return + } + typeImageView.image = share.typeImage + label.stringValue = share.displayString + copyLinkButton.isHidden = share.shareType != NKShare.ShareType.publicLink.rawValue + } + } override func prepareForReuse() { typeImageView.image = nil diff --git a/shell_integration/MacOSX/NextcloudIntegration/FileProviderUIExt/ShareTableViewDataSource.swift b/shell_integration/MacOSX/NextcloudIntegration/FileProviderUIExt/ShareTableViewDataSource.swift index 8a5f53b13..f86829876 100644 --- a/shell_integration/MacOSX/NextcloudIntegration/FileProviderUIExt/ShareTableViewDataSource.swift +++ b/shell_integration/MacOSX/NextcloudIntegration/FileProviderUIExt/ShareTableViewDataSource.swift @@ -146,7 +146,7 @@ class ShareTableViewDataSource: NSObject, NSTableViewDataSource, NSTableViewDele Logger.sharesDataSource.error("Acquired item view from table is not a Share item view!") return nil } - view.label.stringValue = share.label + view.share = share return view } }