Grr, revert the sorting.

This commit is contained in:
Jaime Thomas 2008-12-23 02:37:34 +00:00
parent 8f7bd3e2d9
commit ba80149a2e

View File

@ -1,20 +1,13 @@
/* vim: set sw=3 ts=3 sts=3 expandtab: */ /* vim: set sw=3 ts=3 sts=3 expandtab: */
#include "ecdb.h" #include "ecdb.h"
int
_drive_speed_sort(int *s1, int *s2)
{
return (*s1 > *s2) ? 0 : 1;
}
int int
ecdb_aquire_drive_info(void) ecdb_aquire_drive_info(void)
{ {
int ret, i, *s; int ret, i;
unsigned int drive_num; unsigned int drive_num;
struct burn_drive_info *drives_current; struct burn_drive_info *drives_current;
struct burn_speed_descriptor *speeds; struct burn_speed_descriptor *speeds;
Ecore_List *sort;
ret = 0; ret = 0;
if (em->drives) if (em->drives)
@ -68,24 +61,14 @@ ecdb_aquire_drive_info(void)
drive->read_speeds[0] = i + 1; drive->read_speeds[0] = i + 1;
drive->write_speeds[0] = i + 1; drive->write_speeds[0] = i + 1;
sort = ecore_list_new();
for (ret = 1; ret <= i; ret++) for (ret = 1; ret <= i; ret++)
{ {
ecore_list_append(sort, &speeds->write_speed); drive->write_speeds[ret] = speeds->write_speed;
drive->read_speeds[ret] = speeds->read_speed;
speeds = speeds->prev; speeds = speeds->prev;
} }
ecore_list_sort(sort, ECORE_COMPARE_CB(_drive_speed_sort),
ECORE_SORT_MIN);
ecore_list_first_goto(sort);
for (ret = 1; ret <= i; ret++)
{
s = ecore_list_next(sort);
drive->write_speeds[ret] = *s;
drive->read_speeds[ret] = *s;
}
ecore_list_destroy(sort);
burn_drive_free_speedlist(&speeds); burn_drive_free_speedlist(&speeds);
em->drives = eina_list_append(em->drives, drive); em->drives = eina_list_append(em->drives, drive);
} }