Ejemplo n.º 1
0
void uiFileDetailsTreeView::on_view_file_details()
{
	std::vector<Gtk::TreeModel::Path> sel = mrp_Selection->get_selected_rows();
	if (sel.size() == 1)
	{
		show_file_details(mrp_ListStore->get_iter(sel[0]));
	}

}
Ejemplo n.º 2
0
void show_file(int flag_parameter, char * path_name)
{
	int i, j;
	struct stat buf;
	char name[NAME_MAX + 1];
	
	//从路径中解析出文件名;
	for(i = 0, j = 0; i < strlen(path_name); i ++)
	{
		if(path_name[i]  == '/')
		{
			j = 0;
			continue;
		}
		name[j++] = path_name[i];
	}

	//printf("debug %s",name);
	name[j] = 0;
	
	if(lstat(path_name, &buf) == -1)
	{
		show_error("stat", __LINE__);	
	}
	
	switch(flag_parameter)
	{
		case PARAM_NO:
			if(name[0] != '.')
			{
			//	printf("debug:filename[0]: %c", name[0]);
				show_a_filename(name);
	//		printf("debug ===-=========%d ", maxlength);
			}
			break;			
			
			
		case PARAM_A:
		
			show_a_filename(name);			
			break;
						
		case PARAM_L:
			//printf("debug III");
			show_file_details(buf, name);
			printf("%-s\n", name);	
			//printf("debug III");		
			break;
		
		case PARAM_A + PARAM_L:
		
			show_file_details(buf, name);
			printf("%-s\n", name);			
			break;
			
		default:			
			break;
			
			
	} 
}