model_server/gala_communications/src/Application.cxx
// returns -1 if the item is not found, index otherwise
1 if the item is not found, index otherwise
1 if the item is not found index otherwise
int Application::getServiceListItemIndex(const vchar* attributeName,
			      const vchar* attributeValue)
{
    int valToRet = -1;
    if (service_list) {
	for (int i = 0; i < service_list->GetColumnCount(); i++){
	    vsession* session = (vsession*) service_list->GetCellValue(0, i);
	    vscribe* valueScribe = session->FindAttributeScribe(vnameInternGlobal(attributeName));
	    if (valueScribe) {
		vchar* valueChar = (vchar*) valueScribe->GetString();
		if (vcharCompare(valueChar, attributeValue) ==0)
		    valToRet = i;
	    }
	}
    }
    return valToRet;
}
int Application :: getServiceListItemIndex ( const vchar * attributeName , const vchar * attributeValue ) { int valToRet = -1 ; if ( service_list ) { for ( int i = 0 ; i < service_list -> GetColumnCount ( ) ; i ++ ) { vsession * session = ( vsession * ) service_list -> GetCellValue ( 0 , i ) ; vscribe * valueScribe = session -> FindAttributeScribe ( vnameInternGlobal ( attributeName ) ) ; if ( valueScribe ) { vchar * valueChar = ( vchar * ) valueScribe -> GetString ( ) ; if ( vcharCompare ( valueChar , attributeValue ) == 0 ) valToRet = i ; } } } return valToRet ; }
returns -1 if the item is not found, index otherwise
returns - 1 if the item is not found index otherwise