[gnome-boxes] installer: Filter drivers by architecture first
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes] installer: Filter drivers by architecture first
- Date: Tue, 19 Mar 2013 15:46:09 +0000 (UTC)
commit 864a474d0ddbeb00cf6c5a88ca4b24e982eac736
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Fri Mar 15 02:19:07 2013 +0200
installer: Filter drivers by architecture first
Just like media, the usual scenerio would be for an OS to provide
multiple variants of the same driver, one for each architecture. So its
more optimal to first filter devices by compatible architecture and then
filter the resulting drivers list by other compatibility criterias.
https://bugzilla.gnome.org/show_bug.cgi?id=691546
src/unattended-installer.vala | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/src/unattended-installer.vala b/src/unattended-installer.vala
index 53cc570..9b939ba 100644
--- a/src/unattended-installer.vala
+++ b/src/unattended-installer.vala
@@ -792,9 +792,6 @@ private class Boxes.UnattendedInstaller: InstallerMedia {
foreach (var d in os.get_device_drivers ().get_elements ()) {
var driver = d as DeviceDriver;
- if (!test_func (driver))
- continue;
-
var compatibility = compare_cpu_architectures (os_media.architecture, driver.get_architecture
());
var location = driver.get_location ();
if (compatibility == CPUArchCompatibility.IDENTICAL)
@@ -809,8 +806,10 @@ private class Boxes.UnattendedInstaller: InstallerMedia {
// hashtable is destroyed at the end of this function. Also we can't just use drivers.get_values
().copy ()
// as we need a deep copy of drivers.
var ret = new GLib.List<DeviceDriver> ();
- foreach (var driver in drivers.get_values ())
- ret.prepend (driver);
+ foreach (var driver in drivers.get_values ()) {
+ if (test_func (driver))
+ ret.prepend (driver);
+ }
ret.reverse ();
return ret;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]