From 56ce10022a9c76279b2ced5ae3897b5ceffd36ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=B6ller?= Date: Mon, 13 Sep 2010 22:55:25 +0000 Subject: [PATCH] Fixed some hardware sorting issue in the gadget. Hardware with the same type and name would be added to the same section. --- GUI/SensorGadget.cs | 2 +- Hardware/Identifier.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/GUI/SensorGadget.cs b/GUI/SensorGadget.cs index f5f0d31..a91c4a8 100644 --- a/GUI/SensorGadget.cs +++ b/GUI/SensorGadget.cs @@ -486,7 +486,7 @@ namespace OpenHardwareMonitor.GUI { if (x.HardwareType != y.HardwareType) return x.HardwareType.CompareTo(y.HardwareType); - return x.Name.CompareTo(y.Name); + return x.Identifier.CompareTo(y.Identifier); } } } diff --git a/Hardware/Identifier.cs b/Hardware/Identifier.cs index 1e95851..07f0029 100644 --- a/Hardware/Identifier.cs +++ b/Hardware/Identifier.cs @@ -101,8 +101,8 @@ namespace OpenHardwareMonitor.Hardware { } public static bool operator ==(Identifier id1, Identifier id2) { - if (id1 == null) - return id2 == null; + if (id1.Equals(null)) + return id2.Equals(null); else return id1.Equals(id2); }