Change Profiles page and Daily Records box in right sidebar to show data for most recently used machine.

- Changed Profile::GetMachine() to find machine with latest lastImportDate when there were multiple machines in a profile.
- Previously, OSCAR would shown the "first" machine in its list, without clarity about how a machine was designated "first".
This commit is contained in:
Guy Scharf 2020-09-12 09:53:36 -07:00 committed by Guy Scharf
parent abf0747b50
commit ade32fa914

View File

@ -941,7 +941,14 @@ Machine *Profile::GetMachine(MachineType t)
return nullptr;
}
return vec[0];
// Find most recently imported machine
int idx = 0;
for (int i=1; i < vec.size(); i++) {
if (vec[i]->lastImported() > vec[idx]->lastImported())
idx = i;
}
return vec[idx];
}
//bool Profile::trashMachine(Machine * mach)