     // Not NSTableViewDataSource, but related
 
 
-    func searchIncidents(incidents: [Incident]) -> [Incident] {
+    func searchIncidents(incidents incidents: [Incident], searchText: String) -> [Incident] {
         let searchText = self.searchText
 
         if searchText.characters.count == 0 {



    var filteredIncidentsCache: FilteredIncidentsCache {
        if let cache = _filteredIncidentsCache {
            if cache.searchText == searchText {
                return cache
            }
        }

        var filteredAllIncidents   : [Incident] = []
        var filteredOpenIncidents  : [Incident] = []
        var filteredActiveIncidents: [Incident] = []

        for incident in sortedIncidents {
            filteredAllIncidents.append(incident)

            if incident.state != IncidentState.Closed {
                filteredOpenIncidents.append(incident)

                if incident.state != IncidentState.OnHold {
                    filteredActiveIncidents.append(incident)
                }
            }
        }

        _filteredIncidentsCache = FilteredIncidentsCache(
            searchText: searchText,
            allIncidents: filteredAllIncidents,
            openIncidents: filteredOpenIncidents,
            activeIncidents: filteredActiveIncidents
        )
        
        return _filteredIncidentsCache!
    }
    private var _filteredIncidentsCache: FilteredIncidentsCache? = nil


    convenience init(appDelegate: AppDelegate) {



    func incidentForTableRow(rowIndex: Int) throws -> Incident {
        let viewableIncidents = self.viewableIncidents

        guard rowIndex >= 0 else {
            throw DispatchQueueTableSourceError.RowIndexOutOfRange(rowIndex)
        }
        
        guard rowIndex < viewableIncidents.count else {
            throw DispatchQueueTableSourceError.RowIndexOutOfRange(rowIndex)
        }

