void PeerListContent::appendFoundRow(not_null<PeerListRow*> row) {
	Expects(showingSearch());

	auto index = findRowIndex(row);
	if (index.value < 0) {
		_filterResults.push_back(row);
	}
}
Exemple #2
0
int
util_addTableBodyRow(struct util_Table *Table, char **Contents) {
    struct util_TableRow *aRow;
    int indx,i,row,col;
    int thisRowLength=0;

    /* Allocate more Rows if required. */
    if (Table->numRows >= Table->numAllocatedRows) {
        Table->numAllocatedRows += UTIL_T_NUMALLOC_ROW;
        Table->Body=realloc(Table->Body,\
                    Table->numAllocatedRows*sizeof(struct util_TableRow*));
        for (i=0;i<UTIL_T_NUMALLOC_ROW;i++) {
            Table->Body[Table->numRows+i]=newTableRow(Table);
        }
    }
    aRow=newTableRow(Table);
    do_setTableRow(Table,aRow,Contents);
    if (Table->sortByColumn >= 0)  {
        indx=findRowIndex(Table,aRow);
        for (row=Table->numRows;row>indx;row--) {
            for (col=0;col<Table->numColumns;col++) {
                 strncpy(Table->Body[row]->CellContents[col],
                         Table->Body[row-1]->CellContents[col],
                         UTIL_T_MAX_CELLCONTENT_LEN);
            }
        }
    } else {
      indx=Table->numRows;
    }
    Table->numRows += 1;
    for (i=0;i<Table->numColumns;i++) {
        strncpy(Table->Body[indx]->CellContents[i],Contents[i],\
                UTIL_T_MAX_CELLCONTENT_LEN);
        thisRowLength += min(strlen(Contents[i]),UTIL_T_MAX_CELLCONTENT_LEN);
    }
    if (thisRowLength > Table->RowLength)
        Table->RowLength = thisRowLength;
    return Table->numRows-1;
}