All pastes #38036 Raw Edit

asfa

public c v1 · immutable
#38036 ·published 2006-01-22 17:20 UTC
rendered paste body
else{			//For Autoselection			char *search_word;			int row_count=e_selection_model_row_count(reflow->selection);			int model_index = e_selection_model_cursor_row (reflow->selection);			int view_index = e_sorter_model_to_sorted (reflow->selection->sorter, model_index);			int i=0,result_matched=0,index=21;			int *mapping=(int*)malloc(sizeof(int)*row_count);			//Map model_index to view_index			for(i=0;i<row_count;i++){				mapping[i]=e_sorter_model_to_sorted(reflow->selection->sorter,i);			}			g_print("total contacts=%d",i);			search_word=gdk_keyval_name(event->key.keyval);			g_print("You pressed %s",search_word);			//	EContactName *contact_name=e_contact_get(e_minicard->contact,E_CONTACT_NAME);			//	char *name=e_contact_name_to_string(contact_name);			//	e_contact_name_free(contact_name);			//	g_print("name=%d",e_minicard->has_focus);			//g_print("map=%d",mapping[0]);			//EMinicard *temp=E_MINICARD(reflow->items[model_index]);			//g_print("\nfocus=%dmodel_index=%d\n",temp->has_focus,model_index);			//for(i=0;i<10;i++)			//	{			//temp=E_MINICARD(reflow->items[i]);			//g_print("\nfocus=%di=%d\n",temp->has_focus,i);			//	}			EMinicard *temp;				temp=E_MINICARD(reflow->items[model_index]);				g_print("\nfocus=%dmodel_index=%d\n",temp->has_focus,model_index);				temp=E_MINICARD(reflow->items[view_index]);				g_print("\nfocus=%dview_index=%d\n",temp->has_focus,view_index);			//Perform search				//	EMinicard *temp;				for(i=0;i<5;i++){				temp=E_MINICARD(reflow->items[i]);				char *data="";				g_print("focus=%di=%d",temp->has_focus,i);				//result_matched=0;				g_print("Here is the problem");				EContactName *contact_name=e_contact_get(temp->contact,E_CONTACT_NAME);				//g_object_get(temp->contact,"full_name",&data,NULL);				g_print("HI");				if(contact_name){					char *name=e_contact_name_to_string(contact_name);					e_contact_name_free(contact_name);					printf("I entered inside");					if(g_utf8_validate(name,-1,NULL)){						if(strstr(name,search_word)){							e_canvas_item_grab_focus(reflow->items[i],TRUE);							//result_matched=1;							break;						}					}				}								}					} 	}		break;