MCPcopy Create free account
hub / github.com/cgsecurity/testdisk / select_disk

Method select_disk

src/qphotorec.cpp:304–324  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

302}
303
304void QPhotorec::select_disk(disk_t *disk)
305{
306 if(disk==NULL)
307 return ;
308 selected_disk=disk;
309 selected_partition=NULL;
310 autodetect_arch(selected_disk, &arch_none);
311 log_info("%s\n", selected_disk->description_short(selected_disk));
312 part_free_list(list_part);
313 list_part=init_list_part(selected_disk, NULL);
314 /* If only whole disk is listed, select it */
315 /* If there is the whole disk and only one partition, select the partition */
316 if(list_part!=NULL)
317 {
318 if(list_part->next==NULL)
319 selected_partition=list_part->part;
320 else if(list_part->next->next==NULL)
321 selected_partition=list_part->next->part;
322 }
323 log_all_partitions(selected_disk, list_part);
324}
325
326void QPhotorec::disk_changed(int index)
327{

Callers

nothing calls this directly

Calls 4

autodetect_archFunction · 0.85
part_free_listFunction · 0.85
init_list_partFunction · 0.85
log_all_partitionsFunction · 0.85

Tested by

no test coverage detected